profile: remove DiveGFLineItem

This was replaced by the tissue map in 893bea700c.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-05-08 09:46:09 +02:00 committed by Robert C. Helling
parent fd3ebf9b62
commit 8b0db14f64
6 changed files with 0 additions and 60 deletions

View file

@ -349,47 +349,6 @@ void DiveAmbPressureItem::paint(QPainter *painter, const QStyleOptionGraphicsIte
connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::percentagegraphChanged, this, &DiveAmbPressureItem::setVisible); connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::percentagegraphChanged, this, &DiveAmbPressureItem::setVisible);
} }
DiveGFLineItem::DiveGFLineItem(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(::GF_LINE)));
pen.setCosmetic(true);
pen.setWidth(2);
setPen(pen);
}
void DiveGFLineItem::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 DiveGFLineItem::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) : DiveTemperatureItem::DiveTemperatureItem(const DivePlotDataModel &model, const DiveCartesianAxis &hAxis, int hColumn, const DiveCartesianAxis &vAxis, int vColumn) :
AbstractProfilePolygonItem(model, hAxis, hColumn, vAxis, vColumn) AbstractProfilePolygonItem(model, hAxis, hColumn, vAxis, vColumn)
{ {

View file

@ -131,17 +131,6 @@ private:
QString visibilityKey; QString visibilityKey;
}; };
class DiveGFLineItem : public AbstractProfilePolygonItem {
Q_OBJECT
public:
DiveGFLineItem(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 { class DiveGasPressureItem : public AbstractProfilePolygonItem {
Q_OBJECT Q_OBJECT

View file

@ -135,7 +135,6 @@ ProfileWidget2::ProfileWidget2(DivePlannerPointsModel *plannerModelIn, QWidget *
heartBeatItem(createItem<DiveHeartrateItem>(*heartBeatAxis, DivePlotDataModel::HEARTBEAT, 1)), heartBeatItem(createItem<DiveHeartrateItem>(*heartBeatAxis, DivePlotDataModel::HEARTBEAT, 1)),
percentageAxis(new DiveCartesianAxis(this)), percentageAxis(new DiveCartesianAxis(this)),
ambPressureItem(createItem<DiveAmbPressureItem>(*percentageAxis, DivePlotDataModel::AMBPRESSURE, 1)), ambPressureItem(createItem<DiveAmbPressureItem>(*percentageAxis, DivePlotDataModel::AMBPRESSURE, 1)),
gflineItem(createItem<DiveGFLineItem>(*percentageAxis, DivePlotDataModel::GFLINE, 1)),
mouseFollowerVertical(new DiveLineItem()), mouseFollowerVertical(new DiveLineItem()),
mouseFollowerHorizontal(new DiveLineItem()), mouseFollowerHorizontal(new DiveLineItem()),
rulerItem(new RulerItem2()), rulerItem(new RulerItem2()),
@ -1076,7 +1075,6 @@ void ProfileWidget2::setEmptyState()
toolTipItem->setVisible(false); toolTipItem->setVisible(false);
rulerItem->setVisible(false); rulerItem->setVisible(false);
ambPressureItem->setVisible(false); ambPressureItem->setVisible(false);
gflineItem->setVisible(false);
mouseFollowerHorizontal->setVisible(false); mouseFollowerHorizontal->setVisible(false);
mouseFollowerVertical->setVisible(false); mouseFollowerVertical->setVisible(false);
heartBeatAxis->setVisible(false); heartBeatAxis->setVisible(false);

View file

@ -224,7 +224,6 @@ private:
DiveCartesianAxis *percentageAxis; DiveCartesianAxis *percentageAxis;
QList<DivePercentageItem *> allPercentages; QList<DivePercentageItem *> allPercentages;
DiveAmbPressureItem *ambPressureItem; DiveAmbPressureItem *ambPressureItem;
DiveGFLineItem *gflineItem;
DiveLineItem *mouseFollowerVertical; DiveLineItem *mouseFollowerVertical;
DiveLineItem *mouseFollowerHorizontal; DiveLineItem *mouseFollowerHorizontal;
RulerItem2 *rulerItem; RulerItem2 *rulerItem;

View file

@ -71,8 +71,6 @@ QVariant DivePlotDataModel::data(const QModelIndex &index, int role) const
return item.heartbeat; return item.heartbeat;
case AMBPRESSURE: case AMBPRESSURE:
return AMB_PERCENTAGE; return AMB_PERCENTAGE;
case GFLINE:
return item.gfline;
case INSTANT_MEANDEPTH: case INSTANT_MEANDEPTH:
return item.running_sum; return item.running_sum;
} }
@ -152,8 +150,6 @@ QVariant DivePlotDataModel::headerData(int section, Qt::Orientation orientation,
return tr("Ambient pressure"); return tr("Ambient pressure");
case HEARTBEAT: case HEARTBEAT:
return tr("Heart rate"); return tr("Heart rate");
case GFLINE:
return tr("Gradient factor");
case INSTANT_MEANDEPTH: case INSTANT_MEANDEPTH:
return tr("Mean depth @ s"); return tr("Mean depth @ s");
} }

View file

@ -68,7 +68,6 @@ public:
SCR_OC_PO2, SCR_OC_PO2,
HEARTBEAT, HEARTBEAT,
AMBPRESSURE, AMBPRESSURE,
GFLINE,
INSTANT_MEANDEPTH, INSTANT_MEANDEPTH,
COLUMNS COLUMNS
}; };