Include surface GF in infobox

The most recent firmware of Shearwater computers shows this.

This is a measure of absolute amout of tissue loadings in an
easy to digest unit. Therefore it is useful to have.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
Robert C. Helling 2019-01-23 16:46:45 +01:00
parent 7538546c89
commit 4c048ed526
3 changed files with 9 additions and 0 deletions

View file

@ -1,6 +1,7 @@
- Desktop: remove support for the "Share on Facebook" feature. - Desktop: remove support for the "Share on Facebook" feature.
Rationale: It is fairly easy to share images on Facebook, thus it was decided Rationale: It is fairly easy to share images on Facebook, thus it was decided
that this feature is redundant and should be removed from Subsurface. that this feature is redundant and should be removed from Subsurface.
- Show surface gradient factor in infobox
- Planner: Add UI element for bailout planning for rebreather dives - Planner: Add UI element for bailout planning for rebreather dives
- Allow to filter for logged/planned dives - Allow to filter for logged/planned dives
- New LaTeX export option - New LaTeX export option

View file

@ -1092,12 +1092,17 @@ void calculate_deco_information(struct deco_state *ds, const struct deco_state *
time_clear_ceiling = t1; time_clear_ceiling = t1;
} }
} }
entry->surface_gf = 0.0;
for (j = 0; j < 16; j++) { for (j = 0; j < 16; j++) {
double m_value = ds->buehlmann_inertgas_a[j] + entry->ambpressure / ds->buehlmann_inertgas_b[j]; double m_value = ds->buehlmann_inertgas_a[j] + entry->ambpressure / ds->buehlmann_inertgas_b[j];
double surface_m_value = ds->buehlmann_inertgas_a[j] + surface_pressure / ds->buehlmann_inertgas_b[j];
entry->ceilings[j] = deco_allowed_depth(ds->tolerated_by_tissue[j], surface_pressure, dive, 1); entry->ceilings[j] = deco_allowed_depth(ds->tolerated_by_tissue[j], surface_pressure, dive, 1);
entry->percentages[j] = ds->tissue_inertgas_saturation[j] < entry->ambpressure ? entry->percentages[j] = ds->tissue_inertgas_saturation[j] < entry->ambpressure ?
lrint(ds->tissue_inertgas_saturation[j] / entry->ambpressure * AMB_PERCENTAGE) : lrint(ds->tissue_inertgas_saturation[j] / entry->ambpressure * AMB_PERCENTAGE) :
lrint(AMB_PERCENTAGE + (ds->tissue_inertgas_saturation[j] - entry->ambpressure) / (m_value - entry->ambpressure) * (100.0 - AMB_PERCENTAGE)); lrint(AMB_PERCENTAGE + (ds->tissue_inertgas_saturation[j] - entry->ambpressure) / (m_value - entry->ambpressure) * (100.0 - AMB_PERCENTAGE));
double surface_gf = 100.0 * (ds->tissue_inertgas_saturation[j] - surface_pressure) / (surface_m_value - surface_pressure);
if (surface_gf > entry->surface_gf)
entry->surface_gf = surface_gf;
} }
/* should we do more calculations? /* should we do more calculations?
@ -1499,6 +1504,8 @@ static void plot_string(struct plot_info *pi, struct plot_data *entry, struct me
} }
if (entry->rbt) if (entry->rbt)
put_format_loc(b, translate("gettextFromC", "RBT: %umin\n"), DIV_UP(entry->rbt, 60)); put_format_loc(b, translate("gettextFromC", "RBT: %umin\n"), DIV_UP(entry->rbt, 60));
if (entry->surface_gf > 0)
put_format(b, translate("gettextFromC", "Surface GF %.0f%%\n"), entry->surface_gf);
if (entry->ceiling) { if (entry->ceiling) {
depthvalue = get_depth_units(entry->ceiling, NULL, &depth_unit); depthvalue = get_depth_units(entry->ceiling, NULL, &depth_unit);
put_format_loc(b, translate("gettextFromC", "Calculated ceiling %.0f%s\n"), depthvalue, depth_unit); put_format_loc(b, translate("gettextFromC", "Calculated ceiling %.0f%s\n"), depthvalue, depth_unit);

View file

@ -63,6 +63,7 @@ struct plot_data {
int bearing; int bearing;
double ambpressure; double ambpressure;
double gfline; double gfline;
double surface_gf;
double density; double density;
bool icd_warning; bool icd_warning;
}; };