Mercurial > public > hwos_code
comparison src/p2_deco.c @ 298:2fe34fc0e2ae
new submenu for gas consumption, show actual mix instead of GAS1-GAS5 in deco planner
author | heinrichsweikamp |
---|---|
date | Sun, 31 May 2015 16:19:56 +0200 |
parents | 30edd177016a |
children | 0ce5fa241b8e |
comparison
equal
deleted
inserted
replaced
297:65f6a7bfc205 | 298:2fe34fc0e2ae |
---|---|
2149 // | 2149 // |
2150 // Input: char_I_bottom_depth, char_I_bottom_time for planned dive. | 2150 // Input: char_I_bottom_depth, char_I_bottom_time for planned dive. |
2151 // Gas list. | 2151 // Gas list. |
2152 // char_I_first_gas is the bottom gas. | 2152 // char_I_first_gas is the bottom gas. |
2153 // decoplan (char_O_deco_depth, char_O_deco_time). | 2153 // decoplan (char_O_deco_depth, char_O_deco_time). |
2154 // CF#54 == TRUE if shallowest stop first. | 2154 // char_I_bottom_usage is bottom liters/minutes (5 .. 50) or bar/min. |
2155 // CF#56 == bottom liters/minutes (5 .. 50) or bar/min. | 2155 // char_I_deco_usage is deco liters/minutes (5 .. 50) or bar/min. |
2156 // CF#57 == deco liters/minutes (5 .. 50) or bar/min. | |
2157 // Output: int_O_gas_volumes[0..4] in litters * 0.1 | 2156 // Output: int_O_gas_volumes[0..4] in litters * 0.1 |
2158 // | 2157 // |
2159 void deco_gas_volumes(void) | 2158 void deco_gas_volumes(void) |
2160 { | 2159 { |
2161 overlay float volumes[NUM_GAS]; | 2160 overlay float volumes[NUM_GAS]; |
2166 | 2165 |
2167 //---- initialize -------------------------------------------------------- | 2166 //---- initialize -------------------------------------------------------- |
2168 for(i=0; i<NUM_GAS; ++i) // Nothing yet... | 2167 for(i=0; i<NUM_GAS; ++i) // Nothing yet... |
2169 volumes[i] = 0.0; | 2168 volumes[i] = 0.0; |
2170 | 2169 |
2171 // TODO: get conso from settings: | 2170 bottom_usage = char_I_bottom_usage; // In liter/minutes. |
2172 bottom_usage = 20; // In liter/minutes. | 2171 deco_usage = char_I_deco_usage; // In liter/minutes. |
2173 deco_usage = 20; // In liter/minutes. | |
2174 | 2172 |
2175 // Early return if not defined: | 2173 // Early return if not defined: |
2176 if( deco_usage <= 0.0 || bottom_usage <= 0.0 ) | 2174 if( deco_usage <= 0.0 || bottom_usage <= 0.0 ) |
2177 goto done; | 2175 goto done; |
2178 | 2176 |