mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 23:03:23 +00:00
Scale partial pressure graphs according to enabled gases
The max Y value of the partial pressure graph grid tends to be way too high when only pO2 or pHe is enabled. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
693ee686df
commit
53dbccb87a
1 changed files with 4 additions and 9 deletions
13
profile.c
13
profile.c
|
@ -247,12 +247,7 @@ static int get_maxdepth(struct plot_info *pi)
|
||||||
/* Minimum 30m, rounded up to 10m, with at least 3m to spare */
|
/* Minimum 30m, rounded up to 10m, with at least 3m to spare */
|
||||||
md = MAX(30000, ROUND_UP(mm+3000, 10000));
|
md = MAX(30000, ROUND_UP(mm+3000, 10000));
|
||||||
}
|
}
|
||||||
if (PP_GRAPHS_ENABLED) {
|
md += pi->maxpp * 9000;
|
||||||
if (md <= 20000)
|
|
||||||
md += 10000;
|
|
||||||
else
|
|
||||||
md += ROUND_UP(md / 2, 10000);
|
|
||||||
}
|
|
||||||
return md;
|
return md;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1845,11 +1840,11 @@ static void calculate_deco_information(struct dive *dive, struct divecomputer *d
|
||||||
entry->phe = fhe / 1000.0 * amb_pressure;
|
entry->phe = fhe / 1000.0 * amb_pressure;
|
||||||
entry->pn2 = (1000 - fo2 - fhe) / 1000.0 * amb_pressure;
|
entry->pn2 = (1000 - fo2 - fhe) / 1000.0 * amb_pressure;
|
||||||
}
|
}
|
||||||
if (entry->po2 > pi->maxpp)
|
if (entry->po2 > pi->maxpp && prefs.pp_graphs.po2)
|
||||||
pi->maxpp = entry->po2;
|
pi->maxpp = entry->po2;
|
||||||
if (entry->phe > pi->maxpp)
|
if (entry->phe > pi->maxpp && prefs.pp_graphs.phe)
|
||||||
pi->maxpp = entry->phe;
|
pi->maxpp = entry->phe;
|
||||||
if (entry->pn2 > pi->maxpp)
|
if (entry->pn2 > pi->maxpp && prefs.pp_graphs.pn2)
|
||||||
pi->maxpp = entry->pn2;
|
pi->maxpp = entry->pn2;
|
||||||
|
|
||||||
/* and now let's try to do some deco calculations */
|
/* and now let's try to do some deco calculations */
|
||||||
|
|
Loading…
Add table
Reference in a new issue