From df1bd0015a2f69429116c29d6e7818a33a9070b0 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 28 Jul 2017 11:25:42 -0700 Subject: 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 Signed-off-by: Dirk Hohndel --- core/dive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/dive.c') diff --git a/core/dive.c b/core/dive.c index d07a9d2aa..7f89e5063 100644 --- a/core/dive.c +++ b/core/dive.c @@ -2071,7 +2071,7 @@ static void cylinder_renumber(struct dive *dive, int mapping[]) dc_cylinder_renumber(dive, dc, mapping); } -static int same_gasmix(struct gasmix *a, struct gasmix *b) +int same_gasmix(struct gasmix *a, struct gasmix *b) { if (gasmix_is_air(a) && gasmix_is_air(b)) return 1; -- cgit v1.2.3-70-g09d2