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
|
|
|
|
|
2016-04-05 05:02:03 +00:00
|
|
|
#include "profile-widget/divelineitem.h"
|
2020-12-23 11:39:07 +00:00
|
|
|
#include "core/gas.h"
|
|
|
|
#include <QGraphicsRectItem>
|
|
|
|
#include <QBrush>
|
|
|
|
|
|
|
|
struct dive;
|
|
|
|
class DiveCartesianAxis;
|
2014-08-15 00:22:27 +00:00
|
|
|
|
2020-12-23 11:26:12 +00:00
|
|
|
class TankItem : public QGraphicsRectItem
|
2014-08-15 00:22:27 +00:00
|
|
|
{
|
|
|
|
public:
|
2021-08-09 14:48:08 +00:00
|
|
|
explicit TankItem(const DiveCartesianAxis &axis, double dpr);
|
2021-10-08 19:28:32 +00:00
|
|
|
void setData(const struct dive *d, int plotStartTime, int plotEndTime);
|
2021-08-28 21:36:09 +00:00
|
|
|
double height() const;
|
2014-08-15 00:22:27 +00:00
|
|
|
|
|
|
|
private:
|
2019-10-27 16:48:04 +00:00
|
|
|
void createBar(int startTime, int stopTime, struct gasmix gas);
|
2020-12-23 11:33:05 +00:00
|
|
|
const DiveCartesianAxis &hAxis;
|
2021-08-09 14:48:08 +00:00
|
|
|
double dpr;
|
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
|