2017-04-27 18:26:36 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2014-08-15 00:22:27 +00:00
|
|
|
#ifndef TANKITEM_H
|
|
|
|
#define TANKITEM_H
|
|
|
|
|
|
|
|
#include <QGraphicsItem>
|
|
|
|
#include <QModelIndex>
|
2014-08-15 03:40:47 +00:00
|
|
|
#include <QBrush>
|
2016-04-05 05:02:03 +00:00
|
|
|
#include "profile-widget/divelineitem.h"
|
|
|
|
#include "profile-widget/divecartesianaxis.h"
|
|
|
|
#include "core/dive.h"
|
2014-08-15 00:22:27 +00:00
|
|
|
|
|
|
|
class TankItem : public QObject, public QGraphicsRectItem
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit TankItem(QObject *parent = 0);
|
|
|
|
void setHorizontalAxis(DiveCartesianAxis *horizontal);
|
|
|
|
void setData(DivePlotDataModel *model, struct plot_info *plotInfo, struct dive *d);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
public slots:
|
2018-07-31 05:41:19 +00:00
|
|
|
void modelDataChanged(const QModelIndex &topLeft = QModelIndex(), const QModelIndex &bottomRight = QModelIndex());
|
2014-08-15 00:22:27 +00:00
|
|
|
|
|
|
|
private:
|
2018-08-16 17:10:10 +00:00
|
|
|
void createBar(qreal x, qreal w, struct gasmix gas);
|
2014-08-15 00:22:27 +00:00
|
|
|
DivePlotDataModel *dataModel;
|
|
|
|
DiveCartesianAxis *hAxis;
|
2014-08-23 14:13:37 +00:00
|
|
|
struct plot_data *pInfoEntry;
|
|
|
|
int pInfoNr;
|
2015-06-22 13:42:02 +00:00
|
|
|
qreal height;
|
2015-01-05 19:24:34 +00:00
|
|
|
QBrush air, nitrox, oxygen, trimix;
|
2014-08-15 00:22:27 +00:00
|
|
|
QList<QGraphicsRectItem *> rects;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TANKITEM_H
|