mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Profile: Improve Display of Bailout / Loop Events.
For dives in CCR mode, show 'bailout' and 'on loop' events whenever a gas switch from a diluent gas to a bailout gas and vice versa happens. Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
parent
de12d3a6ea
commit
07898f277c
16 changed files with 183 additions and 121 deletions
|
@ -150,7 +150,8 @@ void DivePlannerPointsModel::loadFromDive(dive *dIn, int dcNrIn)
|
|||
int j = 0;
|
||||
int cylinderid = 0;
|
||||
|
||||
divemode_loop loop(*dc);
|
||||
gasmix_loop loop_gas(*d, *dc);
|
||||
divemode_loop loop_mode(*dc);
|
||||
for (int i = 0; i < plansamples - 1; i++) {
|
||||
if (dc->last_manual_time.seconds && dc->last_manual_time.seconds > 120 && lasttime.seconds >= dc->last_manual_time.seconds)
|
||||
break;
|
||||
|
@ -172,7 +173,8 @@ void DivePlannerPointsModel::loadFromDive(dive *dIn, int dcNrIn)
|
|||
if (newtime.seconds - lastrecordedtime.seconds > 10 || cylinderid == get_cylinderid_at_time(d, dc, nexttime)) {
|
||||
if (newtime.seconds == lastrecordedtime.seconds)
|
||||
newtime.seconds += 10;
|
||||
divemode_t current_divemode = loop.at(newtime.seconds - 1);
|
||||
|
||||
[[maybe_unused]] auto [current_divemode, _cylinder_index, _gasmix] = get_dive_status_at(*d, *dc, newtime.seconds - 1, &loop_mode, &loop_gas);
|
||||
addStop(depthsum / samplecount, newtime.seconds, cylinderid, last_sp.mbar, true, current_divemode);
|
||||
lastrecordedtime = newtime;
|
||||
}
|
||||
|
@ -182,9 +184,9 @@ void DivePlannerPointsModel::loadFromDive(dive *dIn, int dcNrIn)
|
|||
}
|
||||
}
|
||||
// make sure we get the last point right so the duration is correct
|
||||
divemode_t current_divemode = loop.at(dc->duration.seconds);
|
||||
[[maybe_unused]] auto [current_divemode, _cylinder_index, _gasmix] = get_dive_status_at(*d, *dc, dc->duration.seconds, &loop_mode, &loop_gas);
|
||||
if (!hasMarkedSamples && !dc->last_manual_time.seconds)
|
||||
addStop(0_m, dc->duration.seconds,cylinderid, last_sp.mbar, true, current_divemode);
|
||||
addStop(0_m, dc->duration.seconds, cylinderid, last_sp.mbar, true, current_divemode);
|
||||
preserved_until = d->duration;
|
||||
|
||||
updateDiveProfile();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue