mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Enforce end pressures to be not above starting pressures.
We don't blow into our cylinders under water. Negative pressures should be allowed as they might arise from dive planning without taking care of gas consumption. fixes #644 Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a7eb316b1f
commit
89622b0b51
1 changed files with 2 additions and 2 deletions
|
@ -235,13 +235,13 @@ bool CylindersModel::setData(const QModelIndex &index, const QVariant &value, in
|
|||
}
|
||||
break;
|
||||
case START:
|
||||
if (CHANGED()) {
|
||||
if (CHANGED() && (!cyl->end.mbar || string_to_pressure(vString.toUtf8().data()).mbar >= cyl->end.mbar)) {
|
||||
cyl->start = string_to_pressure(vString.toUtf8().data());
|
||||
changed = true;
|
||||
}
|
||||
break;
|
||||
case END:
|
||||
if (CHANGED()) {
|
||||
if (CHANGED() && (!cyl->start.mbar || string_to_pressure(vString.toUtf8().data()).mbar <= cyl->start.mbar)) {
|
||||
cyl->end = string_to_pressure(vString.toUtf8().data());
|
||||
changed = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue