mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Discontinuity and stall on tank pressure interpolated lines
Interpolated lines for tank pressures were presenting discontinuities (sudden drops) and stalls (horizontal lines) with certain dive profiles. The main reason seems to be that the discrete interpolation of tank pressure was adding small pressure increments that could be rounded down or up repeatedly generating cumulative rounding errors that would mean either a delay on pressure drop that would be drawn as a sudden drop or as a premature pressure drop that would result in a flat line. This patch changes the way the discrete interpolation is done, so that we don't have cumulative rounding errors distorting tank pressure lines. To calculate accumulated pressure_time values the get_pr_interpolate_data function was created. The fact that get_pr_interpolate_data transverses the beginning of the plot_info entry list for each entry that needs interpolated tank pressure isn't optimal at all. There might be a way to properly track the data necessary to interpolate tank pressures from inside the main pi->entry loop in fill_missing_tank_pressures. Unfortunately I didn't manage to do it inside fill_missing_tank_pressures so we have get_pr_interpolate_data. The SURFACE_THRESHOLD test from pressure_time function was also removed as no matter how shallow the diver is, if he is using the cylinder to breathe the cylinders tank pressure should be affected. Signed-off-by: Rodrigo Severo <rodrigo@fabricadeideias.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
cc33ff2fe2
commit
8f0c8be245
2 changed files with 78 additions and 13 deletions
|
@ -41,6 +41,7 @@ struct plot_data {
|
|||
int tts_calc;
|
||||
int stoptime_calc;
|
||||
int stopdepth_calc;
|
||||
int pressure_time;
|
||||
};
|
||||
|
||||
void calculate_max_limits(struct dive *dive, struct divecomputer *dc, struct graphics_context *gc);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue