]> git.tdb.fi Git - ext/subsurface.git/commitdiff
This should fix the missing end pressure for broken dive computers
authorDirk Hohndel <dirk@hohndel.org>
Thu, 10 Nov 2011 01:15:48 +0000 (20:15 -0500)
committerDirk Hohndel <dirk@hohndel.org>
Thu, 10 Nov 2011 01:15:48 +0000 (20:15 -0500)
Some dive computers randomly drop samples. That was no problem unless it
was the LAST sample. We work around that now

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
profile.c

index d2ebf4a097b94bb6964c2a453bb74b12949aec6c..f0ae0c9311c5eba3c3bc24130c01d8b02c36eb59 100644 (file)
--- a/profile.c
+++ b/profile.c
@@ -698,7 +698,8 @@ static void plot_cylinder_pressure_text(struct graphics_context *gc, struct plot
                }
        }
        cyl = entry->cylinderindex;
-       last_pressure[cyl] = GET_PRESSURE(entry);
+       if (GET_PRESSURE(entry))
+               last_pressure[cyl] = GET_PRESSURE(entry);
        last_time[cyl] = entry->sec;
 
        for (cyl = 0; cyl < MAX_CYLINDERS; cyl++) {
@@ -934,6 +935,7 @@ static void fill_missing_tank_pressures(struct dive *dive, struct plot_info *pi,
                                if (!nlist) {
                                        /* just continue without calculating
                                         * interpolated values */
+                                       INTERPOLATED_PRESSURE(entry) = cur_pr[entry->cylinderindex];
                                        list = NULL;
                                        continue;
                                }