mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
f12f9ae8c3
commit
c32c28d40b
1 changed files with 2 additions and 2 deletions
|
@ -620,15 +620,15 @@ static void fill_missing_tank_pressures(struct dive *dive, struct plot_info *pi,
|
||||||
#ifdef DEBUG_PR_INTERPOLATE
|
#ifdef DEBUG_PR_INTERPOLATE
|
||||||
dump_pr_interpolate(i, interpolate);
|
dump_pr_interpolate(i, interpolate);
|
||||||
#endif
|
#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) {
|
if (interpolate.pressure_time) {
|
||||||
/* Overall pressure change over total pressure-time for this segment*/
|
/* Overall pressure change over total pressure-time for this segment*/
|
||||||
magic = (interpolate.end - interpolate.start) / (double) interpolate.pressure_time;
|
magic = (interpolate.end - interpolate.start) / (double) interpolate.pressure_time;
|
||||||
|
|
||||||
/* Use that overall pressure change to update the current pressure */
|
/* Use that overall pressure change to update the current pressure */
|
||||||
cur_pr[cyl] = interpolate.start + magic * interpolate.acc_pressure_time + 0.5;
|
cur_pr[cyl] = interpolate.start + magic * interpolate.acc_pressure_time + 0.5;
|
||||||
INTERPOLATED_PRESSURE(entry) = cur_pr[cyl];
|
|
||||||
}
|
}
|
||||||
|
INTERPOLATED_PRESSURE(entry) = cur_pr[cyl];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue