summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2011-09-29 17:45:26 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2011-09-29 17:45:26 -0700
commitcbcfcddfb167ac242b27d253b9d8f36e78255865 (patch)
tree44bee49217e361c66e1bb12d00679cce6c67fc92 /dive.c
parent56a24917cb707493699488e197924a13e250afcf (diff)
downloadsubsurface-cbcfcddfb167ac242b27d253b9d8f36e78255865.tar.gz
Yes Linus, gas pressure can indeed go up during a dive
At first glance it seems logical to make the ending pressure be the lowest pressure observed during a dive. But if you do valve shut down drills with a tech setup (where you have a fully redundant double tank setup with two valves, two regulators and a manifold in between), then you continue to breath from what is indeed the same "tank", but still the valve on which your air pressure transmitter sits does get shut down and de-pressurized. So your pressure goes down by quite a bit, and then comes back up when the valve is turned back on. And the ending pressure of the dive (which is used for things like the SAC calculation) is indeed potentially higher than the lowest pressure observed during a dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/dive.c b/dive.c
index d934d1438..9af6449e2 100644
--- a/dive.c
+++ b/dive.c
@@ -154,8 +154,12 @@ static void fixup_pressure(struct dive *dive, struct sample *sample)
cyl = dive->cylinder + index;
if (!cyl->start.mbar)
cyl->start.mbar = pressure;
- if (!cyl->end.mbar || pressure < cyl->end.mbar)
- cyl->end.mbar = pressure;
+ /* we need to handle the user entering beginning and end tank pressures
+ * - maybe even IF we have samples. But for now if we have air pressure
+ * data in the samples, we use that instead of the minimum
+ * if (!cyl->end.mbar || pressure < cyl->end.mbar)
+ */
+ cyl->end.mbar = pressure;
}
struct dive *fixup_dive(struct dive *dive)