summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-22 13:29:17 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-22 14:51:41 -0700
commit76903849de8da124d737a8ecd615cec259504a4e (patch)
treee83cfeb04c002438dc6592b40e702e39de4613bc /dive.h
parent63b6f7d5a25967f003a734d2058a73b4b13e8387 (diff)
downloadsubsurface-76903849de8da124d737a8ecd615cec259504a4e.tar.gz
Get the math right for cylinder model setData function
This is a fun one. We only want to mark the divelist changed if the user actually changed something. So we try really hard to compare what was entered with what was there and only if it is different do we overwrite existing values and record this as a change to the divelist. An additional challenge here is the fact that the user needs to enter a working pressure before they can enter a size (when in cuft mode). That is not really intuitive. We work around this by assuming working pressure is 3000psi if a size is given in cuft - but then if the user changes the working pressure, that changes the volume. Now going back and changing the volume again does the trick. Or enter the working pressure FIRST and then the volume... This also changes the incorrect MAXPRESSURE to WORKINGPRESSURE and uses the text WorkPress in English (Gtk code used MaxPress which was simply wrong - this is just the design pressure or working pressure, not some hard maximum. In fact, people quite commonly "overfill" these tanks. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/dive.h b/dive.h
index 968804581..a1febdd16 100644
--- a/dive.h
+++ b/dive.h
@@ -221,7 +221,7 @@ static inline double psi_to_bar(double psi)
return psi / 14.5037738;
}
-static inline unsigned long psi_to_mbar(double psi)
+static inline long psi_to_mbar(double psi)
{
return psi_to_bar(psi)*1000 + 0.5;
}
@@ -238,6 +238,7 @@ static inline double bar_to_atm(double bar)
/* Volume in mliter of a cylinder at pressure 'p' */
extern int gas_volume(cylinder_t *cyl, pressure_t p);
+extern int wet_volume(double cuft, pressure_t p);
static inline int mbar_to_PSI(int mbar)
{