From d6abb739d927285b55964f0644ee059be5f7db0b Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Mon, 15 Sep 2014 14:55:20 +0200 Subject: Helper function for partial pressure calculation This patch introduces a new structure holding partial pressures (doubles in bar) for all three gases and a helper function to compute them from gasmix (which holds fractions) and ambient pressure. Currentlty this works for OC and CCR, to be extended later to PSCR. Currently the dive_comp_type argument is unused. Signed-off-by: Robert C. Helling Signed-off-by: Dirk Hohndel --- qt-ui/profile/diveplotdatamodel.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'qt-ui/profile/diveplotdatamodel.cpp') diff --git a/qt-ui/profile/diveplotdatamodel.cpp b/qt-ui/profile/diveplotdatamodel.cpp index 4172d0bae..993c09045 100644 --- a/qt-ui/profile/diveplotdatamodel.cpp +++ b/qt-ui/profile/diveplotdatamodel.cpp @@ -47,11 +47,11 @@ QVariant DivePlotDataModel::data(const QModelIndex &index, int role) const case SAC: return item.sac; case PN2: - return item.pn2; + return item.pressures.n2; case PHE: - return item.phe; + return item.pressures.he; case PO2: - return item.po2; + return item.pressures.o2; case HEARTBEAT: return item.heartbeat; } @@ -156,15 +156,15 @@ unsigned int DivePlotDataModel::dcShown() const { \ double ret = -1; \ for (int i = 0, count = rowCount(); i < count; i++) { \ - if (pInfo.entry[i].GAS > ret) \ - ret = pInfo.entry[i].GAS; \ + if (pInfo.entry[i].pressures.GAS > ret) \ + ret = pInfo.entry[i].pressures.GAS; \ } \ return ret; \ } -MAX_PPGAS_FUNC(phe, pheMax); -MAX_PPGAS_FUNC(pn2, pn2Max); -MAX_PPGAS_FUNC(po2, po2Max); +MAX_PPGAS_FUNC(he, pheMax); +MAX_PPGAS_FUNC(n2, pn2Max); +MAX_PPGAS_FUNC(o2, po2Max); void DivePlotDataModel::emitDataChanged() { -- cgit v1.2.3-70-g09d2