diff options
Diffstat (limited to 'qt-ui/profile')
-rw-r--r-- | qt-ui/profile/diveplotdatamodel.cpp | 4 | ||||
-rw-r--r-- | qt-ui/profile/diveplotdatamodel.h | 1 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 11 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.h | 1 |
4 files changed, 17 insertions, 0 deletions
diff --git a/qt-ui/profile/diveplotdatamodel.cpp b/qt-ui/profile/diveplotdatamodel.cpp index c73d7918e..e60dd9ddb 100644 --- a/qt-ui/profile/diveplotdatamodel.cpp +++ b/qt-ui/profile/diveplotdatamodel.cpp @@ -52,6 +52,8 @@ QVariant DivePlotDataModel::data(const QModelIndex &index, int role) const return item.pressures.he; case PO2: return item.pressures.o2; + case O2SETPOINT: + return item.o2setpoint.mbar / 1000.0; case HEARTBEAT: return item.heartbeat; case AMBPRESSURE: @@ -127,6 +129,8 @@ QVariant DivePlotDataModel::headerData(int section, Qt::Orientation orientation, return tr("pHe"); case PO2: return tr("pO₂"); + case O2SETPOINT: + return tr("Setpoint"); case AMBPRESSURE: return tr("Ambient pressure"); case HEARTBEAT: diff --git a/qt-ui/profile/diveplotdatamodel.h b/qt-ui/profile/diveplotdatamodel.h index 91e6a8b30..6fdb5fcdd 100644 --- a/qt-ui/profile/diveplotdatamodel.h +++ b/qt-ui/profile/diveplotdatamodel.h @@ -59,6 +59,7 @@ public: PN2, PHE, PO2, + O2SETPOINT, HEARTBEAT, AMBPRESSURE, GFLINE, diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index f9aa49eff..f986a2c30 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -93,6 +93,7 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent), pn2GasItem(new PartialPressureGasItem()), pheGasItem(new PartialPressureGasItem()), po2GasItem(new PartialPressureGasItem()), + o2SetpointGasItem(new PartialPressureGasItem()), heartBeatAxis(new DiveCartesianAxis()), heartBeatItem(new DiveHeartrateItem()), percentageAxis(new DiveCartesianAxis()), @@ -162,6 +163,7 @@ ProfileWidget2::~ProfileWidget2() delete pn2GasItem; delete pheGasItem; delete po2GasItem; + delete o2SetpointGasItem; delete heartBeatAxis; delete heartBeatItem; delete percentageAxis; @@ -201,6 +203,7 @@ void ProfileWidget2::addItemsToScene() scene()->addItem(pn2GasItem); scene()->addItem(pheGasItem); scene()->addItem(po2GasItem); + scene()->addItem(o2SetpointGasItem); scene()->addItem(percentageAxis); scene()->addItem(heartBeatAxis); scene()->addItem(heartBeatItem); @@ -313,6 +316,7 @@ void ProfileWidget2::setupItemOnScene() CREATE_PP_GAS(pn2GasItem, PN2, PN2, PN2_ALERT, &prefs.pp_graphs.pn2_threshold, "pn2graph"); CREATE_PP_GAS(pheGasItem, PHE, PHE, PHE_ALERT, &prefs.pp_graphs.phe_threshold, "phegraph"); CREATE_PP_GAS(po2GasItem, PO2, PO2, PO2_ALERT, &prefs.pp_graphs.po2_threshold, "po2graph"); + CREATE_PP_GAS(o2SetpointGasItem, O2SETPOINT, PO2_ALERT, PO2_ALERT, &prefs.pp_graphs.po2_threshold, "po2graph"); #undef CREATE_PP_GAS temperatureAxis->setTextVisible(false); @@ -527,6 +531,11 @@ void ProfileWidget2::plotDive(struct dive *d, bool force) currentdc = fake_dc(currentdc); } + if ((current_dc->dctype == CCR) && (prefs.show_ccr_setpoint)) + o2SetpointGasItem->setVisible(true); + else + o2SetpointGasItem->setVisible(false); + /* This struct holds all the data that's about to be plotted. * I'm not sure this is the best approach ( but since we are * interpolating some points of the Dive, maybe it is... ) @@ -883,6 +892,7 @@ void ProfileWidget2::setEmptyState() tankItem->setVisible(false); pn2GasItem->setVisible(false); po2GasItem->setVisible(false); + o2SetpointGasItem->setVisible(false); pheGasItem->setVisible(false); ambPressureItem->setVisible(false); gflineItem->setVisible(false); @@ -981,6 +991,7 @@ void ProfileWidget2::setProfileState() } pn2GasItem->setVisible(prefs.pp_graphs.pn2); po2GasItem->setVisible(prefs.pp_graphs.po2); + o2SetpointGasItem->setVisible(true); pheGasItem->setVisible(prefs.pp_graphs.phe); timeAxis->setPos(itemPos.time.pos.on); diff --git a/qt-ui/profile/profilewidget2.h b/qt-ui/profile/profilewidget2.h index 2de60ccbd..ffeecb3ee 100644 --- a/qt-ui/profile/profilewidget2.h +++ b/qt-ui/profile/profilewidget2.h @@ -174,6 +174,7 @@ private: PartialPressureGasItem *pn2GasItem; PartialPressureGasItem *pheGasItem; PartialPressureGasItem *po2GasItem; + PartialPressureGasItem *o2SetpointGasItem; DiveCartesianAxis *heartBeatAxis; DiveHeartrateItem *heartBeatItem; DiveCartesianAxis *percentageAxis; |