mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-08 01:26:16 +00:00
Look for actual isobaric counter diffusion
Identify segements that fullfill the folllowing criteria for the leading compartment: He is off-gasing while N2 is on-gasing Overall there is on-gasing Add a line to the info box for those segments Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
71d1e78db2
commit
ece714556f
5 changed files with 14 additions and 2 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
- Profile: Add information about actual isobaric counter diffusion happening
|
||||||
- Suunto DM import: improved temperature parsing in special cases
|
- Suunto DM import: improved temperature parsing in special cases
|
||||||
# Always add new entries at the very top of this file above other
|
# Always add new entries at the very top of this file above other
|
||||||
# existing entries.
|
# existing entries.
|
||||||
|
|
|
@ -482,7 +482,7 @@ void add_segment(struct deco_state *ds, double pressure, const struct gasmix *ga
|
||||||
(void) sac;
|
(void) sac;
|
||||||
int ci;
|
int ci;
|
||||||
struct gas_pressures pressures;
|
struct gas_pressures pressures;
|
||||||
|
bool icd = false;
|
||||||
fill_pressures(&pressures, pressure - ((in_planner() && (decoMode() == VPMB)) ? WV_PRESSURE_SCHREINER : WV_PRESSURE),
|
fill_pressures(&pressures, pressure - ((in_planner() && (decoMode() == VPMB)) ? WV_PRESSURE_SCHREINER : WV_PRESSURE),
|
||||||
gasmix, (double) ccpo2 / 1000.0, dive->dc.divemode);
|
gasmix, (double) ccpo2 / 1000.0, dive->dc.divemode);
|
||||||
|
|
||||||
|
@ -494,6 +494,11 @@ void add_segment(struct deco_state *ds, double pressure, const struct gasmix *ga
|
||||||
double n2_satmult = pn2_oversat > 0 ? buehlmann_config.satmult : buehlmann_config.desatmult;
|
double n2_satmult = pn2_oversat > 0 ? buehlmann_config.satmult : buehlmann_config.desatmult;
|
||||||
double he_satmult = phe_oversat > 0 ? buehlmann_config.satmult : buehlmann_config.desatmult;
|
double he_satmult = phe_oversat > 0 ? buehlmann_config.satmult : buehlmann_config.desatmult;
|
||||||
|
|
||||||
|
// Report ICD if N2 is more on-gasing than He off-gasing in leading tissue
|
||||||
|
if (ci == ds->ci_pointing_to_guiding_tissue && pn2_oversat > 0.0 && phe_oversat < 0.0 &&
|
||||||
|
pn2_oversat * n2_satmult * n2_f + phe_oversat * he_satmult * he_f > 0)
|
||||||
|
icd = true;
|
||||||
|
|
||||||
ds->tissue_n2_sat[ci] += n2_satmult * pn2_oversat * n2_f;
|
ds->tissue_n2_sat[ci] += n2_satmult * pn2_oversat * n2_f;
|
||||||
ds->tissue_he_sat[ci] += he_satmult * phe_oversat * he_f;
|
ds->tissue_he_sat[ci] += he_satmult * phe_oversat * he_f;
|
||||||
ds->tissue_inertgas_saturation[ci] = ds->tissue_n2_sat[ci] + ds->tissue_he_sat[ci];
|
ds->tissue_inertgas_saturation[ci] = ds->tissue_n2_sat[ci] + ds->tissue_he_sat[ci];
|
||||||
|
@ -501,6 +506,7 @@ void add_segment(struct deco_state *ds, double pressure, const struct gasmix *ga
|
||||||
}
|
}
|
||||||
if (decoMode() == VPMB)
|
if (decoMode() == VPMB)
|
||||||
calc_crushing_pressure(ds, pressure);
|
calc_crushing_pressure(ds, pressure);
|
||||||
|
ds->icd_warning = icd;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -896,6 +896,7 @@ struct deco_state {
|
||||||
int ci_pointing_to_guiding_tissue;
|
int ci_pointing_to_guiding_tissue;
|
||||||
double gf_low_pressure_this_dive;
|
double gf_low_pressure_this_dive;
|
||||||
int deco_time;
|
int deco_time;
|
||||||
|
bool icd_warning;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern void add_segment(struct deco_state *ds, double pressure, const struct gasmix *gasmix, int period_in_seconds, int setpoint, const struct dive *dive, int sac);
|
extern void add_segment(struct deco_state *ds, double pressure, const struct gasmix *gasmix, int period_in_seconds, int setpoint, const struct dive *dive, int sac);
|
||||||
|
|
|
@ -1036,7 +1036,8 @@ void calculate_deco_information(struct deco_state *ds, struct deco_state *planne
|
||||||
for (j = t0 + time_stepsize; j <= t1; j += time_stepsize) {
|
for (j = t0 + time_stepsize; j <= t1; j += time_stepsize) {
|
||||||
int depth = interpolate(entry[-1].depth, entry[0].depth, j - t0, t1 - t0);
|
int depth = interpolate(entry[-1].depth, entry[0].depth, j - t0, t1 - t0);
|
||||||
add_segment(ds, depth_to_bar(depth, dive),
|
add_segment(ds, depth_to_bar(depth, dive),
|
||||||
gasmix, time_stepsize, entry->o2pressure.mbar, dive, entry->sac);
|
gasmix, time_stepsize, entry->o2pressure.mbar, dive, entry->sac);
|
||||||
|
entry->icd_warning = ds->icd_warning;
|
||||||
if ((t1 - j < time_stepsize) && (j < t1))
|
if ((t1 - j < time_stepsize) && (j < t1))
|
||||||
time_stepsize = t1 - j;
|
time_stepsize = t1 - j;
|
||||||
}
|
}
|
||||||
|
@ -1498,6 +1499,8 @@ static void plot_string(struct plot_info *pi, struct plot_data *entry, struct me
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (entry->icd_warning)
|
||||||
|
put_format(b, "%s", translate("gettextFromC", "ICD in leading tissue\n"));
|
||||||
if (entry->heartbeat && prefs.hrgraph)
|
if (entry->heartbeat && prefs.hrgraph)
|
||||||
put_format_loc(b, translate("gettextFromC", "heart rate: %d\n"), entry->heartbeat);
|
put_format_loc(b, translate("gettextFromC", "heart rate: %d\n"), entry->heartbeat);
|
||||||
if (entry->bearing >= 0)
|
if (entry->bearing >= 0)
|
||||||
|
|
|
@ -63,6 +63,7 @@ struct plot_data {
|
||||||
double ambpressure;
|
double ambpressure;
|
||||||
double gfline;
|
double gfline;
|
||||||
double density;
|
double density;
|
||||||
|
bool icd_warning;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ev_select {
|
struct ev_select {
|
||||||
|
|
Loading…
Add table
Reference in a new issue