summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-05 09:12:54 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-05 09:12:54 -0700
commit5f79a804b925a8ffbcf933bb6fae4f764b518c8e (patch)
tree43e5d9dd7c7434966038789c0b2d0e28a7650e30 /profile.c
parent0f832f15d1a5c4a9877fa4d568daa6e87241ca97 (diff)
downloadsubsurface-5f79a804b925a8ffbcf933bb6fae4f764b518c8e.tar.gz
Sanitize and fix cylinder pressure overview
Doing per-dive cylinder start/end pressures is insane, when we can have up to eight cylinders. The cylinder start/end pressure cannot be per dive, it needs to be per cylinder. This makes the save format cleaner too, we have all the cylinder data in just one place. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/profile.c b/profile.c
index 070e6fa70..5c30fbb5e 100644
--- a/profile.c
+++ b/profile.c
@@ -106,6 +106,9 @@ static int get_cylinder_pressure_range(struct dive *dive, double *scalex, double
struct sample *sample = dive->sample + i;
double bar;
+ /* FIXME! We only track cylinder 0 right now */
+ if (sample->cylinderindex)
+ continue;
if (!sample->cylinderpressure.mbar)
continue;
bar = sample->cylinderpressure.mbar;
@@ -131,7 +134,7 @@ static void plot_cylinder_pressure(struct dive *dive, cairo_t *cr,
cairo_set_source_rgba(cr, 0.2, 1.0, 0.2, 0.80);
- cairo_move_to(cr, SCALE(0, dive->beginning_pressure.mbar));
+ cairo_move_to(cr, SCALE(0, dive->cylinder[0].start.mbar));
for (i = 1; i < dive->samples; i++) {
int sec, mbar;
struct sample *sample = dive->sample + i;
@@ -142,7 +145,7 @@ static void plot_cylinder_pressure(struct dive *dive, cairo_t *cr,
continue;
cairo_line_to(cr, SCALE(sec, mbar));
}
- cairo_line_to(cr, SCALE(dive->duration.seconds, dive->end_pressure.mbar));
+ cairo_line_to(cr, SCALE(dive->duration.seconds, dive->cylinder[0].end.mbar));
cairo_stroke(cr);
}