Don't erroneously mark the cylinder pressure red and set font italic

In the cylinder table today the cylinder start and end pressure fields
are marked red and the end pressure font is set to italic if cyl->end is 0.
But sometimes with planned dives there is no cyl->end but only cyl->sample_end.
This is taken into account now.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
Stefan Fuchs 2017-03-11 07:43:30 +01:00 committed by Dirk Hohndel
parent ab887e4438
commit b8e044dee3

View file

@ -143,7 +143,7 @@ QVariant CylindersModel::data(const QModelIndex &index, int role) const
// seem implausible
case START:
case END:
if ((cyl->start.mbar && !cyl->end.mbar) ||
if ((cyl->start.mbar && !cyl->end.mbar && !cyl->sample_end.mbar) ||
(cyl->end.mbar && cyl->start.mbar <= cyl->end.mbar))
ret = REDORANGE1_HIGH_TRANS;
break;
@ -157,7 +157,7 @@ QVariant CylindersModel::data(const QModelIndex &index, int role) const
font.setItalic(!cyl->start.mbar);
break;
case END:
font.setItalic(!cyl->end.mbar);
font.setItalic(!cyl->end.mbar && !cyl->sample_end.mbar);
break;
}
ret = font;