summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/deco.c15
-rw-r--r--core/dive.h2
-rw-r--r--core/planner.c2
-rw-r--r--core/subsurface-qt/SettingsObjectWrapper.cpp23
-rw-r--r--core/subsurface-qt/SettingsObjectWrapper.h3
5 files changed, 8 insertions, 37 deletions
diff --git a/core/deco.c b/core/deco.c
index d58e6dc0a..4871bfd75 100644
--- a/core/deco.c
+++ b/core/deco.c
@@ -45,7 +45,6 @@ struct buehlmann_config {
double gf_high; //! gradient factor high (at surface).
double gf_low; //! gradient factor low (at bottom/start of deco calculation).
double gf_low_position_min; //! gf_low_position below surface_min_shallow.
- bool gf_low_at_maxdepth; //! if true, gf_low applies at max. depth instead of at deepest ceiling.
};
struct buehlmann_config buehlmann_config = {
@@ -55,7 +54,6 @@ struct buehlmann_config buehlmann_config = {
.gf_high = 0.75,
.gf_low = 0.35,
.gf_low_position_min = 1.0,
- .gf_low_at_maxdepth = false
};
//! Option structure for VPM-B decompression.
@@ -252,10 +250,8 @@ double tissue_tolerance_calc(const struct dive *dive, double pressure)
((1.0 - deco_state->buehlmann_inertgas_b[ci]) * gf_low + deco_state->buehlmann_inertgas_b[ci]);
if (tissue_lowest_ceiling[ci] > lowest_ceiling)
lowest_ceiling = tissue_lowest_ceiling[ci];
- if (!buehlmann_config.gf_low_at_maxdepth) {
- if (lowest_ceiling > deco_state->gf_low_pressure_this_dive)
- deco_state->gf_low_pressure_this_dive = lowest_ceiling;
- }
+ if (lowest_ceiling > deco_state->gf_low_pressure_this_dive)
+ deco_state->gf_low_pressure_this_dive = lowest_ceiling;
}
for (ci = 0; ci < 16; ci++) {
double tolerated;
@@ -498,9 +494,6 @@ void add_segment(double pressure, const struct gasmix *gasmix, int period_in_sec
fill_pressures(&pressures, pressure - ((in_planner() && (decoMode() == VPMB)) ? WV_PRESSURE_SCHREINER : WV_PRESSURE),
gasmix, (double) ccpo2 / 1000.0, dive->dc.divemode);
- if (buehlmann_config.gf_low_at_maxdepth && pressure > deco_state->gf_low_pressure_this_dive)
- deco_state->gf_low_pressure_this_dive = pressure;
-
for (ci = 0; ci < 16; ci++) {
double pn2_oversat = pressures.n2 - deco_state->tissue_n2_sat[ci];
double phe_oversat = pressures.he - deco_state->tissue_he_sat[ci];
@@ -553,7 +546,6 @@ void clear_deco(double surface_pressure)
deco_state->he_regen_radius[ci] = get_crit_radius_He();
}
deco_state->gf_low_pressure_this_dive = surface_pressure;
- if (!buehlmann_config.gf_low_at_maxdepth)
deco_state->gf_low_pressure_this_dive += buehlmann_config.gf_low_position_min;
deco_state->max_ambient_pressure = 0.0;
}
@@ -603,13 +595,12 @@ int deco_allowed_depth(double tissues_tolerance, double surface_pressure, struct
return depth;
}
-void set_gf(short gflow, short gfhigh, bool gf_low_at_maxdepth)
+void set_gf(short gflow, short gfhigh)
{
if (gflow != -1)
buehlmann_config.gf_low = (double)gflow / 100.0;
if (gfhigh != -1)
buehlmann_config.gf_high = (double)gfhigh / 100.0;
- buehlmann_config.gf_low_at_maxdepth = gf_low_at_maxdepth;
}
void set_vpmb_conservatism(short conservatism)
diff --git a/core/dive.h b/core/dive.h
index 43464118f..c5cc7cc4b 100644
--- a/core/dive.h
+++ b/core/dive.h
@@ -866,7 +866,7 @@ struct deco_state {
extern void add_segment(double pressure, const struct gasmix *gasmix, int period_in_seconds, int setpoint, const struct dive *dive, int sac);
extern void clear_deco(double surface_pressure);
extern void dump_tissues(void);
-extern void set_gf(short gflow, short gfhigh, bool gf_low_at_maxdepth);
+extern void set_gf(short gflow, short gfhigh);
extern void set_vpmb_conservatism(short conservatism);
extern void cache_deco_state(struct deco_state **datap);
extern void restore_deco_state(struct deco_state *data, bool keep_vpmb_state);
diff --git a/core/planner.c b/core/planner.c
index da6ed7d73..3ea829ba4 100644
--- a/core/planner.c
+++ b/core/planner.c
@@ -685,7 +685,7 @@ bool plan(struct diveplan *diveplan, struct dive *dive, int timestep, struct dec
bool o2breaking = false;
int decostopcounter = 0;
- set_gf(diveplan->gflow, diveplan->gfhigh, prefs.gf_low_at_maxdepth);
+ set_gf(diveplan->gflow, diveplan->gfhigh);
set_vpmb_conservatism(diveplan->vpmb_conservatism);
if (!diveplan->surface_pressure)
diveplan->surface_pressure = SURFACE_PRESSURE;
diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp
index 720a887d6..4fcb96580 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.cpp
+++ b/core/subsurface-qt/SettingsObjectWrapper.cpp
@@ -396,11 +396,6 @@ bool TechnicalDetailsSettings::showSac() const
return prefs.show_sac;
}
-bool TechnicalDetailsSettings::gfLowAtMaxDepth() const
-{
- return prefs.gf_low_at_maxdepth;
-}
-
bool TechnicalDetailsSettings::displayUnusedTanks() const
{
return prefs.display_unused_tanks;
@@ -561,7 +556,7 @@ void TechnicalDetailsSettings::setGflow(int value)
s.beginGroup(group);
s.setValue("gflow", value);
prefs.gflow = value;
- set_gf(prefs.gflow, prefs.gfhigh, prefs.gf_low_at_maxdepth);
+ set_gf(prefs.gflow, prefs.gfhigh);
emit gflowChanged(value);
}
@@ -574,7 +569,7 @@ void TechnicalDetailsSettings::setGfhigh(int value)
s.beginGroup(group);
s.setValue("gfhigh", value);
prefs.gfhigh = value;
- set_gf(prefs.gflow, prefs.gfhigh, prefs.gf_low_at_maxdepth);
+ set_gf(prefs.gflow, prefs.gfhigh);
emit gfhighChanged(value);
}
@@ -684,18 +679,6 @@ void TechnicalDetailsSettings::setShowSac(bool value)
emit showSacChanged(value);
}
-void TechnicalDetailsSettings::setGfLowAtMaxDepth(bool value)
-{
- if (value == prefs.gf_low_at_maxdepth)
- return;
- QSettings s;
- s.beginGroup(group);
- s.setValue("gf_low_at_maxdepth", value);
- prefs.gf_low_at_maxdepth = value;
- set_gf(prefs.gflow, prefs.gfhigh, prefs.gf_low_at_maxdepth);
- emit gfLowAtMaxDepthChanged(value);
-}
-
void TechnicalDetailsSettings::setDisplayUnusedTanks(bool value)
{
if (value == prefs.display_unused_tanks)
@@ -2244,7 +2227,7 @@ void SettingsObjectWrapper::load()
GET_BOOL("show_ccr_setpoint",show_ccr_setpoint);
GET_BOOL("show_ccr_sensors",show_ccr_sensors);
GET_BOOL("zoomed_plot", zoomed_plot);
- set_gf(prefs.gflow, prefs.gfhigh, prefs.gf_low_at_maxdepth);
+ set_gf(prefs.gflow, prefs.gfhigh);
set_vpmb_conservatism(prefs.vpmb_conservatism);
GET_BOOL("show_sac", show_sac);
GET_BOOL("display_unused_tanks", display_unused_tanks);
diff --git a/core/subsurface-qt/SettingsObjectWrapper.h b/core/subsurface-qt/SettingsObjectWrapper.h
index 824d1023d..bbc762e28 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.h
+++ b/core/subsurface-qt/SettingsObjectWrapper.h
@@ -133,7 +133,6 @@ class TechnicalDetailsSettings : public QObject {
Q_PROPERTY(bool show_ccr_sensors READ showCCRSensors WRITE setShowCCRSensors NOTIFY showCCRSensorsChanged)
Q_PROPERTY(bool zoomed_plot READ zoomedPlot WRITE setZoomedPlot NOTIFY zoomedPlotChanged)
Q_PROPERTY(bool show_sac READ showSac WRITE setShowSac NOTIFY showSacChanged)
- Q_PROPERTY(bool gf_low_at_maxdepth READ gfLowAtMaxDepth WRITE setGfLowAtMaxDepth NOTIFY gfLowAtMaxDepthChanged)
Q_PROPERTY(bool display_unused_tanks READ displayUnusedTanks WRITE setDisplayUnusedTanks NOTIFY displayUnusedTanksChanged)
Q_PROPERTY(bool show_average_depth READ showAverageDepth WRITE setShowAverageDepth NOTIFY showAverageDepthChanged)
Q_PROPERTY(bool show_pictures_in_profile READ showPicturesInProfile WRITE setShowPicturesInProfile NOTIFY showPicturesInProfileChanged)
@@ -163,7 +162,6 @@ public:
bool showCCRSensors() const;
bool zoomedPlot() const;
bool showSac() const;
- bool gfLowAtMaxDepth() const;
bool displayUnusedTanks() const;
bool showAverageDepth() const;
bool showPicturesInProfile() const;
@@ -191,7 +189,6 @@ public slots:
void setShowCCRSensors(bool value);
void setZoomedPlot(bool value);
void setShowSac(bool value);
- void setGfLowAtMaxDepth(bool value);
void setDisplayUnusedTanks(bool value);
void setShowAverageDepth(bool value);
void setShowPicturesInProfile(bool value);