comparison code_part1/OSTC_code_c_part2/p2_deco.c @ 322:676d18bce8d7

Fix ppO2[flush] display in customview.
author JeanDo
date Sat, 07 May 2011 00:08:08 +0200
parents a99073445c18
children b7940978edc9
comparison
equal deleted inserted replaced
321:a99073445c18 322:676d18bce8d7
1382 assert( 0.800 < pres_respiration && pres_respiration < 14.0 ); 1382 assert( 0.800 < pres_respiration && pres_respiration < 14.0 );
1383 1383
1384 pres_diluent = pres_respiration; 1384 pres_diluent = pres_respiration;
1385 if( char_I_const_ppO2 != 0 ) // new in v.101 1385 if( char_I_const_ppO2 != 0 ) // new in v.101
1386 { 1386 {
1387 overlay float flush_ppO2 = pres_respiration * (1.0 - N2_ratio - He_ratio);
1388
1387 pres_diluent -= const_ppO2; // new in v.101 1389 pres_diluent -= const_ppO2; // new in v.101
1388 pres_diluent /= N2_ratio + He_ratio; // new in v.101 1390 pres_diluent /= N2_ratio + He_ratio; // new in v.101
1389 if( pres_diluent < 0.0 ) 1391 if( pres_diluent < 0.0 )
1390 pres_diluent = 0.0; 1392 pres_diluent = 0.0;
1391 if( pres_diluent > pres_respiration ) // new in v.101 1393 if( pres_diluent > pres_respiration ) // new in v.101
1392 pres_diluent = pres_respiration; // new in v.101 1394 pres_diluent = pres_respiration; // new in v.101
1393 1395
1394 char_O_diluent = (unsigned char)(pres_diluent/pres_respiration*100.0 + 0.5); 1396 char_O_diluent = (unsigned char)(pres_diluent/pres_respiration*100.0 + 0.5);
1395 char_O_diluent_ppO2 = (unsigned char)(pres_diluent * (1.0 - N2_ratio - He_ratio) * 100.0 + 0.5); 1397
1398 if( flush_ppO2 > 2.45 ) flush_ppO2 = 2.55;
1399 if( flush_ppO2 < 0.0 ) flush_ppO2 = 0.0;
1400 char_O_flush_ppO2 = (unsigned char)(flush_ppO2*100.0 + 0.5);
1396 } 1401 }
1397 1402
1398 if( pres_diluent > ppWater ) // new in v.101 1403 if( pres_diluent > ppWater ) // new in v.101
1399 { 1404 {
1400 overlay float EAD, END; 1405 overlay float EAD, END;