From e919a0f2eac8bc4471b499b73a77c95e81240fd9 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 20 Oct 2011 22:25:38 +0300 Subject: [PATCH] Add quick hack for "no sample pressure but tank index changed" case This isn't right if you switch back to the same cylinder multiple times, but for the first time it kind of works - just take the beginning cylinder pressure if we have one. Signed-off-by: Linus Torvalds --- profile.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/profile.c b/profile.c index e5c7238..60b9ab9 100644 --- a/profile.c +++ b/profile.c @@ -719,6 +719,8 @@ static struct plot_info *create_plot_info(struct dive *dive) entry->same_cylinder = sample->cylinderindex == cylinderindex; cylinderindex = sample->cylinderindex; entry->pressure = sample->cylinderpressure.mbar; + if (!entry->same_cylinder && !entry->pressure) + entry->pressure = dive->cylinder[cylinderindex].start.mbar; entry->temperature = sample->temperature.mkelvin; if (depth || lastdepth) -- 2.43.0