comparison Common/Src/decom.c @ 57:e941c9e49f73

Resolve format warnings
author Ideenmodellierer
date Thu, 09 Aug 2018 22:38:56 +0200
parents 5f11787b4f42
children 239aa58b533d
comparison
equal deleted inserted replaced
56:bab006305b58 57:e941c9e49f73
254 254
255 255
256 256
257 int period_in_seconds_left; 257 int period_in_seconds_left;
258 258
259 if(period_in_seconds <= 0) 259 if(period_in_seconds > 0)
260 return; 260 {
261
262 261
263 decom_get_inert_gases(ambiant_pressure_bar, pActualGas, &percent_N2, &percent_He); 262 decom_get_inert_gases(ambiant_pressure_bar, pActualGas, &percent_N2, &percent_He);
264 263
265 partial_pressure_N2 = (ambiant_pressure_bar - WATER_VAPOUR_PRESSURE) * percent_N2; 264 partial_pressure_N2 = (ambiant_pressure_bar - WATER_VAPOUR_PRESSURE) * percent_N2;
266 partial_pressure_He = (ambiant_pressure_bar - WATER_VAPOUR_PRESSURE) * percent_He; 265 partial_pressure_He = (ambiant_pressure_bar - WATER_VAPOUR_PRESSURE) * percent_He;
267 period_in_seconds_left = period_in_seconds; 266 period_in_seconds_left = period_in_seconds;
268 267
269 while(period_in_seconds_left) 268 while(period_in_seconds_left)
270 { 269 {
271 if(period_in_seconds_left >= 3600) 270 if(period_in_seconds_left >= 3600)
272 period_in_seconds = 3600; 271 period_in_seconds = 3600;
273 else 272 else
274 if(period_in_seconds_left >= 800) 273 if(period_in_seconds_left >= 800)
275 period_in_seconds = 800; 274 period_in_seconds = 800;
276 else 275 else
277 if(period_in_seconds_left >= 300) 276 if(period_in_seconds_left >= 300)
278 period_in_seconds = 300; 277 period_in_seconds = 300;
279 else 278 else
280 if(period_in_seconds_left >= 100) 279 if(period_in_seconds_left >= 100)
281 period_in_seconds = 100; 280 period_in_seconds = 100;
282 else 281 else
283 if(period_in_seconds_left >= 60) 282 if(period_in_seconds_left >= 60)
284 period_in_seconds = 60; 283 period_in_seconds = 60;
285 else 284 else
286 if(period_in_seconds_left == 36) 285 if(period_in_seconds_left == 36)
287 period_in_seconds = 18; 286 period_in_seconds = 18;
288 else 287 else
289 if(period_in_seconds_left >= 20) 288 if(period_in_seconds_left >= 20)
290 period_in_seconds = 20; 289 period_in_seconds = 20;
291 else 290 else
292 if(period_in_seconds_left >= 18) 291 if(period_in_seconds_left >= 18)
293 period_in_seconds = 18; 292 period_in_seconds = 18;
294 else 293 else
295 if(period_in_seconds_left >= 10) 294 if(period_in_seconds_left >= 10)
296 period_in_seconds = 10; 295 period_in_seconds = 10;
297 else 296 else
298 if(period_in_seconds_left >= 8) 297 if(period_in_seconds_left >= 8)
299 period_in_seconds = 8; 298 period_in_seconds = 8;
300 else 299 else
301 if(period_in_seconds_left >= 3) 300 if(period_in_seconds_left >= 3)
302 period_in_seconds = 3; 301 period_in_seconds = 3;
303 else 302 else
304 period_in_seconds = 1; 303 period_in_seconds = 1;
305 304
306 period_in_seconds_left -= period_in_seconds; 305 period_in_seconds_left -= period_in_seconds;
307 306
308 switch (period_in_seconds) 307 switch (period_in_seconds)
309 {
310 case 1:
311 for (ci=0;ci<16;ci++)
312 { 308 {
313 tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_one_second[ci]; 309 case 1:
314 tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_one_second[ci]; 310 for (ci=0;ci<16;ci++)
311 {
312 tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_one_second[ci];
313 tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_one_second[ci];
314 }
315 break;
316 case 3:
317 for (ci=0;ci<16;ci++)
318 {
319 tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_003_second[ci];
320 tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_003_second[ci];
321 }
322 break;
323 case 8:
324 for (ci=0;ci<16;ci++)
325 {
326 tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_008_second[ci];
327 tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_008_second[ci];
328 }
329 break;
330 case 10:
331 for (ci=0;ci<16;ci++)
332 {
333 tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_10_seconds[ci];
334 tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_10_seconds[ci];
335 }
336 break;
337 case 18:
338 for (ci=0;ci<16;ci++)
339 {
340 tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_18_seconds[ci];
341 tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_18_seconds[ci];
342 }
343 break;
344 case 20:
345 for (ci=0;ci<16;ci++)
346 {
347 tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_20_seconds[ci];
348 tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_20_seconds[ci];
349 }
350 break;
351 case 60:
352 for (ci=0;ci<16;ci++)
353 {
354 tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_one_minute[ci];
355 tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_one_minute[ci];
356 }
357 break;
358 case 100:
359 for (ci=0;ci<16;ci++)
360 {
361 tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_100_second[ci];
362 tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_100_second[ci];
363 }
364 break;
365 case 300:
366 for (ci=0;ci<16;ci++)
367 {
368 tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_five_minutes[ci];
369 tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_five_minutes[ci];
370 }
371 break;
372 case 800:
373 for (ci=0;ci<16;ci++)
374 {
375 tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_800_second[ci];
376 tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_800_second[ci];
377 }
378 break;
379 case 3600:
380 for (ci=0;ci<16;ci++)
381 {
382 tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_one_hour[ci];
383 tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_one_hour[ci];
384 }
385 break;
315 } 386 }
316 break;
317 case 3:
318 for (ci=0;ci<16;ci++)
319 {
320 tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_003_second[ci];
321 tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_003_second[ci];
322 }
323 break;
324 case 8:
325 for (ci=0;ci<16;ci++)
326 {
327 tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_008_second[ci];
328 tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_008_second[ci];
329 }
330 break;
331 case 10:
332 for (ci=0;ci<16;ci++)
333 {
334 tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_10_seconds[ci];
335 tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_10_seconds[ci];
336 }
337 break;
338 case 18:
339 for (ci=0;ci<16;ci++)
340 {
341 tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_18_seconds[ci];
342 tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_18_seconds[ci];
343 }
344 break;
345 case 20:
346 for (ci=0;ci<16;ci++)
347 {
348 tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_20_seconds[ci];
349 tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_20_seconds[ci];
350 }
351 break;
352 case 60:
353 for (ci=0;ci<16;ci++)
354 {
355 tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_one_minute[ci];
356 tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_one_minute[ci];
357 }
358 break;
359 case 100:
360 for (ci=0;ci<16;ci++)
361 {
362 tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_100_second[ci];
363 tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_100_second[ci];
364 }
365 break;
366 case 300:
367 for (ci=0;ci<16;ci++)
368 {
369 tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_five_minutes[ci];
370 tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_five_minutes[ci];
371 }
372 break;
373 case 800:
374 for (ci=0;ci<16;ci++)
375 {
376 tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_800_second[ci];
377 tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_800_second[ci];
378 }
379 break;
380 case 3600:
381 for (ci=0;ci<16;ci++)
382 {
383 tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_one_hour[ci];
384 tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_one_hour[ci];
385 }
386 break;
387 } 387 }
388 } 388 }
389 } 389 }
390 390
391 void decom_reset_with_1000mbar(SLifeData * pLifeData) 391 void decom_reset_with_1000mbar(SLifeData * pLifeData)