comparison Discovery/Src/simulation.c @ 973:79b522fbabe6 Evo_2_23

Deactivate deco gas calculation option: In the previous version had the option to consider a deco gas i the calculation or not. Reason for this was to have the automatic gas suggestion available while the deco calculation is still based on the current gas. This might cause a critical situation in case the diver is not sure if the option is active or not => In the new version the TTS / deco is always calculated considering all deco gases.
author Ideenmodellierer
date Sun, 26 Jan 2025 19:31:38 +0100 (2 months ago)
parents d565812061f4
children f0622dd93fdf
comparison
equal deleted inserted replaced
972:12426391edd9 973:79b522fbabe6
500 gasChangeListDepthGas20x2[i] = 0; 500 gasChangeListDepthGas20x2[i] = 0;
501 501
502 SDiveState * pDiveState = &stateSim; 502 SDiveState * pDiveState = &stateSim;
503 copyDiveSettingsToSim(); 503 copyDiveSettingsToSim();
504 504
505 #ifdef ENABLE_DECOCALC_OPTION
505 /* activate deco calculation for all deco gases */ 506 /* activate deco calculation for all deco gases */
506 for(index = 0; index < 1 + (2*NUM_GASES); index++) 507 for(index = 0; index < 1 + (2*NUM_GASES); index++)
507 { 508 {
508 if(pDiveState->diveSettings.gas[index].note.ub.deco) 509 if(pDiveState->diveSettings.gas[index].note.ub.deco)
509 { 510 {
510 pDiveState->diveSettings.gas[index].note.ub.decocalc = 1; 511 pDiveState->diveSettings.gas[index].note.ub.decocalc = 1;
511 } 512 }
512 } 513 }
514 #endif
513 515
514 vpm_init(&pDiveState->vpm, pDiveState->diveSettings.vpm_conservatism, 0, 0); 516 vpm_init(&pDiveState->vpm, pDiveState->diveSettings.vpm_conservatism, 0, 0);
515 //buehlmann_init(); 517 //buehlmann_init();
516 //timer_init(); 518 //timer_init();
517 memset(&pDiveState->events,0, sizeof(SEvents)); 519 memset(&pDiveState->events,0, sizeof(SEvents));
564 566
565 // ascend (deco) gases 567 // ascend (deco) gases
566 for(int i=1; i<=5;i++) 568 for(int i=1; i<=5;i++)
567 { 569 {
568 if((pDiveState->diveSettings.decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0) 570 if((pDiveState->diveSettings.decogaslist[i].change_during_ascent_depth_meter_otherwise_zero == 0)
569 || (pDiveState->diveSettings.gas[pDiveState->diveSettings.decogaslist[i].GasIdInSettings].note.ub.decocalc == 0)) 571 #ifdef ENABLE_DECOCALC_OPTION
572 || (pDiveState->diveSettings.gas[pDiveState->diveSettings.decogaslist[i].GasIdInSettings].note.ub.decocalc == 0)
573 #endif
574 )
570 break; 575 break;
571 gasChangeListDepthGas20x2[ptrGasChangeList++] = pDiveState->diveSettings.decogaslist[i].change_during_ascent_depth_meter_otherwise_zero; 576 gasChangeListDepthGas20x2[ptrGasChangeList++] = pDiveState->diveSettings.decogaslist[i].change_during_ascent_depth_meter_otherwise_zero;
572 gasChangeListDepthGas20x2[ptrGasChangeList++] = pDiveState->diveSettings.decogaslist[i].GasIdInSettings; 577 gasChangeListDepthGas20x2[ptrGasChangeList++] = pDiveState->diveSettings.decogaslist[i].GasIdInSettings;
573 } 578 }
574 gasChangeListDepthGas20x2[0] = 0; 579 gasChangeListDepthGas20x2[0] = 0;