mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
planner: make argument to plan_add_segment() depth_t
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
6b57b3b745
commit
022b927755
4 changed files with 72 additions and 72 deletions
|
@ -302,9 +302,9 @@ static void create_dive_from_plan(struct diveplan &diveplan, struct dive *dive,
|
|||
return;
|
||||
}
|
||||
|
||||
divedatapoint::divedatapoint(int time_incr, int depth, int cylinderid, int po2, bool entered) :
|
||||
divedatapoint::divedatapoint(int time_incr, depth_t depth, int cylinderid, int po2, bool entered) :
|
||||
time(time_incr),
|
||||
depth{ .mm = depth },
|
||||
depth(depth),
|
||||
cylinderid(cylinderid),
|
||||
minimum_gas(0_bar),
|
||||
setpoint(po2),
|
||||
|
@ -323,7 +323,7 @@ static void add_to_end_of_diveplan(struct diveplan &diveplan, const struct dived
|
|||
diveplan.dp.back().time += lasttime;
|
||||
}
|
||||
|
||||
void plan_add_segment(struct diveplan &diveplan, int duration, int depth, int cylinderid, int po2, bool entered, enum divemode_t divemode)
|
||||
void plan_add_segment(struct diveplan &diveplan, int duration, depth_t depth, int cylinderid, int po2, bool entered, enum divemode_t divemode)
|
||||
{
|
||||
struct divedatapoint dp(duration, depth, cylinderid, divemode == CCR ? po2 : 0, entered);
|
||||
dp.divemode = divemode;
|
||||
|
@ -687,7 +687,7 @@ std::vector<decostop> plan(struct deco_state *ds, struct diveplan &diveplan, str
|
|||
* same ascent rate as in fake_dc(). If you change it here, also change it there.
|
||||
*/
|
||||
transitiontime = lrint(depth.mm / (double)prefs.ascratelast6m);
|
||||
plan_add_segment(diveplan, transitiontime, 0, current_cylinder, po2, false, divemode);
|
||||
plan_add_segment(diveplan, transitiontime, 0_m, current_cylinder, po2, false, divemode);
|
||||
create_dive_from_plan(diveplan, dive, dc, is_planner);
|
||||
return {};
|
||||
}
|
||||
|
@ -742,13 +742,13 @@ std::vector<decostop> plan(struct deco_state *ds, struct diveplan &diveplan, str
|
|||
// so we don't really have to compute the deco state.
|
||||
update_cylinder_pressure(dive, depth.mm, depth.mm, -timestep, prefs.bottomsac, dive->get_cylinder(current_cylinder), false, divemode);
|
||||
clock -= timestep;
|
||||
plan_add_segment(diveplan, clock - previous_point_time, depth.mm, current_cylinder, po2, true, divemode);
|
||||
plan_add_segment(diveplan, clock - previous_point_time, depth, current_cylinder, po2, true, divemode);
|
||||
previous_point_time = clock;
|
||||
do {
|
||||
/* Ascend to surface */
|
||||
int deltad = ascent_velocity(depth, avg_depth, bottom_time) * base_timestep;
|
||||
if (ascent_velocity(depth, avg_depth, bottom_time) != last_ascend_rate) {
|
||||
plan_add_segment(diveplan, clock - previous_point_time, depth.mm, current_cylinder, po2, false, divemode);
|
||||
plan_add_segment(diveplan, clock - previous_point_time, depth, current_cylinder, po2, false, divemode);
|
||||
previous_point_time = clock;
|
||||
last_ascend_rate = ascent_velocity(depth, avg_depth, bottom_time);
|
||||
}
|
||||
|
@ -758,15 +758,15 @@ std::vector<decostop> plan(struct deco_state *ds, struct diveplan &diveplan, str
|
|||
clock += base_timestep;
|
||||
depth.mm -= deltad;
|
||||
if (depth.mm <= 5000 && depth.mm >= (5000 - deltad) && safety_stop) {
|
||||
plan_add_segment(diveplan, clock - previous_point_time, 5000, current_cylinder, po2, false, divemode);
|
||||
plan_add_segment(diveplan, clock - previous_point_time, 5_m, current_cylinder, po2, false, divemode);
|
||||
previous_point_time = clock;
|
||||
clock += 180;
|
||||
plan_add_segment(diveplan, clock - previous_point_time, 5000, current_cylinder, po2, false, divemode);
|
||||
plan_add_segment(diveplan, clock - previous_point_time, 5_m, current_cylinder, po2, false, divemode);
|
||||
previous_point_time = clock;
|
||||
safety_stop = false;
|
||||
}
|
||||
} while (depth.mm > 0);
|
||||
plan_add_segment(diveplan, clock - previous_point_time, 0, current_cylinder, po2, false, divemode);
|
||||
plan_add_segment(diveplan, clock - previous_point_time, 0_m, current_cylinder, po2, false, divemode);
|
||||
create_dive_from_plan(diveplan, dive, dc, is_planner);
|
||||
diveplan.add_plan_to_notes(*dive, show_disclaimer, error);
|
||||
fixup_dc_duration(*dc);
|
||||
|
@ -793,7 +793,7 @@ std::vector<decostop> plan(struct deco_state *ds, struct diveplan &diveplan, str
|
|||
add_segment(ds, dive->depth_to_bar(depth),
|
||||
dive->get_cylinder(current_cylinder)->gasmix,
|
||||
bailoutsegment, po2, divemode, prefs.bottomsac, true);
|
||||
plan_add_segment(diveplan, bailoutsegment, depth.mm, current_cylinder, po2, false, divemode);
|
||||
plan_add_segment(diveplan, bailoutsegment, depth, current_cylinder, po2, false, divemode);
|
||||
bottom_time += bailoutsegment;
|
||||
}
|
||||
previous_deco_time = 100000000;
|
||||
|
@ -848,7 +848,7 @@ std::vector<decostop> plan(struct deco_state *ds, struct diveplan &diveplan, str
|
|||
depth_t deltad { .mm = ascent_velocity(depth, avg_depth, bottom_time) * base_timestep };
|
||||
if (ascent_velocity(depth, avg_depth, bottom_time) != last_ascend_rate) {
|
||||
if (is_final_plan)
|
||||
plan_add_segment(diveplan, clock - previous_point_time, depth.mm, current_cylinder, po2, false, divemode);
|
||||
plan_add_segment(diveplan, clock - previous_point_time, depth, current_cylinder, po2, false, divemode);
|
||||
previous_point_time = clock;
|
||||
stopping = false;
|
||||
last_ascend_rate = ascent_velocity(depth, avg_depth, bottom_time);
|
||||
|
@ -884,7 +884,7 @@ std::vector<decostop> plan(struct deco_state *ds, struct diveplan &diveplan, str
|
|||
!trial_ascent(ds, 0, depth, stoplevels[stopidx - 1], avg_depth, bottom_time,
|
||||
dive->get_cylinder(current_cylinder)->gasmix, po2, diveplan.surface_pressure.mbar / 1000.0, dive, divemode) || get_o2(dive->get_cylinder(current_cylinder)->gasmix) < 160) {
|
||||
if (is_final_plan)
|
||||
plan_add_segment(diveplan, clock - previous_point_time, depth.mm, current_cylinder, po2, false, divemode);
|
||||
plan_add_segment(diveplan, clock - previous_point_time, depth, current_cylinder, po2, false, divemode);
|
||||
stopping = true;
|
||||
previous_point_time = clock;
|
||||
current_cylinder = gaschanges[gi].gasidx;
|
||||
|
@ -932,7 +932,7 @@ std::vector<decostop> plan(struct deco_state *ds, struct diveplan &diveplan, str
|
|||
/* The last segment was an ascend segment.
|
||||
* Add a waypoint for start of this deco stop */
|
||||
if (is_final_plan)
|
||||
plan_add_segment(diveplan, clock - previous_point_time, depth.mm, current_cylinder, po2, false, divemode);
|
||||
plan_add_segment(diveplan, clock - previous_point_time, depth, current_cylinder, po2, false, divemode);
|
||||
previous_point_time = clock;
|
||||
stopping = true;
|
||||
}
|
||||
|
@ -989,7 +989,7 @@ std::vector<decostop> plan(struct deco_state *ds, struct diveplan &diveplan, str
|
|||
o2break_next = true;
|
||||
breakfrom_cylinder = current_cylinder;
|
||||
if (is_final_plan)
|
||||
plan_add_segment(diveplan, laststoptime, depth.mm, current_cylinder, po2, false, divemode);
|
||||
plan_add_segment(diveplan, laststoptime, depth, current_cylinder, po2, false, divemode);
|
||||
previous_point_time = clock + laststoptime;
|
||||
current_cylinder = break_cylinder;
|
||||
}
|
||||
|
@ -1000,7 +1000,7 @@ std::vector<decostop> plan(struct deco_state *ds, struct diveplan &diveplan, str
|
|||
o2breaking = true;
|
||||
o2break_next = false;
|
||||
if (is_final_plan)
|
||||
plan_add_segment(diveplan, laststoptime, depth.mm, current_cylinder, po2, false, divemode);
|
||||
plan_add_segment(diveplan, laststoptime, depth, current_cylinder, po2, false, divemode);
|
||||
previous_point_time = clock + laststoptime;
|
||||
current_cylinder = breakfrom_cylinder;
|
||||
}
|
||||
|
@ -1018,7 +1018,7 @@ std::vector<decostop> plan(struct deco_state *ds, struct diveplan &diveplan, str
|
|||
if (stopping) {
|
||||
/* Next we will ascend again. Add a waypoint if we have spend deco time */
|
||||
if (is_final_plan)
|
||||
plan_add_segment(diveplan, clock - previous_point_time, depth.mm, current_cylinder, po2, false, divemode);
|
||||
plan_add_segment(diveplan, clock - previous_point_time, depth, current_cylinder, po2, false, divemode);
|
||||
previous_point_time = clock;
|
||||
stopping = false;
|
||||
}
|
||||
|
@ -1030,7 +1030,7 @@ std::vector<decostop> plan(struct deco_state *ds, struct diveplan &diveplan, str
|
|||
ds->deco_time = clock - bottom_time - (m_or_ft(3, 10).mm * ( prefs.last_stop ? 2 : 1)) / last_ascend_rate + 20;
|
||||
} while (!is_final_plan && error == PLAN_OK);
|
||||
|
||||
plan_add_segment(diveplan, clock - previous_point_time, 0, current_cylinder, po2, false, divemode);
|
||||
plan_add_segment(diveplan, clock - previous_point_time, 0_m, current_cylinder, po2, false, divemode);
|
||||
if (decoMode(true) == VPMB) {
|
||||
diveplan.eff_gfhigh = lrint(100.0 * regressionb(ds));
|
||||
diveplan.eff_gflow = lrint(100.0 * (regressiona(ds) * first_stop_depth.mm + regressionb(ds)));
|
||||
|
@ -1043,7 +1043,7 @@ std::vector<decostop> plan(struct deco_state *ds, struct diveplan &diveplan, str
|
|||
// past the regular cylinder table, which is not visible to the UI.
|
||||
// Fix this as soon as possible!
|
||||
current_cylinder = static_cast<int>(dive->cylinders.size());
|
||||
plan_add_segment(diveplan, prefs.surface_segment, 0, current_cylinder, 0, false, OC);
|
||||
plan_add_segment(diveplan, prefs.surface_segment, 0_m, current_cylinder, 0, false, OC);
|
||||
}
|
||||
create_dive_from_plan(diveplan, dive, dc, is_planner);
|
||||
diveplan.add_plan_to_notes(*dive, show_disclaimer, error);
|
||||
|
|
|
@ -21,7 +21,7 @@ struct divedatapoint {
|
|||
divedatapoint(const divedatapoint &) = default;
|
||||
divedatapoint(divedatapoint &&) = default;
|
||||
divedatapoint &operator=(const divedatapoint &) = default;
|
||||
divedatapoint(int time_incr, int depth, int cylinderid, int po2, bool entered);
|
||||
divedatapoint(int time_incr, depth_t depth, int cylinderid, int po2, bool entered);
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
|
@ -61,7 +61,7 @@ extern int get_cylinderid_at_time(struct dive *dive, struct divecomputer *dc, du
|
|||
extern int ascent_velocity(depth_t depth, int avg_depth, int);
|
||||
extern const char *get_planner_disclaimer();
|
||||
|
||||
void plan_add_segment(struct diveplan &diveplan, int duration, int depth, int cylinderid, int po2, bool entered, enum divemode_t divemode);
|
||||
void plan_add_segment(struct diveplan &diveplan, int duration, depth_t depth, int cylinderid, int po2, bool entered, enum divemode_t divemode);
|
||||
#if DEBUG_PLAN
|
||||
void dump_plan(struct diveplan *diveplan);
|
||||
#endif
|
||||
|
|
|
@ -882,7 +882,7 @@ int DivePlannerPointsModel::addStop(depth_t depth, int seconds, int cylinderid_i
|
|||
|
||||
// add the new stop
|
||||
beginInsertRows(QModelIndex(), row, row);
|
||||
divedatapoint point(seconds, depth.mm, cylinderid, ccpoint, entered);
|
||||
divedatapoint point(seconds, depth, cylinderid, ccpoint, entered);
|
||||
point.divemode = divemode;
|
||||
divepoints.insert(divepoints.begin() + row, point);
|
||||
endInsertRows();
|
||||
|
@ -1083,7 +1083,7 @@ void DivePlannerPointsModel::createTemporaryPlan()
|
|||
|
||||
for (auto [i, cyl]: enumerated_range(d->cylinders)) {
|
||||
if (cyl.depth.mm && cyl.cylinder_use == OC_GAS)
|
||||
plan_add_segment(diveplan, 0, cyl.depth.mm, i, 0, false, OC);
|
||||
plan_add_segment(diveplan, 0, cyl.depth, i, 0, false, OC);
|
||||
}
|
||||
|
||||
int lastIndex = -1;
|
||||
|
@ -1094,11 +1094,11 @@ void DivePlannerPointsModel::createTemporaryPlan()
|
|||
lastIndex = i;
|
||||
if (i == 0 && mode == PLAN && prefs.drop_stone_mode) {
|
||||
/* Okay, we add a first segment where we go down to depth */
|
||||
plan_add_segment(diveplan, p.depth.mm / prefs.descrate, p.depth.mm, p.cylinderid, divemode == CCR ? p.setpoint : 0, true, divemode);
|
||||
plan_add_segment(diveplan, p.depth.mm / prefs.descrate, p.depth, p.cylinderid, divemode == CCR ? p.setpoint : 0, true, divemode);
|
||||
deltaT -= p.depth.mm / prefs.descrate;
|
||||
}
|
||||
if (p.entered)
|
||||
plan_add_segment(diveplan, deltaT, p.depth.mm, p.cylinderid, divemode == CCR ? p.setpoint : 0, true, divemode);
|
||||
plan_add_segment(diveplan, deltaT, p.depth, p.cylinderid, divemode == CCR ? p.setpoint : 0, true, divemode);
|
||||
}
|
||||
|
||||
#if DEBUG_PLAN
|
||||
|
|
|
@ -65,10 +65,10 @@ diveplan setupPlan()
|
|||
reset_cylinders(&dive, true);
|
||||
|
||||
int droptime = m_or_ft(79, 260).mm * 60 / m_or_ft(23, 75).mm;
|
||||
plan_add_segment(dp, 0, dive.gas_mod(ean36, po2, m_or_ft(3, 10)).mm, 1, 0, 1, OC);
|
||||
plan_add_segment(dp, 0, dive.gas_mod(oxygen, po2, m_or_ft(3, 10)).mm, 2, 0, 1, OC);
|
||||
plan_add_segment(dp, droptime, m_or_ft(79, 260).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 30 * 60 - droptime, m_or_ft(79, 260).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 0, dive.gas_mod(ean36, po2, m_or_ft(3, 10)), 1, 0, 1, OC);
|
||||
plan_add_segment(dp, 0, dive.gas_mod(oxygen, po2, m_or_ft(3, 10)), 2, 0, 1, OC);
|
||||
plan_add_segment(dp, droptime, m_or_ft(79, 260), 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 30 * 60 - droptime, m_or_ft(79, 260), 0, 0, 1, OC);
|
||||
return dp;
|
||||
}
|
||||
|
||||
|
@ -100,10 +100,10 @@ diveplan setupPlanVpmb45m30mTx()
|
|||
reset_cylinders(&dive, true);
|
||||
|
||||
int droptime = m_or_ft(45, 150).mm * 60 / m_or_ft(23, 75).mm;
|
||||
plan_add_segment(dp, 0, dive.gas_mod(ean50, po2, m_or_ft(3, 10)).mm, 1, 0, 1, OC);
|
||||
plan_add_segment(dp, 0, dive.gas_mod(oxygen, po2, m_or_ft(3, 10)).mm, 2, 0, 1, OC);
|
||||
plan_add_segment(dp, droptime, m_or_ft(45, 150).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 30 * 60 - droptime, m_or_ft(45, 150).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 0, dive.gas_mod(ean50, po2, m_or_ft(3, 10)), 1, 0, 1, OC);
|
||||
plan_add_segment(dp, 0, dive.gas_mod(oxygen, po2, m_or_ft(3, 10)), 2, 0, 1, OC);
|
||||
plan_add_segment(dp, droptime, m_or_ft(45, 150), 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 30 * 60 - droptime, m_or_ft(45, 150), 0, 0, 1, OC);
|
||||
return dp;
|
||||
}
|
||||
|
||||
|
@ -135,10 +135,10 @@ diveplan setupPlanVpmb60m10mTx()
|
|||
reset_cylinders(&dive, true);
|
||||
|
||||
int droptime = m_or_ft(60, 200).mm * 60 / m_or_ft(23, 75).mm;
|
||||
plan_add_segment(dp, 0, dive.gas_mod(tx50_15, po2, m_or_ft(3, 10)).mm, 1, 0, 1, OC);
|
||||
plan_add_segment(dp, 0, dive.gas_mod(oxygen, po2, m_or_ft(3, 10)).mm, 2, 0, 1, OC);
|
||||
plan_add_segment(dp, droptime, m_or_ft(60, 200).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 10 * 60 - droptime, m_or_ft(60, 200).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 0, dive.gas_mod(tx50_15, po2, m_or_ft(3, 10)), 1, 0, 1, OC);
|
||||
plan_add_segment(dp, 0, dive.gas_mod(oxygen, po2, m_or_ft(3, 10)), 2, 0, 1, OC);
|
||||
plan_add_segment(dp, droptime, m_or_ft(60, 200), 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 10 * 60 - droptime, m_or_ft(60, 200), 0, 0, 1, OC);
|
||||
return dp;
|
||||
}
|
||||
|
||||
|
@ -159,8 +159,8 @@ diveplan setupPlanVpmb60m30minAir()
|
|||
reset_cylinders(&dive, true);
|
||||
|
||||
int droptime = m_or_ft(60, 200).mm * 60 / m_or_ft(99, 330).mm;
|
||||
plan_add_segment(dp, droptime, m_or_ft(60, 200).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 30 * 60 - droptime, m_or_ft(60, 200).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, droptime, m_or_ft(60, 200), 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 30 * 60 - droptime, m_or_ft(60, 200), 0, 0, 1, OC);
|
||||
return dp;
|
||||
}
|
||||
|
||||
|
@ -188,9 +188,9 @@ diveplan setupPlanVpmb60m30minEan50()
|
|||
reset_cylinders(&dive, true);
|
||||
|
||||
int droptime = m_or_ft(60, 200).mm * 60 / m_or_ft(99, 330).mm;
|
||||
plan_add_segment(dp, 0, dive.gas_mod(ean50, po2, m_or_ft(3, 10)).mm, 1, 0, 1, OC);
|
||||
plan_add_segment(dp, droptime, m_or_ft(60, 200).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 30 * 60 - droptime, m_or_ft(60, 200).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 0, dive.gas_mod(ean50, po2, m_or_ft(3, 10)), 1, 0, 1, OC);
|
||||
plan_add_segment(dp, droptime, m_or_ft(60, 200), 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 30 * 60 - droptime, m_or_ft(60, 200), 0, 0, 1, OC);
|
||||
return dp;
|
||||
}
|
||||
|
||||
|
@ -218,9 +218,9 @@ diveplan setupPlanVpmb60m30minTx()
|
|||
reset_cylinders(&dive, true);
|
||||
|
||||
int droptime = m_or_ft(60, 200).mm * 60 / m_or_ft(99, 330).mm;
|
||||
plan_add_segment(dp, 0, dive.gas_mod(ean50, po2, m_or_ft(3, 10)).mm, 1, 0, 1, OC);
|
||||
plan_add_segment(dp, droptime, m_or_ft(60, 200).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 30 * 60 - droptime, m_or_ft(60, 200).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 0, dive.gas_mod(ean50, po2, m_or_ft(3, 10)), 1, 0, 1, OC);
|
||||
plan_add_segment(dp, droptime, m_or_ft(60, 200), 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 30 * 60 - droptime, m_or_ft(60, 200), 0, 0, 1, OC);
|
||||
return dp;
|
||||
}
|
||||
|
||||
|
@ -241,10 +241,10 @@ diveplan setupPlanVpmbMultiLevelAir()
|
|||
reset_cylinders(&dive, true);
|
||||
|
||||
int droptime = m_or_ft(20, 66).mm * 60 / m_or_ft(99, 330).mm;
|
||||
plan_add_segment(dp, droptime, m_or_ft(20, 66).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 10 * 60 - droptime, m_or_ft(20, 66).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 1 * 60, m_or_ft(60, 200).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 29 * 60, m_or_ft(60, 200).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, droptime, m_or_ft(20, 66), 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 10 * 60 - droptime, m_or_ft(20, 66), 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 1 * 60, m_or_ft(60, 200), 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 29 * 60, m_or_ft(60, 200), 0, 0, 1, OC);
|
||||
return dp;
|
||||
}
|
||||
|
||||
|
@ -275,10 +275,10 @@ diveplan setupPlanVpmb100m60min()
|
|||
reset_cylinders(&dive, true);
|
||||
|
||||
int droptime = m_or_ft(100, 330).mm * 60 / m_or_ft(99, 330).mm;
|
||||
plan_add_segment(dp, 0, dive.gas_mod(ean50, po2, m_or_ft(3, 10)).mm, 1, 0, 1, OC);
|
||||
plan_add_segment(dp, 0, dive.gas_mod(oxygen, po2, m_or_ft(3, 10)).mm, 2, 0, 1, OC);
|
||||
plan_add_segment(dp, droptime, m_or_ft(100, 330).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 60 * 60 - droptime, m_or_ft(100, 330).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 0, dive.gas_mod(ean50, po2, m_or_ft(3, 10)), 1, 0, 1, OC);
|
||||
plan_add_segment(dp, 0, dive.gas_mod(oxygen, po2, m_or_ft(3, 10)), 2, 0, 1, OC);
|
||||
plan_add_segment(dp, droptime, m_or_ft(100, 330), 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 60 * 60 - droptime, m_or_ft(100, 330), 0, 0, 1, OC);
|
||||
return dp;
|
||||
}
|
||||
|
||||
|
@ -309,10 +309,10 @@ diveplan setupPlanVpmb100m10min()
|
|||
reset_cylinders(&dive, true);
|
||||
|
||||
int droptime = m_or_ft(100, 330).mm * 60 / m_or_ft(99, 330).mm;
|
||||
plan_add_segment(dp, 0, dive.gas_mod(ean50, po2, m_or_ft(3, 10)).mm, 1, 0, 1, OC);
|
||||
plan_add_segment(dp, 0, dive.gas_mod(oxygen, po2, m_or_ft(3, 10)).mm, 2, 0, 1, OC);
|
||||
plan_add_segment(dp, droptime, m_or_ft(100, 330).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 10 * 60 - droptime, m_or_ft(100, 330).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 0, dive.gas_mod(ean50, po2, m_or_ft(3, 10)), 1, 0, 1, OC);
|
||||
plan_add_segment(dp, 0, dive.gas_mod(oxygen, po2, m_or_ft(3, 10)), 2, 0, 1, OC);
|
||||
plan_add_segment(dp, droptime, m_or_ft(100, 330), 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 10 * 60 - droptime, m_or_ft(100, 330), 0, 0, 1, OC);
|
||||
return dp;
|
||||
}
|
||||
|
||||
|
@ -333,8 +333,8 @@ diveplan setupPlanVpmb30m20min()
|
|||
reset_cylinders(&dive, true);
|
||||
|
||||
int droptime = m_or_ft(30, 100).mm * 60 / m_or_ft(18, 60).mm;
|
||||
plan_add_segment(dp, droptime, m_or_ft(30, 100).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 20 * 60 - droptime, m_or_ft(30, 100).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, droptime, m_or_ft(30, 100), 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 20 * 60 - droptime, m_or_ft(30, 100), 0, 0, 1, OC);
|
||||
return dp;
|
||||
}
|
||||
|
||||
|
@ -368,13 +368,13 @@ diveplan setupPlanVpmb100mTo70m30min()
|
|||
reset_cylinders(&dive, true);
|
||||
|
||||
int droptime = m_or_ft(100, 330).mm * 60 / m_or_ft(18, 60).mm;
|
||||
plan_add_segment(dp, 0, dive.gas_mod(tx21_35, po2, m_or_ft(3, 10)).mm, 1, 0, 1, OC);
|
||||
plan_add_segment(dp, 0, dive.gas_mod(ean50, po2, m_or_ft(3, 10)).mm, 2, 0, 1, OC);
|
||||
plan_add_segment(dp, 0, dive.gas_mod(oxygen, po2, m_or_ft(3, 10)).mm, 3, 0, 1, OC);
|
||||
plan_add_segment(dp, droptime, m_or_ft(100, 330).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 20 * 60 - droptime, m_or_ft(100, 330).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 3 * 60, m_or_ft(70, 230).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, (30 - 20 - 3) * 60, m_or_ft(70, 230).mm, 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 0, dive.gas_mod(tx21_35, po2, m_or_ft(3, 10)), 1, 0, 1, OC);
|
||||
plan_add_segment(dp, 0, dive.gas_mod(ean50, po2, m_or_ft(3, 10)), 2, 0, 1, OC);
|
||||
plan_add_segment(dp, 0, dive.gas_mod(oxygen, po2, m_or_ft(3, 10)), 3, 0, 1, OC);
|
||||
plan_add_segment(dp, droptime, m_or_ft(100, 330), 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 20 * 60 - droptime, m_or_ft(100, 330), 0, 0, 1, OC);
|
||||
plan_add_segment(dp, 3 * 60, m_or_ft(70, 230), 0, 0, 1, OC);
|
||||
plan_add_segment(dp, (30 - 20 - 3) * 60, m_or_ft(70, 230), 0, 0, 1, OC);
|
||||
return dp;
|
||||
}
|
||||
|
||||
|
@ -403,10 +403,10 @@ diveplan setupPlanSeveralGases()
|
|||
dive.surface_pressure = 1_atm;
|
||||
reset_cylinders(&dive, true);
|
||||
|
||||
plan_add_segment(dp, 120, 40000, 0, 0, true, OC);
|
||||
plan_add_segment(dp, 18 * 60, 40000, 0, 0, true, OC);
|
||||
plan_add_segment(dp, 10 * 60, 10000, 1, 0, true, OC);
|
||||
plan_add_segment(dp, 5 * 60, 10000, 0, 0, true, OC);
|
||||
plan_add_segment(dp, 120, 40_m, 0, 0, true, OC);
|
||||
plan_add_segment(dp, 18 * 60, 40_m, 0, 0, true, OC);
|
||||
plan_add_segment(dp, 10 * 60, 10_m, 1, 0, true, OC);
|
||||
plan_add_segment(dp, 5 * 60, 10_m, 0, 0, true, OC);
|
||||
return dp;
|
||||
}
|
||||
|
||||
|
@ -441,9 +441,9 @@ diveplan setupPlanCcr()
|
|||
cyl2->depth = dive.gas_mod(tx19_33, po2, m_or_ft(3, 10));
|
||||
reset_cylinders(&dive, true);
|
||||
|
||||
plan_add_segment(dp, 0, cyl1->depth.mm, 1, 0, false, OC);
|
||||
plan_add_segment(dp, 0, cyl2->depth.mm, 2, 0, false, OC);
|
||||
plan_add_segment(dp, 20 * 60, m_or_ft(60, 197).mm, 0, 1300, true, CCR);
|
||||
plan_add_segment(dp, 0, cyl1->depth, 1, 0, false, OC);
|
||||
plan_add_segment(dp, 0, cyl2->depth, 2, 0, false, OC);
|
||||
plan_add_segment(dp, 20 * 60, m_or_ft(60, 197), 0, 1300, true, CCR);
|
||||
|
||||
return dp;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue