Mercurial > public > hwos_code
comparison src/Tests/deco_volume_test.cpp @ 295:7027d735ac62
NEW CCR decoplan: 2nd pass to display bailout stops and gas volumes
author | jDG |
---|---|
date | Sun, 31 May 2015 02:14:09 +0200 |
parents | 6d6b3689b20b |
children | af13a18a233b |
comparison
equal
deleted
inserted
replaced
294:f97e439d711c | 295:7027d735ac62 |
---|---|
36 static void setup_plan(const char* stops, | 36 static void setup_plan(const char* stops, |
37 const char* gas) | 37 const char* gas) |
38 { | 38 { |
39 int depth = 3 * (stops ? strlen(stops) : 0); | 39 int depth = 3 * (stops ? strlen(stops) : 0); |
40 | 40 |
41 if( ! depth ) | |
42 std::cout << " no deco" << std::endl; | |
43 | |
41 int s = 0; | 44 int s = 0; |
42 while( depth > 0 && s < NUM_STOPS ) { | 45 while( depth > 0 && s < NUM_STOPS ) { |
46 std::cout << " " << std::setw(2) << int(stops[s]) << "' @ " << depth << "m" << std::endl; | |
47 | |
43 char_O_deco_time [s] = stops[s]; | 48 char_O_deco_time [s] = stops[s]; |
44 char_O_deco_depth[s] = depth; | 49 char_O_deco_depth[s] = depth; |
45 char_O_deco_gas [s] = gas ? gas[s] : 1; // Gas#1 by default | 50 char_O_deco_gas [s] = gas ? gas[s] : 1; // Gas#1 by default |
46 ++s; | 51 ++s; |
47 depth -= 3; | 52 depth -= 3; |
186 0, ""); | 191 0, ""); |
187 } | 192 } |
188 | 193 |
189 ////////////////////////////////////////////////////////////////////////////// | 194 ////////////////////////////////////////////////////////////////////////////// |
190 // v1.82 ZH-L16+GF, CCR, 30%/85% | 195 // v1.82 ZH-L16+GF, CCR, 30%/85% |
191 TEST(gas_volume, CCR_13min30m) | 196 TEST(gas_volume, CCR_23min30m) |
192 { | 197 { |
193 char_I_const_ppO2 = 140;// SP 1.4 bar | 198 char_I_const_ppO2 = 140;// SP 1.4 bar |
194 setup_dive(13, 30); // 13' @ 30m --> no deco | 199 setup_dive(23, 30); // 23' @ 30m --> no deco / no BAIL deco |
195 | 200 |
196 ASSERT_NO_THROW( deco_gas_volumes() ); | 201 ASSERT_NO_THROW( deco_gas_volumes() ); |
197 check_volumes(/*NO BTM CONSO*/ ascent(20,30,0), "Gas1: 1190 L", | 202 check_volumes(/*NO BTM CONSO*/ ascent(20,30,0), "Gas1: 150 L", |
198 0, "", | 203 0, "", |
199 0, "", | 204 0, "", |
200 0, "", | 205 0, "", |
201 0, ""); | 206 0, ""); |
202 } | 207 } |
203 | 208 |
204 ////////////////////////////////////////////////////////////////////////////// | 209 ////////////////////////////////////////////////////////////////////////////// |
205 // v1.82 ZH-L16+GF, CCR, 30%/85% | 210 // v1.82 ZH-L16+GF, CCR, 30%/85% |
206 TEST(gas_volume, CCR_15min30m) | 211 TEST(gas_volume, CCR_25min30m) |
207 { | 212 { |
208 char_I_const_ppO2 = 140; // SP 1.4 bar | 213 char_I_const_ppO2 = 140;// SP 1.4 bar |
209 char stops[] = {1, 0}; | 214 char stops[] = {1, 0}; |
210 char gas[] = {3, 0}; | 215 char gas[] = {3, 0}; |
211 setup_dive(15, 30, stops, gas); // 15' @ 30m --> 1min at 3m | 216 setup_dive(25, 30, stops, gas); // 25' @ 30m --> no deco / BAIL 1' @ 3m |
212 | 217 |
213 ASSERT_NO_THROW( deco_gas_volumes() ); | 218 ASSERT_NO_THROW( deco_gas_volumes() ); |
214 check_volumes(/*NO BTM CONSO*/ ascent(20,30,3), "Gas1: 1343 L", | 219 check_volumes(/*NO BTM CONSO*/ ascent(20,30,3), "Gas1: 143 L", |
215 0, "", | 220 0, "", |
216 fixed(20, 1, 3) + ascent(20, 3,0), "Gas3: 33", | 221 fixed(20, 1, 3) + ascent(20, 3,0), "Gas3: 33 L", |
217 0, "", | 222 0, "", |
218 0, ""); | 223 0, ""); |
219 } | 224 } |
220 | 225 |
221 ////////////////////////////////////////////////////////////////////////////// | 226 ////////////////////////////////////////////////////////////////////////////// |
222 // v1.82 ZH-L16+GF, CCR, 30%/85% | 227 // v1.82 ZH-L16+GF, CCR, 30%/85% |
223 TEST(gas_volume, CCR_29min30m) | 228 TEST(gas_volume, CCR_45min30m) |
224 { | 229 { |
225 char_I_const_ppO2 = 140; // SP 1.4 bar | 230 char_I_const_ppO2 = 140; // SP 1.4 bar |
226 char stops[] = {1, 1, 2, 4, 0}; | 231 char stops[] = {1, 2, 5, 0}; |
227 char gas[] = {1, 3, 3, 3, 0}; | 232 char gas[] = {3, 3, 3, 0}; |
228 setup_dive(29, 30, stops, gas); // 29' @ 30m --> 1' 1' 2' 4' | 233 setup_dive(45, 30, stops, gas); // 45' @ 30m |
229 | 234 |
230 ASSERT_NO_THROW( deco_gas_volumes() ); | 235 ASSERT_NO_THROW( deco_gas_volumes() ); |
231 check_volumes(/*NO BTM CONSO*/ ascent(20,30,12) + | 236 check_volumes(/*NO BTM CONSO*/ ascent(20,30, 9), "Gas1: 124 L", |
232 fixed(20, 1,12) + ascent(20,12, 9), "Gas1: 2488 L", | |
233 0, "", | 237 0, "", |
234 fixed(20, 1, 9) + ascent(20, 9, 6) + | 238 fixed(20, 1, 9) + ascent(20, 9, 6) + |
235 fixed(20, 2, 6) + ascent(20, 6, 3) + | 239 fixed(20, 2, 6) + ascent(20, 6, 3) + |
236 fixed(20, 4, 3) + ascent(20, 3, 0), "Gas3: 232 L", | 240 fixed(20, 5, 3) + ascent(20, 3, 0), "Gas3: 258 L", |
237 0, "", | 241 0, "", |
238 0, ""); | 242 0, ""); |
239 } | 243 } |
240 | 244 |
241 ////////////////////////////////////////////////////////////////////////////// | 245 ////////////////////////////////////////////////////////////////////////////// |
242 // v1.82 ZH-L16+GF, CCR, 30%/85% | 246 // v1.82 ZH-L16+GF, CCR, 30%/85% |
243 TEST(gas_volume, CCR_15min60m) | 247 TEST(gas_volume, CCR_19min51m) |
244 { | 248 { |
245 char_I_const_ppO2 = 140; // SP 1.4 bar | 249 char_I_const_ppO2 = 140; // SP 1.4 bar |
246 char stops[] = {2, 1, 2, 4, 3, 4, 9, 0}; | 250 char stops[] = {1, 2, 2, 4, 3, 4, 9, 0}; |
247 char gas[] = {1, 1, 1, 1, 3, 3, 3, 0}; | 251 char gas[] = {1, 1, 1, 1, 3, 3, 3, 0}; |
248 setup_dive(15, 60, stops, gas); // 15' @ 60m --> DTR 32' | 252 setup_dive(19, 51, stops, gas); // 19' @ 51m --> 20' CCR / 31' BAIL |
249 | 253 |
250 ASSERT_NO_THROW( deco_gas_volumes() ); | 254 ASSERT_NO_THROW( deco_gas_volumes() ); |
251 check_volumes(/*NO BTM CONSO*/ ascent(20,60,21) + | 255 check_volumes(/*NO BTM CONSO*/ ascent(20,51,21) + |
252 fixed(20, 2,21) + ascent(20,21,18) + | 256 fixed(20, 1,21) + ascent(20,21,18) + |
253 fixed(20, 1,18) + ascent(20,18,15) + | 257 fixed(20, 2,18) + ascent(20,18,15) + |
254 fixed(20, 2,15) + ascent(20,15,12) + | 258 fixed(20, 2,15) + ascent(20,15,12) + |
255 fixed(20, 4,12) + ascent(20,12, 9), "Gas1: 3010 L", | 259 fixed(20, 4,12) + ascent(20,12, 9), "Gas1: 786 L", |
256 0, "", | 260 0, "", |
257 fixed(20, 3, 9) + ascent(20, 9, 6) + | 261 fixed(20, 3, 9) + ascent(20, 9, 6) + |
258 fixed(20, 4, 6) + ascent(20, 6, 3) + | 262 fixed(20, 4, 6) + ascent(20, 6, 3) + |
259 fixed(20, 9, 3) + ascent(20, 3, 0), "Gas3: 502 L", | 263 fixed(20, 9, 3) + ascent(20, 3, 0), "Gas3: 502 L", |
260 0, "", | 264 0, "", |
261 0, ""); | 265 0, ""); |
262 } | 266 } |
267 | |
268 ////////////////////////////////////////////////////////////////////////////// | |
269 // v1.82 ZH-L16+GF, CCR, 30%/85% | |
270 TEST(gas_volume, CCR_15min60m) | |
271 { | |
272 char_I_const_ppO2 = 140; // SP 1.4 bar | |
273 char stops[] = {1, 2, 2, 3, 4, 3, 5, 11, 0}; // BAILOUT mode | |
274 char gas[] = {1, 1, 1, 1, 1, 3, 3, 3, 0}; | |
275 setup_dive(15, 60, stops, gas); // 15' @ 60m --> DTR 32' | |
276 | |
277 ASSERT_NO_THROW( deco_gas_volumes() ); | |
278 check_volumes(/*NO BTM CONSO*/ ascent(20,60,24) + | |
279 fixed(20, 1,24) + ascent(20,24,21) + | |
280 fixed(20, 2,21) + ascent(20,21,18) + | |
281 fixed(20, 2,18) + ascent(20,18,15) + | |
282 fixed(20, 3,15) + ascent(20,15,12) + | |
283 fixed(20, 4,12) + ascent(20,12, 9), "Gas1: 1084 L", | |
284 0, "", | |
285 fixed(20, 3, 9) + ascent(20, 9, 6) + | |
286 fixed(20, 5, 6) + ascent(20, 6, 3) + | |
287 fixed(20,11, 3) + ascent(20, 3, 0), "Gas3: 586 L", | |
288 0, "", | |
289 0, ""); | |
290 } |