Mercurial > public > ostc4
comparison Discovery/Src/data_central.c @ 864:fa431d42b5fb
Fix incorrect logging of bailout to Open Circuit when using the best gas.
This happened because the starting gas used for 'best gas' calculation
was a diluent - in most cases not a problem as the same gas is also
used as a bailout gas. Now use the 'first' open circuit gas configured as the
starting point.
Also fixes the problem of a custom bailout gas not being logged as such,
and consequently not being shown as bailout in the on-device log.
author | heinrichsweikamp |
---|---|
date | Mon, 22 Jul 2024 16:38:36 +0200 |
parents | dd7ce655db26 |
children | e373e90a48db |
comparison
equal
deleted
inserted
replaced
822:dff26bf4b542 | 864:fa431d42b5fb |
---|---|
545 nitrogen = 100; | 545 nitrogen = 100; |
546 nitrogen -= oxygen; | 546 nitrogen -= oxygen; |
547 nitrogen -= helium; | 547 nitrogen -= helium; |
548 | 548 |
549 | 549 |
550 if((lifeData->actualGas.nitrogen_percentage != nitrogen) || (lifeData->actualGas.helium_percentage != helium) || (lifeData->actualGas.AppliedDiveMode != DIVEMODE_OC)) | 550 if ((lifeData->actualGas.nitrogen_percentage != nitrogen) || (lifeData->actualGas.helium_percentage != helium) || lifeData->actualGas.AppliedDiveMode != DIVEMODE_OC) |
551 { | 551 { |
552 stateUsedWrite->events.manualGasSet = 1; | 552 if (stateUsed->diveSettings.ccrOption) { |
553 stateUsedWrite->events.info_manualGasSetHe = helium; | 553 stateUsedWrite->events.bailout = 1; |
554 stateUsedWrite->events.info_manualGasSetO2 = oxygen; | 554 stateUsedWrite->events.info_bailoutHe = helium; |
555 stateUsedWrite->events.info_bailoutO2 = oxygen; | |
556 } else { | |
557 stateUsedWrite->events.manualGasSet = 1; | |
558 stateUsedWrite->events.info_manualGasSetHe = helium; | |
559 stateUsedWrite->events.info_manualGasSetO2 = oxygen; | |
560 } | |
555 } | 561 } |
562 | |
556 if( lifeData->actualGas.setPoint_cbar != setpoint_cbar) | 563 if( lifeData->actualGas.setPoint_cbar != setpoint_cbar) |
557 { | 564 { |
558 stateUsedWrite->events.setpointChange = 1; | 565 stateUsedWrite->events.setpointChange = 1; |
559 stateUsedWrite->events.info_SetpointChange = setpoint_cbar; | 566 stateUsedWrite->events.info_SetpointChange = setpoint_cbar; |
560 } | 567 } |