[PATCH] Set minpressure from manually added cylinders

Miika Turkia miika.turkia at gmail.com
Mon Apr 28 12:47:56 PDT 2014


This includes minimum pressure from manually added cylinders to be taken
into account on scaling. Without this, manually added cylinders might
lead to pressure dropping below the Y axis 0 line (e.g. when first
"computerized" cylinder is 220->140 and second, manually added cylinder,
200->50 bar).

Signed-off-by: Miika Turkia <miika.turkia at gmail.com>
---
 profile.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/profile.c b/profile.c
index f5d287b..373ac8e 100644
--- a/profile.c
+++ b/profile.c
@@ -686,6 +686,8 @@ struct plot_info calculate_max_limits_new(struct dive *dive, struct divecomputer
 		unsigned int mbar = dive->cylinder[cyl].start.mbar;
 		if (mbar > maxpressure)
 			maxpressure = mbar;
+		if (mbar < minpressure)
+			minpressure = mbar;
 	}
 
 	/* Then do all the samples from all the dive computers */
-- 
1.8.3.2



More information about the subsurface mailing list