diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/equipment.c | 10 | ||||
-rw-r--r-- | core/equipment.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/core/equipment.c b/core/equipment.c index 3d169a338..c3b9fa494 100644 --- a/core/equipment.c +++ b/core/equipment.c @@ -392,6 +392,16 @@ cylinder_t *get_or_create_cylinder(struct dive *d, int idx) return &d->cylinders.cylinders[idx]; } +cylinder_t create_new_cylinder(const struct dive *d) +{ + cylinder_t cyl = empty_cylinder; + fill_default_cylinder(d, &cyl); + cyl.start = cyl.type.workingpressure; + cyl.manually_added = true; + cyl.cylinder_use = OC_GAS; + return cyl; +} + #ifdef DEBUG_CYL void dump_cylinders(struct dive *dive, bool verbose) { diff --git a/core/equipment.h b/core/equipment.h index 4ed809eff..289eb75a1 100644 --- a/core/equipment.h +++ b/core/equipment.h @@ -92,6 +92,7 @@ extern void set_weightsystem(struct dive *dive, int idx, weightsystem_t ws); extern void reset_cylinders(struct dive *dive, bool track_gas); extern int gas_volume(const cylinder_t *cyl, pressure_t p); /* Volume in mliter of a cylinder at pressure 'p' */ extern int find_best_gasmix_match(struct gasmix mix, const struct cylinder_table *cylinders); +extern cylinder_t create_new_cylinder(const struct dive *dive); /* dive is needed to fill out MOD, which depends on salinity. */ #ifdef DEBUG_CYL extern void dump_cylinders(struct dive *dive, bool verbose); #endif |