diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-28 11:25:42 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-07-28 21:50:23 -0700 |
commit | df1bd0015a2f69429116c29d6e7818a33a9070b0 (patch) | |
tree | 892769b3c77da70a32332dda9c5820515ce1533e /core/dive.h | |
parent | defa71256fe16de32f69e78657c807828b7488bd (diff) | |
download | subsurface-df1bd0015a2f69429116c29d6e7818a33a9070b0.tar.gz |
Calculate momentary SAC rates with the right gases
The momentary SAC rate got broken by the multiple ressure handling too,
and always used just the first cylinder.
This uses the new "get_gasmix()" helper to see what you're breathing,
and will do the SAC rate over all the cylinders that contain that gas.
So it should now DTRT even for sidemount diving (assuming you had the
same gas in the sidemount cylinders).
NOTE! We could just do the SAC rate over *all* the gases you have
pressures for, and maybe that's the right thing to do. The ones you are
not breating from shouldn't have their pressure change. But maybe some
people add their drysuit argon gas to the gas list?
So this may need more work, but it's a step in the right direction.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/dive.h')
-rw-r--r-- | core/dive.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/core/dive.h b/core/dive.h index d19ccca4d..350331d95 100644 --- a/core/dive.h +++ b/core/dive.h @@ -140,8 +140,7 @@ extern int gas_volume(cylinder_t *cyl, pressure_t p); extern double gas_compressibility_factor(struct gasmix *gas, double bar); extern double isothermal_pressure(struct gasmix *gas, double p1, int volume1, int volume2); extern double gas_density(struct gasmix *gas, int pressure); - - +extern int same_gasmix(struct gasmix *a, struct gasmix *b); static inline int get_o2(const struct gasmix *mix) { |