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
|
@ -200,19 +200,20 @@ void fake_dc(struct divecomputer *dc)
|
|||
}
|
||||
|
||||
divemode_loop::divemode_loop(const struct divecomputer &dc) :
|
||||
last(dc.divemode), loop("modechange", dc)
|
||||
last(dc.divemode), last_time(0), loop("modechange", dc)
|
||||
{
|
||||
/* on first invocation, get first event (if any) */
|
||||
ev = loop.next();
|
||||
}
|
||||
|
||||
divemode_t divemode_loop::at(int time)
|
||||
std::pair<divemode_t, int> divemode_loop::at(int time)
|
||||
{
|
||||
while (ev && ev->time.seconds <= time) {
|
||||
last = static_cast<divemode_t>(ev->value);
|
||||
last_time = ev->time.seconds;
|
||||
ev = loop.next();
|
||||
}
|
||||
return last;
|
||||
return std::make_pair(last, last_time);
|
||||
}
|
||||
|
||||
/* helper function to make it easier to work with our structures
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue