summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/diveplotdatamodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/profile/diveplotdatamodel.cpp')
-rw-r--r--qt-ui/profile/diveplotdatamodel.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/qt-ui/profile/diveplotdatamodel.cpp b/qt-ui/profile/diveplotdatamodel.cpp
index bf4425abc..362eb018b 100644
--- a/qt-ui/profile/diveplotdatamodel.cpp
+++ b/qt-ui/profile/diveplotdatamodel.cpp
@@ -122,3 +122,23 @@ int DivePlotDataModel::id() const
{
return diveId;
}
+
+#define MAX_PPGAS_FUNC( GAS, GASFUNC ) \
+double DivePlotDataModel::GASFUNC() \
+{ \
+ double ret = -1; \
+ for(int i = 0, count = rowCount(); i < count; i++){ \
+ if (plotData[i].GAS > ret) \
+ ret = plotData[i].GAS; \
+ } \
+ return ret; \
+}
+
+MAX_PPGAS_FUNC(phe, pheMax);
+MAX_PPGAS_FUNC(pn2, pn2Max);
+MAX_PPGAS_FUNC(po2, po2Max);
+
+void DivePlotDataModel::emitDataChanged()
+{
+ emit dataChanged(QModelIndex(), QModelIndex());
+}