mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Improvement: Show gases as diluent by default for CCR dives.
Instead of adding all gases read from a dive computer as part of a dive log as 'OC-gas', add gases as 'diluent' if the dive has a dive mode of 'CCR'. This creates consistency with the ppO2 for CCR dives being tracked as sensor readings or a fixed setpoint, and not as the ppO2 of the current gas ad depth. A follow up question from this is whether gas use in the cylinders list on the Equipment tab should be user editable. This seems to be inconsistent at the moment, with gas constituent percentages downloaded from the dive computer being editable, but gas use not. Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
parent
ada32f999e
commit
321c8d92dc
2 changed files with 9 additions and 3 deletions
|
@ -1,3 +1,4 @@
|
|||
equipment: Use 'diluent' as default gas use type if the dive mode is 'CCR'
|
||||
htmlexport: fix search in HTML export
|
||||
statistics: fix value axis for degenerate value ranges
|
||||
profile: Show correct gas density when in CCR mode
|
||||
|
|
|
@ -150,6 +150,11 @@ static int parse_gasmixes(device_data_t *devdata, struct dive *dive, dc_parser_t
|
|||
cyl.gasmix.he.permille = he;
|
||||
}
|
||||
|
||||
if (dive->dc.divemode == CCR)
|
||||
cyl.cylinder_use = DILUENT;
|
||||
else
|
||||
cyl.cylinder_use = OC_GAS;
|
||||
|
||||
if (i < ntanks) {
|
||||
dc_tank_t tank = { 0 };
|
||||
rc = dc_parser_get_field(parser, DC_FIELD_TANK, i, &tank);
|
||||
|
@ -157,11 +162,11 @@ static int parse_gasmixes(device_data_t *devdata, struct dive *dive, dc_parser_t
|
|||
cyl.type.size.mliter = lrint(tank.volume * 1000);
|
||||
cyl.type.workingpressure.mbar = lrint(tank.workpressure * 1000);
|
||||
|
||||
cyl.cylinder_use = OC_GAS;
|
||||
if (tank.type & DC_TANKINFO_CC_O2)
|
||||
cyl.cylinder_use = OXYGEN;
|
||||
// libdivecomputer treats these as independent, but a tank cannot be used for diluent and O2 at the same time
|
||||
if (tank.type & DC_TANKINFO_CC_DILUENT)
|
||||
cyl.cylinder_use = DILUENT;
|
||||
else if (tank.type & DC_TANKINFO_CC_O2)
|
||||
cyl.cylinder_use = OXYGEN;
|
||||
|
||||
if (tank.type & DC_TANKINFO_IMPERIAL) {
|
||||
if (same_string(devdata->model, "Suunto EON Steel")) {
|
||||
|
|
Loading…
Reference in a new issue