mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Core: Fix bug salinity and pressure values in mbar <-> depth conversion
The conversion between mbar and depth sometimes uses DC's salinity, sometimes user's salinity. By other hand, it uses surface pressure given by user in calculation. This fix try to standartize this values, using them from same source. Signed-off-by: Rafael M. Salvioni <rafael.salvioni@gmail.com>
This commit is contained in:
parent
1e082affdd
commit
695c37499a
5 changed files with 9878 additions and 9852 deletions
|
|
@ -695,9 +695,20 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i
|
|||
|
||||
set_gf(diveplan->gflow, diveplan->gfhigh);
|
||||
set_vpmb_conservatism(diveplan->vpmb_conservatism);
|
||||
if (!diveplan->surface_pressure)
|
||||
diveplan->surface_pressure = SURFACE_PRESSURE;
|
||||
dive->surface_pressure.mbar = diveplan->surface_pressure;
|
||||
|
||||
if (!diveplan->surface_pressure) {
|
||||
// Lets use dive's surface pressure in planner, if have one...
|
||||
if (dive->dc.surface_pressure.mbar) { // First from DC...
|
||||
diveplan->surface_pressure = dive->dc.surface_pressure.mbar;
|
||||
}
|
||||
else if (dive->surface_pressure.mbar) { // After from user...
|
||||
diveplan->surface_pressure = dive->surface_pressure.mbar;
|
||||
}
|
||||
else {
|
||||
diveplan->surface_pressure = SURFACE_PRESSURE;
|
||||
}
|
||||
}
|
||||
|
||||
clear_deco(ds, dive->surface_pressure.mbar / 1000.0, true);
|
||||
ds->max_bottom_ceiling_pressure.mbar = ds->first_ceiling_pressure.mbar = 0;
|
||||
create_dive_from_plan(diveplan, dive, is_planner);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue