mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: pass depth_t to depth_to_* functions
This is a drop in the ocean. Make the usage of the unit-types a bit more consistent throughout the code base. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
ccf67b6e71
commit
c88f8bdd07
13 changed files with 216 additions and 213 deletions
|
@ -578,7 +578,7 @@ void TestPlan::testVpmbMetric45m30minTx()
|
|||
auto dp = std::find_if(testPlan.dp.begin(), testPlan.dp.end(), [](auto &dp) { return dp.minimum_gas.mbar != 0; });
|
||||
QCOMPARE(lrint(dp == testPlan.dp.end() ? 0.0 : dp->minimum_gas.mbar / 1000.0), 108l);
|
||||
// print first ceiling
|
||||
printf("First ceiling %.1f m\n", dive.mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar) * 0.001);
|
||||
printf("First ceiling %.1f m\n", dive.mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar).mm * 0.001);
|
||||
// check benchmark run time of 141 minutes, and known Subsurface runtime of 139 minutes
|
||||
//QVERIFY(compareDecoTime(dive.dcs[0].duration.seconds, 141u * 60u + 20u, 139u * 60u + 20u));
|
||||
}
|
||||
|
@ -604,7 +604,7 @@ void TestPlan::testVpmbMetric60m10minTx()
|
|||
auto dp = std::find_if(testPlan.dp.begin(), testPlan.dp.end(), [](auto &dp) { return dp.minimum_gas.mbar != 0; });
|
||||
QCOMPARE(lrint(dp == testPlan.dp.end() ? 0.0 : dp->minimum_gas.mbar / 1000.0), 162l);
|
||||
// print first ceiling
|
||||
printf("First ceiling %.1f m\n", dive.mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar) * 0.001);
|
||||
printf("First ceiling %.1f m\n", dive.mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar).mm * 0.001);
|
||||
// check benchmark run time of 141 minutes, and known Subsurface runtime of 139 minutes
|
||||
//QVERIFY(compareDecoTime(dive.dcs[0].duration.seconds, 141u * 60u + 20u, 139u * 60u + 20u));
|
||||
}
|
||||
|
@ -630,7 +630,7 @@ void TestPlan::testVpmbMetric60m30minAir()
|
|||
auto dp = std::find_if(testPlan.dp.begin(), testPlan.dp.end(), [](auto &dp) { return dp.minimum_gas.mbar != 0; });
|
||||
QCOMPARE(lrint(dp == testPlan.dp.end() ? 0.0 : dp->minimum_gas.mbar / 1000.0), 180l);
|
||||
// print first ceiling
|
||||
printf("First ceiling %.1f m\n", dive.mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar) * 0.001);
|
||||
printf("First ceiling %.1f m\n", dive.mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar).mm * 0.001);
|
||||
// check benchmark run time of 141 minutes, and known Subsurface runtime of 139 minutes
|
||||
QVERIFY(compareDecoTime(dive.dcs[0].duration.seconds, 141u * 60u + 20u, 139u * 60u + 20u));
|
||||
}
|
||||
|
@ -656,7 +656,7 @@ void TestPlan::testVpmbMetric60m30minEan50()
|
|||
auto dp = std::find_if(testPlan.dp.begin(), testPlan.dp.end(), [](auto &dp) { return dp.minimum_gas.mbar != 0; });
|
||||
QCOMPARE(lrint(dp == testPlan.dp.end() ? 0.0 : dp->minimum_gas.mbar / 1000.0), 155l);
|
||||
// print first ceiling
|
||||
printf("First ceiling %.1f m\n", dive.mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar) * 0.001);
|
||||
printf("First ceiling %.1f m\n", dive.mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar).mm * 0.001);
|
||||
QVERIFY(dive.dcs[0].events.size() >= 1);
|
||||
// check first gas change to EAN50 at 21m
|
||||
struct event *ev = &dive.dcs[0].events[0];
|
||||
|
@ -688,7 +688,7 @@ void TestPlan::testVpmbMetric60m30minTx()
|
|||
auto dp = std::find_if(testPlan.dp.begin(), testPlan.dp.end(), [](auto &dp) { return dp.minimum_gas.mbar != 0; });
|
||||
QCOMPARE(lrint(dp == testPlan.dp.end() ? 0.0 : dp->minimum_gas.mbar / 1000.0), 159l);
|
||||
// print first ceiling
|
||||
printf("First ceiling %.1f m\n", dive.mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar) * 0.001);
|
||||
printf("First ceiling %.1f m\n", dive.mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar).mm * 0.001);
|
||||
// check first gas change to EAN50 at 21m
|
||||
QVERIFY(dive.dcs[0].events.size() >= 1);
|
||||
struct event *ev = &dive.dcs[0].events[0];
|
||||
|
@ -720,7 +720,7 @@ void TestPlan::testVpmbMetric100m60min()
|
|||
auto dp = std::find_if(testPlan.dp.begin(), testPlan.dp.end(), [](auto &dp) { return dp.minimum_gas.mbar != 0; });
|
||||
QCOMPARE(lrint(dp == testPlan.dp.end() ? 0.0 : dp->minimum_gas.mbar / 1000.0), 157l);
|
||||
// print first ceiling
|
||||
printf("First ceiling %.1f m\n", dive.mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar) * 0.001);
|
||||
printf("First ceiling %.1f m\n", dive.mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar).mm * 0.001);
|
||||
QVERIFY(dive.dcs[0].events.size() >= 2);
|
||||
// check first gas change to EAN50 at 21m
|
||||
struct event *ev = &dive.dcs[0].events[0];
|
||||
|
@ -780,7 +780,7 @@ void TestPlan::testVpmbMetricMultiLevelAir()
|
|||
auto dp = std::find_if(testPlan.dp.begin(), testPlan.dp.end(), [](auto &dp) { return dp.minimum_gas.mbar != 0; });
|
||||
QCOMPARE(lrint(dp == testPlan.dp.end() ? 0.0 : dp->minimum_gas.mbar / 1000.0), 101l);
|
||||
// print first ceiling
|
||||
printf("First ceiling %.1f m\n", dive.mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar) * 0.001);
|
||||
printf("First ceiling %.1f m\n", dive.mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar).mm * 0.001);
|
||||
// check benchmark run time of 167 minutes, and known Subsurface runtime of 169 minutes
|
||||
QVERIFY(compareDecoTime(dive.dcs[0].duration.seconds, 167u * 60u + 20u, 169u * 60u + 20u));
|
||||
}
|
||||
|
@ -806,7 +806,7 @@ void TestPlan::testVpmbMetric100m10min()
|
|||
auto dp = std::find_if(testPlan.dp.begin(), testPlan.dp.end(), [](auto &dp) { return dp.minimum_gas.mbar != 0; });
|
||||
QCOMPARE(lrint(dp == testPlan.dp.end() ? 0.0 : dp->minimum_gas.mbar / 1000.0), 175l);
|
||||
// print first ceiling
|
||||
printf("First ceiling %.1f m\n", dive.mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar) * 0.001);
|
||||
printf("First ceiling %.1f m\n", dive.mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar).mm * 0.001);
|
||||
QVERIFY(dive.dcs[0].events.size() >= 2);
|
||||
// check first gas change to EAN50 at 21m
|
||||
struct event *ev = &dive.dcs[0].events[0];
|
||||
|
@ -849,7 +849,7 @@ void TestPlan::testVpmbMetricRepeat()
|
|||
auto dp = std::find_if(testPlan.dp.begin(), testPlan.dp.end(), [](auto &dp) { return dp.minimum_gas.mbar != 0; });
|
||||
QCOMPARE(lrint(dp == testPlan.dp.end() ? 0.0 : dp->minimum_gas.mbar / 1000.0), 61l);
|
||||
// print first ceiling
|
||||
printf("First ceiling %.1f m\n", dive.mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar) * 0.001);
|
||||
printf("First ceiling %.1f m\n", dive.mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar).mm * 0.001);
|
||||
// check benchmark run time of 27 minutes, and known Subsurface runtime of 28 minutes
|
||||
QVERIFY(compareDecoTime(dive.dcs[0].duration.seconds, 27u * 60u + 20u, 27u * 60u + 20u));
|
||||
|
||||
|
@ -867,7 +867,7 @@ void TestPlan::testVpmbMetricRepeat()
|
|||
dp = std::find_if(testPlan.dp.begin(), testPlan.dp.end(), [](auto &dp) { return dp.minimum_gas.mbar != 0; });
|
||||
QCOMPARE(lrint(dp == testPlan.dp.end() ? 0.0 : dp->minimum_gas.mbar / 1000.0), 85l);
|
||||
// print first ceiling
|
||||
printf("First ceiling %.1f m\n", dive.mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar) * 0.001);
|
||||
printf("First ceiling %.1f m\n", dive.mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar).mm * 0.001);
|
||||
QVERIFY(dive.dcs[0].events.size() >= 3);
|
||||
// check first gas change to 21/35 at 63m
|
||||
struct event *ev = &dive.dcs[0].events[0];
|
||||
|
@ -902,7 +902,7 @@ void TestPlan::testVpmbMetricRepeat()
|
|||
dp = std::find_if(testPlan.dp.begin(), testPlan.dp.end(), [](auto &dp) { return dp.minimum_gas.mbar != 0; });
|
||||
QCOMPARE(lrint(dp == testPlan.dp.end() ? 0.0 : dp->minimum_gas.mbar / 1000.0), 61l);
|
||||
// print first ceiling
|
||||
printf("First ceiling %.1f m\n", dive.mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar) * 0.001);
|
||||
printf("First ceiling %.1f m\n", dive.mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar).mm * 0.001);
|
||||
|
||||
// check runtime is exactly the same as the first time
|
||||
int finalDiveRunTimeSeconds = dive.dcs[0].duration.seconds;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue