comparison code_part1/OSTC_code_c_part2/p2_deco.c @ 278:17aab4ca0547

BUGFIX CCR decoplan fails (bug bb42). Make decoplaning faster (just update tissue during bottomtime). Animate ascent depth during decoplaning.
author JeanDo
date Tue, 19 Apr 2011 02:26:41 +0200
parents 02303915c199
children 8514588eb6a2
comparison
equal deleted inserted replaced
277:46d1012d096a 278:17aab4ca0547
923 RESET_C_STACK 923 RESET_C_STACK
924 clear_tissue(); 924 clear_tissue();
925 } 925 }
926 926
927 ////////////////////////////////////////////////////////////////////////////// 927 //////////////////////////////////////////////////////////////////////////////
928 // Called every 1 min during decoplanning.
929 // Update tissues for 1 min.
930 //
931 void deco_calc_tissue(void)
932 {
933 RESET_C_STACK
934 calc_hauptroutine_update_tissues();
935 }
936
937 //////////////////////////////////////////////////////////////////////////////
928 938
929 void deco_calc_wo_deco_step_1_min(void) 939 void deco_calc_wo_deco_step_1_min(void)
930 { 940 {
931 RESET_C_STACK 941 RESET_C_STACK
932 calc_wo_deco_step_1_min(); 942 calc_wo_deco_step_1_min();
1238 case 3: //---- At surface: start a new dive ------------------------------ 1248 case 3: //---- At surface: start a new dive ------------------------------
1239 clear_deco_table(); 1249 clear_deco_table();
1240 copy_deco_table(); 1250 copy_deco_table();
1241 int_O_ascenttime = 0; // Reset DTR. 1251 int_O_ascenttime = 0; // Reset DTR.
1242 char_O_nullzeit = 0; // Reset bottom time. 1252 char_O_nullzeit = 0; // Reset bottom time.
1243 char_O_deco_status = 0; // Calc bottom-time/nullzeit next iteration. 1253 char_O_deco_status = 0; // Calc bottom-time/nullzeit next iteration.
1244 1254
1245 // Values that should be reset just once for the full real dive. 1255 // Values that should be reset just once for the full real dive.
1246 // This is used to record the lowest stop for the whole dive, 1256 // This is used to record the lowest stop for the whole dive,
1247 // Including ACCROSS all simulated ascent. 1257 // Including ACCROSS all simulated ascent.
1248 low_depth = 0; 1258 low_depth = 0;
1455 { 1465 {
1456 Surface: 1466 Surface:
1457 copy_deco_table(); 1467 copy_deco_table();
1458 calc_ascenttime(); 1468 calc_ascenttime();
1459 char_O_deco_status = 0; // calc nullzeit next time. 1469 char_O_deco_status = 0; // calc nullzeit next time.
1470 char_O_deco_last_stop = 0; // Surface reached.
1460 return; 1471 return;
1461 } 1472 }
1462 } 1473 }
1463 } 1474 }
1464 else 1475 else
1471 sim_tissue(1); // Simulate compartiments for 1 minute. 1482 sim_tissue(1); // Simulate compartiments for 1 minute.
1472 } 1483 }
1473 1484
1474 // Surface not reached, need more stops... 1485 // Surface not reached, need more stops...
1475 char_O_deco_status = 1; // calc more stops next time. 1486 char_O_deco_status = 1; // calc more stops next time.
1487 char_O_deco_last_stop = temp_depth_limit; // Reached depth.
1476 } 1488 }
1477 1489
1478 ////////////////////////////////////////////////////////////////////////////// 1490 //////////////////////////////////////////////////////////////////////////////
1479 // Simulation ascention to first deco stop. 1491 // Simulation ascention to first deco stop.
1480 // 1492 //