mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix ATM-vs-bar confusion
SAC should be calculated in relationship to surface pressure, not "1 bar". I also realize that we have a few other cases where we do the same mistake: the partial pressure calculations do things like po2 = o2 / 1000.0 * depth_to_mbar(sample->depth.mm, dive); which is wrong as well - the partial pressure is also relative to standard atmospheric pressures. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
92bbed3304
commit
e58f54cac1
4 changed files with 16 additions and 6 deletions
|
@ -475,7 +475,7 @@ void MainTab::updateDiveInfo(int dive)
|
|||
volume_t sac;
|
||||
QString SACs;
|
||||
if (mean[0] && duration[0]) {
|
||||
sac.mliter = gases[0].mliter * 1000.0 / (depth_to_mbar(mean[0], d) * duration[0] / 60.0);
|
||||
sac.mliter = gases[0].mliter / (depth_to_atm(mean[0], d) * duration[0] / 60.0);
|
||||
SACs = get_volume_string(sac, true).append(tr("/min"));
|
||||
} else {
|
||||
SACs = QString(tr("unknown"));
|
||||
|
@ -483,7 +483,7 @@ void MainTab::updateDiveInfo(int dive)
|
|||
for(int i=1; i < MAX_CYLINDERS && gases[i].mliter != 0; i++) {
|
||||
volumes.append("\n" + get_volume_string(gases[i], true));
|
||||
if (duration[i]) {
|
||||
sac.mliter = gases[i].mliter * 1000.0 / (depth_to_mbar(mean[i], d) * duration[i] / 60);
|
||||
sac.mliter = gases[i].mliter / (depth_to_atm(mean[i], d) * duration[i] / 60);
|
||||
SACs.append("\n" + get_volume_string(sac, true).append(tr("/min")));
|
||||
} else {
|
||||
SACs.append("\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue