summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2014-01-23 18:03:28 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-23 21:11:15 -0800
commitb5e8ef160aa2320f4d2af51e68023580647da252 (patch)
tree6746ea3f9284c89c4a922d57a8e49f8ed6bdc700
parent1cae362c16ae94a98f4d00e19e1ffb591ecc5761 (diff)
downloadsubsurface-b5e8ef160aa2320f4d2af51e68023580647da252.tar.gz
Added the Po2 Partial Pressure Graph.
Important to note that no Partial Pressure Graph handles settings yet. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/profile/diveplotdatamodel.cpp2
-rw-r--r--qt-ui/profile/diveplotdatamodel.h2
-rw-r--r--qt-ui/profile/profilewidget2.cpp10
-rw-r--r--qt-ui/profile/profilewidget2.h1
4 files changed, 14 insertions, 1 deletions
diff --git a/qt-ui/profile/diveplotdatamodel.cpp b/qt-ui/profile/diveplotdatamodel.cpp
index 598391bc5..bf4425abc 100644
--- a/qt-ui/profile/diveplotdatamodel.cpp
+++ b/qt-ui/profile/diveplotdatamodel.cpp
@@ -38,6 +38,7 @@ QVariant DivePlotDataModel::data(const QModelIndex& index, int role) const
case SAC: return item.sac;
case PN2: return item.pn2;
case PHE: return item.phe;
+ case PO2: return item.po2;
}
}
@@ -85,6 +86,7 @@ QVariant DivePlotDataModel::headerData(int section, Qt::Orientation orientation,
case SAC: return tr("SAC");
case PN2: return tr("PN2");
case PHE: return tr("PHE");
+ case PO2: return tr("PO2");
}
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 4e5897d95..c5ed17581 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,PHE,COLUMNS};
+ TISSUE_11,TISSUE_12,TISSUE_13,TISSUE_14,TISSUE_15,TISSUE_16, PN2,PHE,PO2,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 8397dcb41..a39dbadd7 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -190,6 +190,16 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) :
pheGasItem->setThreshouldSettingsKey("phethreshold");
scene()->addItem(pheGasItem);
+ pheGasItem = new PartialPressureGasItem();
+ pheGasItem->setHorizontalAxis(timeAxis);
+ pheGasItem->setVerticalAxis(gasYAxis);
+ pheGasItem->setModel(dataModel);
+ pheGasItem->setVerticalDataColumn(DivePlotDataModel::PO2);
+ pheGasItem->setHorizontalDataColumn(DivePlotDataModel::TIME);
+ pheGasItem->setZValue(0);
+ pheGasItem->setThreshouldSettingsKey("po2threshold");
+ 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 eaed477f7..41819017f 100644
--- a/qt-ui/profile/profilewidget2.h
+++ b/qt-ui/profile/profilewidget2.h
@@ -94,6 +94,7 @@ private:
DiveReportedCeiling *reportedCeiling;
PartialPressureGasItem *pn2GasItem;
PartialPressureGasItem *pheGasItem;
+ PartialPressureGasItem *po2GasItem;
};
#endif