mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
planner: pass in_planner argument to decoMode()
To remove reliance on global state, pass an "in_planner" argument to decoMode(). Thus, calls to in_planner() can be removed. This is a more-or-less automated change. Ultimately it would probably be better to pass the current deco-mode to the affected functions instead of calling decoMode() with an in_planner parameter. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
03a7e65cf0
commit
642d9c80b3
12 changed files with 51 additions and 51 deletions
|
@ -86,8 +86,8 @@ const char *get_planner_disclaimer()
|
|||
char *get_planner_disclaimer_formatted()
|
||||
{
|
||||
struct membuffer buf = { 0 };
|
||||
const char *deco = decoMode() == VPMB ? translate("gettextFromC", "VPM-B")
|
||||
: translate("gettextFromC", "BUHLMANN");
|
||||
const char *deco = decoMode(true) == VPMB ? translate("gettextFromC", "VPM-B")
|
||||
: translate("gettextFromC", "BUHLMANN");
|
||||
put_format(&buf, get_planner_disclaimer(), deco);
|
||||
return detach_cstring(&buf);
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d
|
|||
}
|
||||
put_string(&buf, "<br/>\n");
|
||||
|
||||
if (prefs.display_variations && decoMode() != RECREATIONAL)
|
||||
if (prefs.display_variations && decoMode(true) != RECREATIONAL)
|
||||
put_format_loc(&buf, translate("gettextFromC", "Runtime: %dmin%s"),
|
||||
diveplan_duration(diveplan), "VARIATIONS");
|
||||
else
|
||||
|
@ -420,16 +420,16 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d
|
|||
|
||||
/* Print the settings for the diveplan next. */
|
||||
put_string(&buf, "<div>\n");
|
||||
if (decoMode() == BUEHLMANN) {
|
||||
if (decoMode(true) == BUEHLMANN) {
|
||||
put_format_loc(&buf, translate("gettextFromC", "Deco model: Bühlmann ZHL-16C with GFLow = %d%% and GFHigh = %d%%"), diveplan->gflow, diveplan->gfhigh);
|
||||
} else if (decoMode() == VPMB){
|
||||
} else if (decoMode(true) == VPMB) {
|
||||
if (diveplan->vpmb_conservatism == 0)
|
||||
put_string(&buf, translate("gettextFromC", "Deco model: VPM-B at nominal conservatism"));
|
||||
else
|
||||
put_format_loc(&buf, translate("gettextFromC", "Deco model: VPM-B at +%d conservatism"), diveplan->vpmb_conservatism);
|
||||
if (diveplan->eff_gflow)
|
||||
put_format_loc(&buf, translate("gettextFromC", ", effective GF=%d/%d"), diveplan->eff_gflow, diveplan->eff_gfhigh);
|
||||
} else if (decoMode() == RECREATIONAL){
|
||||
} else if (decoMode(true) == RECREATIONAL) {
|
||||
put_format_loc(&buf, translate("gettextFromC", "Deco model: Recreational mode based on Bühlmann ZHL-16B with GFLow = %d%% and GFHigh = %d%%"),
|
||||
diveplan->gflow, diveplan->gfhigh);
|
||||
}
|
||||
|
@ -496,7 +496,7 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d
|
|||
/* not for recreational mode and if no other warning was set before. */
|
||||
else
|
||||
if (lastbottomdp && gasidx == lastbottomdp->cylinderid
|
||||
&& dive->dc.divemode == OC && decoMode() != RECREATIONAL) {
|
||||
&& dive->dc.divemode == OC && decoMode(true) != RECREATIONAL) {
|
||||
/* Calculate minimum gas volume. */
|
||||
volume_t mingasv;
|
||||
mingasv.mliter = lrint(prefs.sacfactor / 100.0 * prefs.problemsolvingtime * prefs.bottomsac
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue