comparison src/p2_deco.c @ 566:3febf1cd1bf4

Fix anomalie when toggling ppO2 warning levels in ccr and pscr mode.
author heinrichsweikamp
date Thu, 08 Feb 2018 10:18:15 +0100
parents b7eb98dbd800
children 4ce70e3f00be
comparison
equal deleted inserted replaced
565:0ba88db66492 566:3febf1cd1bf4
1376 if ( int_O_O2_ppO2 >= int_ppO2_max ) int_O_O2_ppO2 |= INT_FLAG_WARNING + INT_FLAG_HIGH; 1376 if ( int_O_O2_ppO2 >= int_ppO2_max ) int_O_O2_ppO2 |= INT_FLAG_WARNING + INT_FLAG_HIGH;
1377 1377
1378 // check for safe range of breathed gas 1378 // check for safe range of breathed gas
1379 if ( int_O_breathed_ppO2 <= int_ppO2_min ) int_O_breathed_ppO2 |= INT_FLAG_WARNING + INT_FLAG_LOW; 1379 if ( int_O_breathed_ppO2 <= int_ppO2_min ) int_O_breathed_ppO2 |= INT_FLAG_WARNING + INT_FLAG_LOW;
1380 else if ( int_O_breathed_ppO2 >= int_ppO2_max ) int_O_breathed_ppO2 |= INT_FLAG_WARNING + INT_FLAG_HIGH; 1380 else if ( int_O_breathed_ppO2 >= int_ppO2_max ) int_O_breathed_ppO2 |= INT_FLAG_WARNING + INT_FLAG_HIGH;
1381 else if ( char_O_main_status & DECO_MODE_LOOP ) ; // no attention generated in loop modes
1381 else if ( int_O_breathed_ppO2 >= ppO2_prewarn_threshold ) int_O_breathed_ppO2 |= INT_FLAG_PREWARNING; 1382 else if ( int_O_breathed_ppO2 >= ppO2_prewarn_threshold ) int_O_breathed_ppO2 |= INT_FLAG_PREWARNING;
1382 1383
1383 // check for safe range of pure diluent 1384 // check for safe range of pure diluent
1384 if ( int_O_pure_ppO2 <= (unsigned int)char_I_ppO2_min ) int_O_pure_ppO2 |= INT_FLAG_WARNING + INT_FLAG_LOW; 1385 if ( int_O_pure_ppO2 <= (unsigned int)char_I_ppO2_min ) int_O_pure_ppO2 |= INT_FLAG_WARNING + INT_FLAG_LOW;
1385 else if ( int_O_pure_ppO2 >= int_ppO2_max ) int_O_pure_ppO2 |= INT_FLAG_WARNING + INT_FLAG_HIGH; 1386 else if ( int_O_pure_ppO2 >= int_ppO2_max ) int_O_pure_ppO2 |= INT_FLAG_WARNING + INT_FLAG_HIGH;
2375 { 2376 {
2376 // leading tissue is in IBCD condition and in super-saturation, set flags. 2377 // leading tissue is in IBCD condition and in super-saturation, set flags.
2377 char_O_deco_warnings |= (DECO_WARNING_IBCD + DECO_WARNING_IBCD_lock); 2378 char_O_deco_warnings |= (DECO_WARNING_IBCD + DECO_WARNING_IBCD_lock);
2378 } 2379 }
2379 2380
2380 // check if is any tissue off-gassing 2381 // set deco flag if we are in deco and at least one of the real tissues is off-gassing
2381 if (deco_tissue_vector) char_O_deco_warnings |= DECO_FLAG; // yes, set deco flag 2382 // clear deco flag if all of the real tissues are on-gassing
2382 else char_O_deco_warnings &= ~DECO_FLAG; // no, clear deco flag 2383 if ( (NDL_time == 0) && deco_tissue_vector ) char_O_deco_warnings |= DECO_FLAG;
2384 else if ( !deco_tissue_vector ) char_O_deco_warnings &= ~DECO_FLAG;
2383 2385
2384 2386
2385 assert( char_O_gtissue_no < NUM_COMP ); 2387 assert( char_O_gtissue_no < NUM_COMP );
2386 assert( 0.0 <= calc_lead_tissue_limit && calc_lead_tissue_limit <= 14.0); 2388 assert( 0.0 <= calc_lead_tissue_limit && calc_lead_tissue_limit <= 14.0);
2387 } 2389 }