diff options
author | Rodrigo Severo <rodrigo@fabricadeideias.com> | 2013-12-31 20:32:16 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-01-08 20:35:07 +0800 |
commit | 8f0c8be245b405251a6023591d915c702ea9d034 (patch) | |
tree | ccd5fb28d38f92926e2d8cf2bed99efa0a5975fd /profile.h | |
parent | cc33ff2fe212da4f20bb30060ee9996b3c357adc (diff) | |
download | subsurface-8f0c8be245b405251a6023591d915c702ea9d034.tar.gz |
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>
Diffstat (limited to 'profile.h')
-rw-r--r-- | profile.h | 1 |
1 files changed, 1 insertions, 0 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); |