X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=profile.c;h=032bbd2c5acc86b196799048e46798b741eab99f;hb=11becb87505b8cdf6fbf2f10941f87d394e49f80;hp=070e6fa7054445e26031335c4c1b5e1ac35ccbff;hpb=6138d151e9156bdf15843b1b54104428c5124e38;p=ext%2Fsubsurface.git diff --git a/profile.c b/profile.c index 070e6fa..032bbd2 100644 --- a/profile.c +++ b/profile.c @@ -4,6 +4,7 @@ #include "dive.h" #include "display.h" +#include "divelist.h" int selected_dive = 0; @@ -106,6 +107,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 +135,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 +146,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); }