mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Refactoring: Improve event_loop
.
Improve the event loop architecture by making it set the divecomputer in the constructor - using the same loop for multiple dive computers is not intended to work. Also change `next()` in `divemode_loop` to `at()` to make the name more aligned with its function. Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
parent
33bb39f1ca
commit
ee25e8a1db
11 changed files with 28 additions and 33 deletions
|
@ -433,7 +433,7 @@ static void add_dive_to_deco(struct deco_state *ds, const struct dive &dive, boo
|
|||
int depth = interpolate(psample.depth.mm, sample.depth.mm, j - t0, t1 - t0);
|
||||
auto gasmix = loop.at(j).first;
|
||||
add_segment(ds, dive.depth_to_bar(depth), gasmix, 1, sample.setpoint.mbar,
|
||||
loop_d.next(j), dive.sac,
|
||||
loop_d.at(j), dive.sac,
|
||||
in_planner);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue