subsurface/profile-widget/diveeventitem.h
Michael Keller 07898f277c Profile: Improve Display of Bailout / Loop Events.
For dives in CCR mode, show 'bailout' and 'on loop' events whenever a
gas switch from a diluent gas to a bailout gas and vice versa happens.

Signed-off-by: Michael Keller <github@ike.ch>
2024-12-29 23:22:47 +13:00

40 lines
1.4 KiB
C++

// SPDX-License-Identifier: GPL-2.0
#ifndef DIVEEVENTITEM_H
#define DIVEEVENTITEM_H
#include "divepixmapitem.h"
#include "core/event.h"
class DiveCartesianAxis;
struct DivePixmaps;
struct event;
struct plot_info;
class DiveEventItem : public DivePixmapItem {
Q_OBJECT
public:
DiveEventItem(const struct dive *d, const struct divecomputer *dc, int idx, const struct event &ev, const struct gasmix lastgasmix, divemode_t lastdivemode,
const struct plot_info &pi, DiveCartesianAxis *hAxis, DiveCartesianAxis *vAxis,
int speed, const DivePixmaps &pixmaps, QGraphicsItem *parent = nullptr);
~DiveEventItem();
void eventVisibilityChanged(const QString &eventName, bool visible);
void setVerticalAxis(DiveCartesianAxis *axis, int speed);
void setHorizontalAxis(DiveCartesianAxis *axis);
static bool isInteresting(const struct dive *d, const struct divecomputer *dc,
const struct event &ev, const struct plot_info &pi,
int firstSecond, int lastSecond);
private:
void setupToolTipString(struct gasmix lastgasmix, divemode_t lastdivemode, const struct divecomputer &dc);
void setupPixmap(struct gasmix lastgasmix, divemode_t lastdivemode, const struct divecomputer &dc, const DivePixmaps &pixmaps);
void recalculatePos();
DiveCartesianAxis *vAxis;
DiveCartesianAxis *hAxis;
public:
int idx;
struct event ev;
const struct dive *dive;
int depth;
};
#endif // DIVEEVENTITEM_H