Add helper function to retrieve first gas

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Joakim Bygdell 2016-02-13 18:34:29 +01:00 committed by Dirk Hohndel
parent 6252d0cd3b
commit a01bcd82aa
2 changed files with 9 additions and 0 deletions

View file

@ -292,3 +292,10 @@ QString DiveObjectHelper::endPressure() const
QString endPressure = getPressures(m_dive, END_PRESSURE);
return endPressure;
}
QString DiveObjectHelper::firstGas() const
{
QString gas;
gas = get_gas_string(m_dive->cylinder[0].gasmix);
return gas;
}

View file

@ -37,6 +37,7 @@ class DiveObjectHelper : public QObject {
Q_PROPERTY(QString getCylinder READ getCylinder CONSTANT)
Q_PROPERTY(QString startPressure READ startPressure CONSTANT)
Q_PROPERTY(QString endPressure READ endPressure CONSTANT)
Q_PROPERTY(QString firstGas READ firstGas CONSTANT)
public:
DiveObjectHelper(struct dive *dive = NULL);
~DiveObjectHelper();
@ -72,6 +73,7 @@ public:
QString getCylinder() const;
QString startPressure() const;
QString endPressure() const;
QString firstGas() const;
private:
struct dive *m_dive;