From 1cae362c16ae94a98f4d00e19e1ffb591ecc5761 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 23 Jan 2014 17:59:14 -0200 Subject: [PATCH] Added the code for the PHE gas pressure. Using the PartialPressureGasItem the addition of a new partial plot is very easy. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/diveplotdatamodel.cpp | 2 ++ qt-ui/profile/diveplotdatamodel.h | 2 +- qt-ui/profile/profilewidget2.cpp | 10 ++++++++++ qt-ui/profile/profilewidget2.h | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/qt-ui/profile/diveplotdatamodel.cpp b/qt-ui/profile/diveplotdatamodel.cpp index b523472cf..598391bc5 100644 --- a/qt-ui/profile/diveplotdatamodel.cpp +++ b/qt-ui/profile/diveplotdatamodel.cpp @@ -37,6 +37,7 @@ QVariant DivePlotDataModel::data(const QModelIndex& index, int role) const case CEILING: return item.ceiling; case SAC: return item.sac; case PN2: return item.pn2; + case PHE: return item.phe; } } @@ -83,6 +84,7 @@ QVariant DivePlotDataModel::headerData(int section, Qt::Orientation orientation, case CEILING: return tr("Ceiling"); case SAC: return tr("SAC"); case PN2: return tr("PN2"); + case PHE: return tr("PHE"); } if (role == Qt::DisplayRole && section >= TISSUE_1 && section <= TISSUE_16){ return QString("Ceiling: %1").arg(section - TISSUE_1); diff --git a/qt-ui/profile/diveplotdatamodel.h b/qt-ui/profile/diveplotdatamodel.h index 3116bcdfe..4e5897d95 100644 --- a/qt-ui/profile/diveplotdatamodel.h +++ b/qt-ui/profile/diveplotdatamodel.h @@ -12,7 +12,7 @@ Q_OBJECT public: enum {DEPTH, TIME, PRESSURE, TEMPERATURE, USERENTERED, COLOR, CYLINDERINDEX, SENSOR_PRESSURE, INTERPOLATED_PRESSURE, SAC, CEILING, TISSUE_1,TISSUE_2,TISSUE_3,TISSUE_4,TISSUE_5,TISSUE_6,TISSUE_7,TISSUE_8,TISSUE_9,TISSUE_10, - TISSUE_11,TISSUE_12,TISSUE_13,TISSUE_14,TISSUE_15,TISSUE_16, PN2,COLUMNS}; + TISSUE_11,TISSUE_12,TISSUE_13,TISSUE_14,TISSUE_15,TISSUE_16, PN2,PHE,COLUMNS}; explicit DivePlotDataModel(QObject* parent = 0); virtual int columnCount(const QModelIndex& parent = QModelIndex()) const; virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 6041bac89..8397dcb41 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -180,6 +180,16 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : pn2GasItem->setThreshouldSettingsKey("pn2threshold"); scene()->addItem(pn2GasItem); + pheGasItem = new PartialPressureGasItem(); + pheGasItem->setHorizontalAxis(timeAxis); + pheGasItem->setVerticalAxis(gasYAxis); + pheGasItem->setModel(dataModel); + pheGasItem->setVerticalDataColumn(DivePlotDataModel::PHE); + pheGasItem->setHorizontalDataColumn(DivePlotDataModel::TIME); + pheGasItem->setZValue(0); + pheGasItem->setThreshouldSettingsKey("phethreshold"); + scene()->addItem(pheGasItem); + background->setFlag(QGraphicsItem::ItemIgnoresTransformations); //enum State{ EMPTY, PROFILE, EDIT, ADD, PLAN, INVALID }; diff --git a/qt-ui/profile/profilewidget2.h b/qt-ui/profile/profilewidget2.h index 5b3821e43..eaed477f7 100644 --- a/qt-ui/profile/profilewidget2.h +++ b/qt-ui/profile/profilewidget2.h @@ -93,6 +93,7 @@ private: QList allTissues; DiveReportedCeiling *reportedCeiling; PartialPressureGasItem *pn2GasItem; + PartialPressureGasItem *pheGasItem; }; #endif