diff options
author | Robert C. Helling <helling@atdotde.de> | 2017-08-20 13:06:06 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-08-29 06:49:44 -0700 |
commit | 58d79488714ff7773916f3efe0970c424c8bd1cd (patch) | |
tree | e409c6e8031241760392b1030bb9e0658cdc4a21 /core | |
parent | c465ec586c04b524c22e30965441698f91b54656 (diff) | |
download | subsurface-58d79488714ff7773916f3efe0970c424c8bd1cd.tar.gz |
Change color to red if minimum gas is violated.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'core')
-rw-r--r-- | core/plannernotes.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/plannernotes.c b/core/plannernotes.c index be23a226d..83c868186 100644 --- a/core/plannernotes.c +++ b/core/plannernotes.c @@ -411,8 +411,12 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d 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 */ + bool minok = (mingasv.mliter <= + cyl->deco_gas_used.mliter + + lrint((double)cyl->end.mbar * cyl->type.size.mliter / 1000.0 / gas_compressibility_factor(&cyl->gasmix, cyl->end.mbar / 1000.0))); if (cyl->start.mbar > lastbottomdp->minimum_gas.mbar) snprintf(mingas, sizeof(mingas), - translate("gettextFromC", "<br> — <span style='color: green;'>Minimum gas</span> (based on %.1fxSAC/+%dmin@%.0f%s): %.0f%s/%.0f%s"), + translate("gettextFromC", "<br> — <span style='color: %s;'>Minimum gas</span> (based on %.1fxSAC/+%dmin@%.0f%s): %.0f%s/%.0f%s"), + minok ? "green" :"red", prefs.sacfactor / 100.0, prefs.problemsolvingtime, mingas_depth, depth_unit, mingas_volume, unit, |