diff options
-rw-r--r-- | qt-models/diveplannermodel.cpp | 20 | ||||
-rw-r--r-- | qt-models/diveplannermodel.h | 7 |
2 files changed, 27 insertions, 0 deletions
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index c19f9bc68..d3f9c4c6c 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -520,30 +520,50 @@ void DivePlannerPointsModel::setAscrate75(int rate) qPrefDivePlanner::set_ascrate75(lrint(rate * UNIT_FACTOR)); emitDataChanged(); } +int DivePlannerPointsModel::ascrate75Display() +{ + return lrint((float)prefs.ascrate75 / UNIT_FACTOR); +} void DivePlannerPointsModel::setAscrate50(int rate) { qPrefDivePlanner::set_ascrate50(lrint(rate * UNIT_FACTOR)); emitDataChanged(); } +int DivePlannerPointsModel::ascrate50Display() +{ + return lrint((float)prefs.ascrate50 / UNIT_FACTOR); +} void DivePlannerPointsModel::setAscratestops(int rate) { qPrefDivePlanner::set_ascratestops(lrint(rate * UNIT_FACTOR)); emitDataChanged(); } +int DivePlannerPointsModel::ascratestopsDisplay() +{ + return lrint((float)prefs.ascratestops / UNIT_FACTOR); +} void DivePlannerPointsModel::setAscratelast6m(int rate) { qPrefDivePlanner::set_ascratelast6m(lrint(rate * UNIT_FACTOR)); emitDataChanged(); } +int DivePlannerPointsModel::ascratelast6mDisplay() +{ + return lrint((float)prefs.ascratelast6m / UNIT_FACTOR); +} void DivePlannerPointsModel::setDescrate(int rate) { qPrefDivePlanner::set_descrate(lrint(rate * UNIT_FACTOR)); emitDataChanged(); } +int DivePlannerPointsModel::descrateDisplay() +{ + return lrint((float)prefs.descrate / UNIT_FACTOR); +} void DivePlannerPointsModel::setVerbatim(bool value) { diff --git a/qt-models/diveplannermodel.h b/qt-models/diveplannermodel.h index 2a2aaa64d..88cca5879 100644 --- a/qt-models/diveplannermodel.h +++ b/qt-models/diveplannermodel.h @@ -47,6 +47,13 @@ public: bool tankInUse(int cylinderid); void setupCylinders(); bool updateMaxDepth(); + + int ascrate75Display(); + int ascrate50Display(); + int ascratestopsDisplay(); + int ascratelast6mDisplay(); + int descrateDisplay(); + /** * @return the row number. */ |