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);
|
2014-12-18 07:47:53 +00:00
|
|
|
~TankItem();
|
2014-08-15 00:22:27 +00:00
|
|
|
void setHorizontalAxis(DiveCartesianAxis *horizontal);
|
|
|
|
void setData(DivePlotDataModel *model, struct plot_info *plotInfo, struct dive *d);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
virtual void modelDataChanged(const QModelIndex &topLeft = QModelIndex(), const QModelIndex &bottomRight = QModelIndex());
|
|
|
|
|
|
|
|
private:
|
2014-08-15 03:40:47 +00:00
|
|
|
void createBar(qreal x, qreal w, struct gasmix *gas);
|
2014-08-15 00:22:27 +00:00
|
|
|
DivePlotDataModel *dataModel;
|
|
|
|
DiveCartesianAxis *hAxis;
|
|
|
|
int hDataColumn;
|
2014-08-23 14:13:37 +00:00
|
|
|
struct dive diveCylinderStore;
|
|
|
|
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
|