diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-01-06 18:20:12 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-01-06 22:17:13 -0800 |
commit | d85d8421e08583a8132cc3e0c5dd2b9415a8e091 (patch) | |
tree | 724590055934c4e750d787988bd050153bf1514c /save-xml.c | |
parent | 25209bfbb4c653c34ddd43f7067e6d0604779b07 (diff) | |
download | subsurface-d85d8421e08583a8132cc3e0c5dd2b9415a8e091.tar.gz |
Split up helper functions for interpolating gas pressure
This splits up the function to create the estimated pressures for
missing tank pressure information.
The code now has a separate pass to create the beginning and ending
pressures for segments that lack them, and fill them in to match the
overall SAC-rate for that cylinder.
In the process, it also fixes the calculation of the interpolated gas
pressure: you can see this in test-dive 13, where we switch back to the
first tank at the end of the dive. It used to be that the latter
segment of that cylinder showed in a different color from the first
segment, showing that we had a different SAC-rate. But that makes no
sense, since our interpolation is supposed to use a constant SAC-rate
for each cylinder.
The bug was that the "magic" calculation (which is just the pressure
change rate over pressure-time) was incorrect, and used the current
cylinder pressure for start-pressure calculation. But that's wrong,
since we update the current cylinder pressure as we go along, but we
didn't update the total pressure_time.
With the separate phase to calculate the segment beginning/ending
pressures, the code got simplified and the bug stood out more.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'save-xml.c')
0 files changed, 0 insertions, 0 deletions