diff --git a/core/deco.h b/core/deco.h index ffb52f959..4a10b7366 100644 --- a/core/deco.h +++ b/core/deco.h @@ -6,11 +6,29 @@ extern "C" { #endif +struct dive; +struct deco_state; +struct decostop; + extern const double buehlmann_N2_t_halflife[]; extern int deco_allowed_depth(double tissues_tolerance, double surface_pressure, const struct dive *dive, bool smooth); double get_gf(struct deco_state *ds, double ambpressure_bar, const struct dive *dive); +extern void clear_deco(struct deco_state *ds, double surface_pressure); +extern void dump_tissues(struct deco_state *ds); +extern void set_gf(short gflow, short gfhigh); +extern void set_vpmb_conservatism(short conservatism); +extern void cache_deco_state(struct deco_state *source, struct deco_state **datap); +extern void restore_deco_state(struct deco_state *data, struct deco_state *target, bool keep_vpmb_state); +extern void nuclear_regeneration(struct deco_state *ds, double time); +extern void vpmb_start_gradient(struct deco_state *ds); +extern void vpmb_next_gradient(struct deco_state *ds, double deco_time, double surface_pressure); +extern double tissue_tolerance_calc(struct deco_state *ds, const struct dive *dive, double pressure); +extern void calc_crushing_pressure(struct deco_state *ds, double pressure); +extern void vpmb_start_gradient(struct deco_state *ds); +extern void clear_vpmb_state(struct deco_state *ds); +extern void printdecotable(struct decostop *table); extern double regressiona(); extern double regressionb(); diff --git a/core/dive.h b/core/dive.h index 406a7b672..40ac9fb00 100644 --- a/core/dive.h +++ b/core/dive.h @@ -449,20 +449,9 @@ struct deco_state { }; extern void add_segment(struct deco_state *ds, double pressure, struct gasmix gasmix, int period_in_seconds, int setpoint, enum divemode_t divemode, int sac); -extern void clear_deco(struct deco_state *ds, double surface_pressure); -extern void dump_tissues(struct deco_state *ds); -extern void set_gf(short gflow, short gfhigh); -extern void set_vpmb_conservatism(short conservatism); -extern void cache_deco_state(struct deco_state *source, struct deco_state **datap); -extern void restore_deco_state(struct deco_state *data, struct deco_state *target, bool keep_vpmb_state); -extern void nuclear_regeneration(struct deco_state *ds, double time); -extern void vpmb_start_gradient(struct deco_state *ds); -extern void vpmb_next_gradient(struct deco_state *ds, double deco_time, double surface_pressure); -extern double tissue_tolerance_calc(struct deco_state *ds, const struct dive *dive, double pressure); extern bool is_dc_planner(const struct divecomputer *dc); extern bool has_planned(const struct dive *dive, bool planned); - /* this should be converted to use our types */ struct divedatapoint { int time; @@ -499,10 +488,6 @@ struct decostop { int time; }; extern bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, int timestep, struct decostop *decostoptable, struct deco_state **cached_datap, bool is_planner, bool show_disclaimer); -extern void calc_crushing_pressure(struct deco_state *ds, double pressure); -extern void vpmb_start_gradient(struct deco_state *ds); -extern void clear_vpmb_state(struct deco_state *ds); -extern void printdecotable(struct decostop *table); /* Since C doesn't have parameter-based overloading, two versions of get_next_event. */ extern const struct event *get_next_event(const struct event *event, const char *name); diff --git a/core/divelist.c b/core/divelist.c index 292e90c73..71a4b9bda 100644 --- a/core/divelist.c +++ b/core/divelist.c @@ -12,6 +12,7 @@ #include #include "subsurface-string.h" +#include "deco.h" #include "divesite.h" #include "divelist.h" #include "display.h" diff --git a/core/settings/qPrefTechnicalDetails.cpp b/core/settings/qPrefTechnicalDetails.cpp index 78e2c13d0..22cea8c74 100644 --- a/core/settings/qPrefTechnicalDetails.cpp +++ b/core/settings/qPrefTechnicalDetails.cpp @@ -1,8 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include "qPrefTechnicalDetails.h" #include "qPrefPrivate.h" - - +#include "core/deco.h" static const QString group = QStringLiteral("TecDetails"); diff --git a/desktop-widgets/preferences/preferences_graph.cpp b/desktop-widgets/preferences/preferences_graph.cpp index 2b3c35135..74c248dc4 100644 --- a/desktop-widgets/preferences/preferences_graph.cpp +++ b/desktop-widgets/preferences/preferences_graph.cpp @@ -7,7 +7,7 @@ #include #include "qt-models/models.h" -#include "core/dive.h" // TODO: replace by deco.h +#include "core/deco.h" PreferencesGraph::PreferencesGraph() : AbstractPreferencesWidget(tr("Profile"), QIcon(":graph-icon"), 5) { diff --git a/desktop-widgets/preferences/preferences_graph.h b/desktop-widgets/preferences/preferences_graph.h index 4fc9cd5b3..8b0ea1adc 100644 --- a/desktop-widgets/preferences/preferences_graph.h +++ b/desktop-widgets/preferences/preferences_graph.h @@ -23,7 +23,6 @@ private slots: private: Ui::PreferencesGraph *ui; - }; #endif diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index 2dfeff7eb..5a8889802 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -9,6 +9,7 @@ #include "core/settings/qPrefDivePlanner.h" #include "desktop-widgets/command.h" #include "core/gettextfromc.h" +#include "core/deco.h" #include #include #include