comparison Discovery/Src/vpm.c @ 292:bfcea6e2ab3f div-fixes-6

translate: nullzeit -> ndl The code shall be in English :-) Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
author Jan Mulder <jlmulder@xs4all.nl>
date Thu, 02 May 2019 09:24:54 +0200
parents 24ff72e627f4
children 02d10d955be2
comparison
equal deleted inserted replaced
291:24ff72e627f4 292:bfcea6e2ab3f
185 static void vpm_calc_deco(void); 185 static void vpm_calc_deco(void);
186 static int vpm_calc_critcal_volume(_Bool begin,_Bool calc_nulltime); 186 static int vpm_calc_critcal_volume(_Bool begin,_Bool calc_nulltime);
187 static int vpm_check_converged(_Bool calc_nulltime); 187 static int vpm_check_converged(_Bool calc_nulltime);
188 static int vpm_calc_final_deco(_Bool begin); 188 static int vpm_calc_final_deco(_Bool begin);
189 static void BOYLES_LAW_COMPENSATION (float* First_Stop_Depth,float * Deco_Stop_Depth,float* Step_Size); 189 static void BOYLES_LAW_COMPENSATION (float* First_Stop_Depth,float * Deco_Stop_Depth,float* Step_Size);
190 static int vpm_calc_nullzeit(void); 190 static int vpm_calc_ndl(void);
191 static void vpm_init_1(void); 191 static void vpm_init_1(void);
192 static void vpm_calc_deco_ceiling(void); 192 static void vpm_calc_deco_ceiling(void);
193 193
194 static void vpm_init_1(void) 194 static void vpm_init_1(void)
195 { 195 {
240 pDECOINFO->output_stop_length_seconds[i] = 0; 240 pDECOINFO->output_stop_length_seconds[i] = 0;
241 } 241 }
242 242
243 if(pINPUT->dive_time_seconds < 10) 243 if(pINPUT->dive_time_seconds < 10)
244 { 244 {
245 vpm_calc_status = CALC_NULLZEIT; 245 vpm_calc_status = CALC_NDL;
246 return vpm_calc_status; 246 return vpm_calc_status;
247 } 247 }
248 pVpm = pVPM; 248 pVpm = pVPM;
249 pInput = pINPUT; 249 pInput = pINPUT;
250 pDecoInfo = pDECOINFO; 250 pDecoInfo = pDECOINFO;
251 pDiveSettings = pSettings; 251 pDiveSettings = pSettings;
252 252
253 if(vpm_calc_status == CALC_NULLZEIT) 253 if(vpm_calc_status == CALC_NDL)
254 { 254 {
255 tmp_calc_status = vpm_calc_nullzeit(); 255 tmp_calc_status = vpm_calc_ndl();
256 } 256 }
257 else 257 else
258 { 258 {
259 tmp_calc_status = CALC_BEGIN; 259 tmp_calc_status = CALC_BEGIN;
260 } 260 }
261 //Normal Deco calculation 261 //Normal Deco calculation
262 if(tmp_calc_status != CALC_NULLZEIT) 262 if(tmp_calc_status != CALC_NDL)
263 { 263 {
264 max_first_stop_depth = pVpm->max_first_stop_depth_save; 264 max_first_stop_depth = pVpm->max_first_stop_depth_save;
265 run_time_start_of_deco_zone = pVpm->run_time_start_of_deco_zone_save; 265 run_time_start_of_deco_zone = pVpm->run_time_start_of_deco_zone_save;
266 depth_start_of_deco_zone = pVpm->depth_start_of_deco_zone_save; 266 depth_start_of_deco_zone = pVpm->depth_start_of_deco_zone_save;
267 for (int i = 0; i < 16; ++i) { 267 for (int i = 0; i < 16; ++i) {
692 pDecoInfo->output_stop_length_seconds[dp] = 0; 692 pDecoInfo->output_stop_length_seconds[dp] = 0;
693 } 693 }
694 pDecoInfo->output_ndl_seconds = 0; 694 pDecoInfo->output_ndl_seconds = 0;
695 } 695 }
696 696
697 return CALC_NULLZEIT; 697 return CALC_NDL;
698 /* exit the critical volume l */ 698 /* exit the critical volume l */
699 } 699 }
700 700
701 /* =============================================================================== */ 701 /* =============================================================================== */
702 /* ASSIGN VARIABLES FOR ASCENT FROM START OF DECO ZONE TO FIRST STOP. SAVE */ 702 /* ASSIGN VARIABLES FOR ASCENT FROM START OF DECO ZONE TO FIRST STOP. SAVE */
2273 UNITS_FACTOR; 2273 UNITS_FACTOR;
2274 } 2274 }
2275 } 2275 }
2276 2276
2277 /* =============================================================================== */ 2277 /* =============================================================================== */
2278 // vpm_calc_nullzeit 2278 // vpm_calc_ndl
2279 // Purpose: This function calcs zero time (time where no decostops are needed) 2279 // Purpose: This function computes NDL (time where no decostops are needed)
2280 //=============================================================================== 2280 //===============================================================================
2281 #define MAX_NDL 240 2281 #define MAX_NDL 240
2282 2282
2283 static int vpm_calc_nullzeit(void) 2283 static int vpm_calc_ndl(void)
2284 { 2284 {
2285 static float future_helium_pressure[16]; 2285 static float future_helium_pressure[16];
2286 static float future_nitrogen_pressure[16]; 2286 static float future_nitrogen_pressure[16];
2287 static int temp_segment_time; 2287 static int temp_segment_time;
2288 static int mix_number; 2288 static int mix_number;
2317 count++; 2317 count++;
2318 temp_segment_time += 60; 2318 temp_segment_time += 60;
2319 if(temp_segment_time >= MAX_NDL) 2319 if(temp_segment_time >= MAX_NDL)
2320 { 2320 {
2321 pDecoInfo->output_ndl_seconds = temp_segment_time * 60; 2321 pDecoInfo->output_ndl_seconds = temp_segment_time * 60;
2322 return CALC_NULLZEIT; 2322 return CALC_NDL;
2323 } 2323 }
2324 run_time += 60; 2324 run_time += 60;
2325 //goto L700; 2325 //goto L700;
2326 for (i = 1; i <= 16; ++i) { 2326 for (i = 1; i <= 16; ++i) {
2327 previous_helium_pressure[i-1] = future_helium_pressure[i - 1]; 2327 previous_helium_pressure[i-1] = future_helium_pressure[i - 1];
2352 { 2352 {
2353 temp_segment_time += 5; 2353 temp_segment_time += 5;
2354 if(temp_segment_time >= MAX_NDL) 2354 if(temp_segment_time >= MAX_NDL)
2355 { 2355 {
2356 pDecoInfo->output_ndl_seconds = temp_segment_time * 60; 2356 pDecoInfo->output_ndl_seconds = temp_segment_time * 60;
2357 return CALC_NULLZEIT; 2357 return CALC_NDL;
2358 } 2358 }
2359 if(nullzeit_unter60 && temp_segment_time > 60) 2359 if(nullzeit_unter60 && temp_segment_time > 60)
2360 { 2360 {
2361 nullzeit_unter60 = false; 2361 nullzeit_unter60 = false;
2362 return CALC_NULLZEIT; 2362 return CALC_NDL;
2363 } 2363 }
2364 run_time += 5; 2364 run_time += 5;
2365 //goto L700; 2365 //goto L700;
2366 for (i = 1; i <= 16; ++i) { 2366 for (i = 1; i <= 16; ++i) {
2367 previous_helium_pressure[i-1] = future_helium_pressure[i - 1]; 2367 previous_helium_pressure[i-1] = future_helium_pressure[i - 1];
2403 } 2403 }
2404 else 2404 else
2405 temp_segment_time += 5; 2405 temp_segment_time += 5;
2406 pDecoInfo->output_ndl_seconds = temp_segment_time * 60; 2406 pDecoInfo->output_ndl_seconds = temp_segment_time * 60;
2407 if(temp_segment_time > 1) 2407 if(temp_segment_time > 1)
2408 return CALC_NULLZEIT; 2408 return CALC_NDL;
2409 else 2409 else
2410 return CALC_BEGIN; 2410 return CALC_BEGIN;
2411 } 2411 }