From 58d79488714ff7773916f3efe0970c424c8bd1cd Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Sun, 20 Aug 2017 13:06:06 +0200 Subject: Change color to red if minimum gas is violated. Signed-off-by: Robert C. Helling --- core/plannernotes.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'core') 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", "
 — Minimum gas (based on %.1fxSAC/+%dmin@%.0f%s): %.0f%s/%.0f%s"), + translate("gettextFromC", "
 — Minimum gas (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, -- cgit v1.2.3-70-g09d2