Mercurial > public > mk2
comparison code_part1/OSTC_code_c_part2/p2_deco.c @ 226:24cd6e256d61
Better gas lookup policy, supporting unsorted list.
author | JeanDo |
---|---|
date | Fri, 04 Mar 2011 01:20:18 +0100 |
parents | 2dc4a7340510 |
children | 2cbaa01dac26 |
comparison
equal
deleted
inserted
replaced
225:2dc4a7340510 | 226:24cd6e256d61 |
---|---|
888 { | 888 { |
889 // Should restart gas-switch delay only when gas do changes... | 889 // Should restart gas-switch delay only when gas do changes... |
890 // sim_gas_last_used: used to detect just once in each ascent simu. | 890 // sim_gas_last_used: used to detect just once in each ascent simu. |
891 // N2_ratio : used to detect when already breathing that gas. | 891 // N2_ratio : used to detect when already breathing that gas. |
892 if( temp_depth_limit != switch_deco | 892 if( temp_depth_limit != switch_deco |
893 && sim_gas_last_used < temp_gas_switch | 893 && sim_gas_last_used != temp_gas_switch |
894 && sim_gas_delay <= sim_dive_mins ) | 894 && sim_gas_delay <= sim_dive_mins ) |
895 { | 895 { |
896 sim_gas_last_used = temp_gas_switch; | 896 sim_gas_last_used = temp_gas_switch; |
897 sim_gas_delay = read_custom_function(55); | 897 sim_gas_delay = read_custom_function(55); |
898 | 898 |
941 if( temp_gas_switch ) | 941 if( temp_gas_switch ) |
942 { | 942 { |
943 // Should restart gas-switch delay only when gas do changes... | 943 // Should restart gas-switch delay only when gas do changes... |
944 // sim_gas_last_used: used to detect just once in each ascent simu. | 944 // sim_gas_last_used: used to detect just once in each ascent simu. |
945 // N2_ratio : used to detect when already breathing that gas. | 945 // N2_ratio : used to detect when already breathing that gas. |
946 if( sim_gas_last_used < temp_gas_switch | 946 if( sim_gas_last_used != temp_gas_switch |
947 && sim_gas_delay <= sim_dive_mins ) | 947 && sim_gas_delay <= sim_dive_mins ) |
948 { | 948 { |
949 sim_gas_last_used = temp_gas_switch; | 949 sim_gas_last_used = temp_gas_switch; |
950 sim_gas_delay = read_custom_function(55); | 950 sim_gas_delay = read_custom_function(55); |
951 | 951 |