mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Grab pressures from samples if required
If cylinder does not have start and end pressures assigned, attempt to grab them from the samples instead. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
8c38dbf3b7
commit
8e4b4c788a
1 changed files with 8 additions and 2 deletions
|
@ -38,9 +38,15 @@ static QString getPressures(struct dive *dive, enum returnPressureSelector ret)
|
|||
cylinder_t *cyl = &dive->cylinder[0];
|
||||
QString fmt;
|
||||
if (ret == START_PRESSURE)
|
||||
fmt = get_pressure_string(cyl->start, true);
|
||||
if (cyl->start.mbar)
|
||||
fmt = get_pressure_string(cyl->start, true);
|
||||
else if (cyl->sample_start.mbar)
|
||||
fmt = get_pressure_string(cyl->sample_start, true);
|
||||
if (ret == END_PRESSURE)
|
||||
fmt = get_pressure_string(cyl->end, true);
|
||||
if (cyl->end.mbar)
|
||||
fmt = get_pressure_string(cyl->end, true);
|
||||
else if(cyl->sample_end.mbar)
|
||||
fmt = get_pressure_string(cyl->sample_end, true);
|
||||
return fmt;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue