summaryrefslogtreecommitdiffstats
path: root/equipment.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-01 09:59:38 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-01 10:16:59 -0700
commit2a871d7fe5257adf5631cfb46f2dfa84cd2d9201 (patch)
tree2eaef80e7ab303bfb3a22fcebb40cb1abcb82906 /equipment.c
parentf44a7509b3455492393874fe8a35bb3b564fee86 (diff)
downloadsubsurface-2a871d7fe5257adf5631cfb46f2dfa84cd2d9201.tar.gz
Planner: track gas used even if we don't have a real cylinder
We tracked gas used by simulating a dive with a cylinder - but for that we need a cylinder size and working pressure. If the user just enters a gas but no cylinder data (likely in order to figure out how much gas is used so that she then can pick a big enough cylinder), we didn't show any gas consumption. It kinda sucks to add another member to the cylinder structure, but this seemed far more reasonable then some other, global structure that independently tracks gas usage. This just seemed to make sense. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'equipment.c')
-rw-r--r--equipment.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/equipment.c b/equipment.c
index 3111ed599..b69155629 100644
--- a/equipment.c
+++ b/equipment.c
@@ -56,7 +56,8 @@ bool cylinder_nodata(cylinder_t *cyl)
!cyl->gasmix.o2.permille &&
!cyl->gasmix.he.permille &&
!cyl->start.mbar &&
- !cyl->end.mbar;
+ !cyl->end.mbar &&
+ !cyl->gas_used.mliter;
}
static bool cylinder_nosamples(cylinder_t *cyl)
@@ -197,5 +198,6 @@ void reset_cylinders(struct dive *dive)
cyl->depth = gas_mod(&cyl->gasmix, pO2);
if (cyl->type.workingpressure.mbar)
cyl->start.mbar = cyl->end.mbar = cyl->type.workingpressure.mbar;
+ cyl->gas_used.mliter = 0;
}
}