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
|
@ -595,7 +595,7 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d
|
|||
std::string temp;
|
||||
struct gasmix gasmix = dive->get_cylinder(dp->cylinderid)->gasmix;
|
||||
|
||||
divemode_t current_divemode = loop.next(dp->time);
|
||||
divemode_t current_divemode = loop.at(dp->time);
|
||||
amb = dive->depth_to_atm(dp->depth.mm);
|
||||
gas_pressures pressures = fill_pressures(amb, gasmix, (current_divemode == OC) ? 0.0 : amb * gasmix.o2.permille / 1000.0, current_divemode);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue