diff options
-rw-r--r-- | core/color.cpp | 3 | ||||
-rw-r--r-- | core/color.h | 3 | ||||
-rw-r--r-- | profile-widget/diveprofileitem.cpp | 43 | ||||
-rw-r--r-- | profile-widget/diveprofileitem.h | 11 | ||||
-rw-r--r-- | profile-widget/profilewidget2.cpp | 2 | ||||
-rw-r--r-- | profile-widget/profilewidget2.h | 1 | ||||
-rw-r--r-- | qt-models/diveplotdatamodel.cpp | 4 | ||||
-rw-r--r-- | qt-models/diveplotdatamodel.h | 1 |
8 files changed, 3 insertions, 65 deletions
diff --git a/core/color.cpp b/core/color.cpp index 35d0423a2..03e1b6806 100644 --- a/core/color.cpp +++ b/core/color.cpp @@ -65,8 +65,7 @@ static QMap<color_index_t, std::array<QColor, 2>> profile_color = { { CALC_CEILING_SHALLOW, {{ FUNGREEN1_HIGH_TRANS, BLACK1_HIGH_TRANS }} }, { CALC_CEILING_DEEP, {{ APPLE1_HIGH_TRANS, BLACK1_HIGH_TRANS }} }, { TISSUE_PERCENTAGE, {{ GOVERNORBAY2, BLACK1_LOW_TRANS }} }, - { GF_LINE, {{ BLACK1, BLACK1_LOW_TRANS }} }, - { AMB_PRESSURE_LINE, {{ TUNDORA1_MED_TRANS, BLACK1_LOW_TRANS }} } + { GF_LINE, {{ BLACK1, BLACK1_LOW_TRANS }} } }; QColor getColor(const color_index_t i, bool isGrayscale) diff --git a/core/color.h b/core/color.h index 12dcb1497..21f2bfff0 100644 --- a/core/color.h +++ b/core/color.h @@ -135,8 +135,7 @@ typedef enum { CALC_CEILING_SHALLOW, CALC_CEILING_DEEP, TISSUE_PERCENTAGE, - GF_LINE, - AMB_PRESSURE_LINE + GF_LINE } color_index_t; QColor getColor(const color_index_t i, bool isGrayscale = false); diff --git a/profile-widget/diveprofileitem.cpp b/profile-widget/diveprofileitem.cpp index 776fafcc9..621674b8f 100644 --- a/profile-widget/diveprofileitem.cpp +++ b/profile-widget/diveprofileitem.cpp @@ -308,47 +308,6 @@ void DivePercentageItem::paint(QPainter *painter, const QStyleOptionGraphicsItem painter->restore(); } -DiveAmbPressureItem::DiveAmbPressureItem(const DivePlotDataModel &model, const DiveCartesianAxis &hAxis, int hColumn, const DiveCartesianAxis &vAxis, int vColumn) : - AbstractProfilePolygonItem(model, hAxis, hColumn, vAxis, vColumn) -{ - QPen pen; - pen.setBrush(QBrush(getColor(::AMB_PRESSURE_LINE))); - pen.setCosmetic(true); - pen.setWidth(2); - setPen(pen); -} - -void DiveAmbPressureItem::replot(const dive *, bool) -{ - int sec = 0; - - // Ignore empty values. a heart rate of 0 would be a bad sign. - QPolygonF poly; - for (int i = 0, modelDataCount = dataModel.rowCount(); i < modelDataCount; i++) { - int hr = dataModel.index(i, vDataColumn).data().toInt(); - if (!hr) - continue; - sec = dataModel.index(i, hDataColumn).data().toInt(); - QPointF point(hAxis.posAtValue(sec), vAxis.posAtValue(hr)); - poly.append(point); - } - setPolygon(poly); - - if (texts.count()) - texts.last()->setAlignment(Qt::AlignLeft | Qt::AlignBottom); -} - -void DiveAmbPressureItem::paint(QPainter *painter, const QStyleOptionGraphicsItem*, QWidget*) -{ - if (polygon().isEmpty()) - return; - painter->save(); - painter->setPen(pen()); - painter->drawPolyline(polygon()); - painter->restore(); - connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::percentagegraphChanged, this, &DiveAmbPressureItem::setVisible); -} - DiveTemperatureItem::DiveTemperatureItem(const DivePlotDataModel &model, const DiveCartesianAxis &hAxis, int hColumn, const DiveCartesianAxis &vAxis, int vColumn) : AbstractProfilePolygonItem(model, hAxis, hColumn, vAxis, vColumn) { @@ -466,7 +425,7 @@ void DiveMeanDepthItem::paint(QPainter *painter, const QStyleOptionGraphicsItem* painter->setPen(pen()); painter->drawPolyline(polygon()); painter->restore(); - connect(qPrefLog::instance(), &qPrefLog::show_average_depthChanged, this, &DiveAmbPressureItem::setVisible); + connect(qPrefLog::instance(), &qPrefLog::show_average_depthChanged, this, &DiveMeanDepthItem::setVisible); } void DiveMeanDepthItem::createTextItem() diff --git a/profile-widget/diveprofileitem.h b/profile-widget/diveprofileitem.h index ea86761bd..81452b66e 100644 --- a/profile-widget/diveprofileitem.h +++ b/profile-widget/diveprofileitem.h @@ -120,17 +120,6 @@ private: }; -class DiveAmbPressureItem : public AbstractProfilePolygonItem { - Q_OBJECT -public: - DiveAmbPressureItem(const DivePlotDataModel &model, const DiveCartesianAxis &hAxis, int hColumn, const DiveCartesianAxis &vAxis, int vColumn); - void replot(const dive *d, bool in_planner) override; - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override; - -private: - QString visibilityKey; -}; - class DiveGasPressureItem : public AbstractProfilePolygonItem { Q_OBJECT diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index fc49d5a65..2e50b5d08 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -134,7 +134,6 @@ ProfileWidget2::ProfileWidget2(DivePlannerPointsModel *plannerModelIn, QWidget * heartBeatAxis(new DiveCartesianAxis(this)), heartBeatItem(createItem<DiveHeartrateItem>(*heartBeatAxis, DivePlotDataModel::HEARTBEAT, 1)), percentageAxis(new DiveCartesianAxis(this)), - ambPressureItem(createItem<DiveAmbPressureItem>(*percentageAxis, DivePlotDataModel::AMBPRESSURE, 1)), mouseFollowerVertical(new DiveLineItem()), mouseFollowerHorizontal(new DiveLineItem()), rulerItem(new RulerItem2()), @@ -1074,7 +1073,6 @@ void ProfileWidget2::setEmptyState() toolTipItem->clearPlotInfo(); toolTipItem->setVisible(false); rulerItem->setVisible(false); - ambPressureItem->setVisible(false); mouseFollowerHorizontal->setVisible(false); mouseFollowerVertical->setVisible(false); heartBeatAxis->setVisible(false); diff --git a/profile-widget/profilewidget2.h b/profile-widget/profilewidget2.h index 4bdf4ea62..b4d60f7a2 100644 --- a/profile-widget/profilewidget2.h +++ b/profile-widget/profilewidget2.h @@ -223,7 +223,6 @@ private: DiveHeartrateItem *heartBeatItem; DiveCartesianAxis *percentageAxis; QList<DivePercentageItem *> allPercentages; - DiveAmbPressureItem *ambPressureItem; DiveLineItem *mouseFollowerVertical; DiveLineItem *mouseFollowerHorizontal; RulerItem2 *rulerItem; diff --git a/qt-models/diveplotdatamodel.cpp b/qt-models/diveplotdatamodel.cpp index a7eabdf94..ea92a490d 100644 --- a/qt-models/diveplotdatamodel.cpp +++ b/qt-models/diveplotdatamodel.cpp @@ -69,8 +69,6 @@ QVariant DivePlotDataModel::data(const QModelIndex &index, int role) const return item.scr_OC_pO2.mbar / 1000.0; case HEARTBEAT: return item.heartbeat; - case AMBPRESSURE: - return AMB_PERCENTAGE; case INSTANT_MEANDEPTH: return item.running_sum; } @@ -146,8 +144,6 @@ QVariant DivePlotDataModel::headerData(int section, Qt::Orientation orientation, return tr("Sensor 2"); case CCRSENSOR3: return tr("Sensor 3"); - case AMBPRESSURE: - return tr("Ambient pressure"); case HEARTBEAT: return tr("Heart rate"); case INSTANT_MEANDEPTH: diff --git a/qt-models/diveplotdatamodel.h b/qt-models/diveplotdatamodel.h index 1661e40d6..f2222c84c 100644 --- a/qt-models/diveplotdatamodel.h +++ b/qt-models/diveplotdatamodel.h @@ -67,7 +67,6 @@ public: CCRSENSOR3, SCR_OC_PO2, HEARTBEAT, - AMBPRESSURE, INSTANT_MEANDEPTH, COLUMNS }; |