diff options
author | Rodrigo Severo <rodrigo@fabricadeideias.com> | 2014-01-08 12:51:35 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-01-09 07:08:57 +0800 |
commit | c32c28d40b627fa08051697f44a829c7f19854d0 (patch) | |
tree | 0222bb4dc1db9e6f81c809906890872d6a18183f | |
parent | f12f9ae8c3b3ed8631254c65572eb76462ec0de9 (diff) | |
download | subsurface-c32c28d40b627fa08051697f44a829c7f19854d0.tar.gz |
Interpolated pressure should always be set
Interpolated pressure should always be set, even it we didn't
calculate a new one. In this case we should just use the last one.
Signed-off-by:Rodrigo Severo <rodrigo@fabricadeideias.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | profile.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -620,15 +620,15 @@ static void fill_missing_tank_pressures(struct dive *dive, struct plot_info *pi, #ifdef DEBUG_PR_INTERPOLATE dump_pr_interpolate(i, interpolate); #endif - /* if this segment had pressure time, set the interpolated pressure */ + /* if this segment has pressure time, calculate a new interpolated pressure */ if (interpolate.pressure_time) { /* Overall pressure change over total pressure-time for this segment*/ magic = (interpolate.end - interpolate.start) / (double) interpolate.pressure_time; /* Use that overall pressure change to update the current pressure */ cur_pr[cyl] = interpolate.start + magic * interpolate.acc_pressure_time + 0.5; - INTERPOLATED_PRESSURE(entry) = cur_pr[cyl]; } + INTERPOLATED_PRESSURE(entry) = cur_pr[cyl]; } } |