summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/dive.h1
-rw-r--r--core/planner.c8
2 files changed, 5 insertions, 4 deletions
diff --git a/core/dive.h b/core/dive.h
index b8096d50c..bc029dbcd 100644
--- a/core/dive.h
+++ b/core/dive.h
@@ -847,6 +847,7 @@ struct divedatapoint {
int time;
depth_t depth;
int cylinderid;
+ pressure_t minimum_gas;
int setpoint;
bool entered;
struct divedatapoint *next;
diff --git a/core/planner.c b/core/planner.c
index aa77f11e8..b8a8b63b5 100644
--- a/core/planner.c
+++ b/core/planner.c
@@ -384,6 +384,7 @@ struct divedatapoint *create_dp(int time_incr, int depth, int cylinderid, int po
dp->time = time_incr;
dp->depth.mm = depth;
dp->cylinderid = cylinderid;
+ dp->minimum_gas.mbar = 0;
dp->setpoint = po2;
dp->entered = false;
dp->next = NULL;
@@ -903,15 +904,14 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool
* depth_to_bar(lastbottomdp->depth.mm, dive)
+ prefs.sacfactor / 100.0 * cyl->deco_gas_used.mliter);
/* Calculate minimum gas pressure for cyclinder. */
- pressure_t mingasp;
- mingasp.mbar = lrint(isothermal_pressure(&cyl->gasmix, 1.0,
+ lastbottomdp->minimum_gas.mbar = lrint(isothermal_pressure(&cyl->gasmix, 1.0,
mingasv.mliter, cyl->type.size.mliter) * 1000);
/* Translate all results into correct units */
mingas_volume = get_volume_units(mingasv.mliter, NULL, &unit);
- mingas_pressure = get_pressure_units(mingasp.mbar, &pressure_unit);
+ mingas_pressure = get_pressure_units(lastbottomdp->minimum_gas.mbar, &pressure_unit);
mingas_depth = get_depth_units(lastbottomdp->depth.mm, NULL, &depth_unit);
/* Print it to results */
- if (cyl->start.mbar > mingasp.mbar) snprintf(mingas, sizeof(mingas),
+ if (cyl->start.mbar > lastbottomdp->minimum_gas.mbar) snprintf(mingas, sizeof(mingas),
translate("gettextFromC", "<br>&nbsp;&mdash; <span style='color: green;'>Minimum gas</span> (based on %.1fxSAC/+%dmin@%.0f%s): %.0f%s/%.0f%s"),
prefs.sacfactor / 100.0, prefs.problemsolvingtime,
mingas_depth, depth_unit,