mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Remove the .used member of the cylinder structure
Instead calculate this information on the fly, taking into account all dive computers on the dive in questions. There is one wrinkle to this - previously we abused the '.used' member to make sure that a manually added cylinder didn't disappear the moment it was added (think of the workflow: you add a cylinder, then you add a gas change to that cylinder -> right after you add it it is unused and would not be shown). I am thinking that we might have to add the "manually_added" property to the properties that we store in XML / git. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
1a04013453
commit
c539c8f861
6 changed files with 39 additions and 38 deletions
4
dive.h
4
dive.h
|
|
@ -59,7 +59,7 @@ typedef struct
|
|||
struct gasmix gasmix;
|
||||
pressure_t start, end, sample_start, sample_end;
|
||||
depth_t depth;
|
||||
bool used;
|
||||
bool manually_added;
|
||||
volume_t gas_used;
|
||||
} cylinder_t;
|
||||
|
||||
|
|
@ -565,7 +565,7 @@ extern void renumber_dives(int start_nr, bool selected_only);
|
|||
extern void copy_events(struct dive *s, struct dive *d);
|
||||
extern void copy_cylinders(struct dive *s, struct dive *d);
|
||||
extern void copy_samples(struct dive *s, struct dive *d);
|
||||
|
||||
extern bool cylinder_is_used(struct dive *d, cylinder_t *cyl);
|
||||
extern void fill_default_cylinder(cylinder_t *cyl);
|
||||
extern void add_gas_switch_event(struct dive *dive, struct divecomputer *dc, int time, int idx);
|
||||
extern void add_event(struct divecomputer *dc, int time, int type, int flags, int value, const char *name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue