2017-04-27 18:26:05 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2013-06-20 15:33:26 +00:00
|
|
|
#ifndef DIVEPLANNER_H
|
|
|
|
#define DIVEPLANNER_H
|
|
|
|
|
|
|
|
#include <QGraphicsPathItem>
|
2013-08-26 12:14:19 +00:00
|
|
|
#include <QAbstractTableModel>
|
2014-11-04 11:15:27 +00:00
|
|
|
#include <QAbstractButton>
|
2014-06-28 15:07:28 +00:00
|
|
|
#include <QDateTime>
|
2015-07-03 21:07:58 +00:00
|
|
|
#include <QSignalMapper>
|
2013-08-26 16:18:21 +00:00
|
|
|
|
2013-08-26 11:43:37 +00:00
|
|
|
|
2013-07-21 16:54:21 +00:00
|
|
|
class QListView;
|
|
|
|
class QModelIndex;
|
2015-05-28 19:23:49 +00:00
|
|
|
class DivePlannerPointsModel;
|
2013-08-26 12:14:19 +00:00
|
|
|
|
2014-02-28 04:09:57 +00:00
|
|
|
class DiveHandler : public QObject, public QGraphicsEllipseItem {
|
|
|
|
Q_OBJECT
|
2013-06-20 17:29:32 +00:00
|
|
|
public:
|
2013-06-23 20:09:29 +00:00
|
|
|
DiveHandler();
|
2014-02-28 04:09:57 +00:00
|
|
|
|
2013-07-04 14:01:59 +00:00
|
|
|
protected:
|
2014-02-28 04:09:57 +00:00
|
|
|
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
|
2014-05-23 23:51:30 +00:00
|
|
|
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
|
2014-06-30 22:08:16 +00:00
|
|
|
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
|
|
|
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
2014-05-23 22:50:09 +00:00
|
|
|
signals:
|
|
|
|
void moved();
|
2014-06-30 22:08:16 +00:00
|
|
|
void clicked();
|
|
|
|
void released();
|
2013-11-19 22:42:05 +00:00
|
|
|
private:
|
|
|
|
int parentIndex();
|
2014-02-28 04:09:57 +00:00
|
|
|
public
|
|
|
|
slots:
|
2013-11-15 01:29:36 +00:00
|
|
|
void selfRemove();
|
2013-11-19 22:42:05 +00:00
|
|
|
void changeGas();
|
2015-01-18 16:34:00 +00:00
|
|
|
private:
|
|
|
|
QTime t;
|
2013-06-20 17:29:32 +00:00
|
|
|
};
|
2013-06-20 18:52:27 +00:00
|
|
|
|
2013-10-05 07:29:09 +00:00
|
|
|
#include "ui_diveplanner.h"
|
|
|
|
|
2013-08-26 11:43:37 +00:00
|
|
|
class DivePlannerWidget : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2014-02-28 04:09:57 +00:00
|
|
|
explicit DivePlannerWidget(QWidget *parent = 0, Qt::WindowFlags f = 0);
|
2014-11-04 11:15:27 +00:00
|
|
|
void setReplanButton(bool replan);
|
2014-02-28 04:09:57 +00:00
|
|
|
public
|
|
|
|
slots:
|
2014-06-28 15:07:28 +00:00
|
|
|
void setupStartTime(QDateTime startTime);
|
2013-12-09 06:43:00 +00:00
|
|
|
void settingsChanged();
|
2014-06-26 15:04:39 +00:00
|
|
|
void atmPressureChanged(const int pressure);
|
|
|
|
void heightChanged(const int height);
|
2018-02-10 22:28:05 +00:00
|
|
|
void waterTypeChanged(const int index);
|
|
|
|
void customSalinityChanged(double density);
|
2014-06-03 08:06:18 +00:00
|
|
|
void printDecoPlan();
|
2016-12-15 22:02:32 +00:00
|
|
|
void setSurfacePressure(int surface_pressure);
|
|
|
|
void setSalinity(int salinity);
|
2013-08-26 11:43:37 +00:00
|
|
|
private:
|
2013-10-03 18:54:25 +00:00
|
|
|
Ui::DivePlanner ui;
|
2014-11-04 11:15:27 +00:00
|
|
|
QAbstractButton *replanButton;
|
2018-02-10 22:28:05 +00:00
|
|
|
void waterTypeUpdateTexts();
|
2013-08-26 11:43:37 +00:00
|
|
|
};
|
|
|
|
|
2014-06-10 15:40:02 +00:00
|
|
|
#include "ui_plannerSettings.h"
|
|
|
|
|
|
|
|
class PlannerSettingsWidget : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit PlannerSettingsWidget(QWidget *parent = 0, Qt::WindowFlags f = 0);
|
2018-07-31 05:41:19 +00:00
|
|
|
~PlannerSettingsWidget();
|
2014-06-10 15:40:02 +00:00
|
|
|
public
|
|
|
|
slots:
|
|
|
|
void settingsChanged();
|
2014-08-19 16:13:55 +00:00
|
|
|
void bottomSacChanged(const double bottomSac);
|
|
|
|
void decoSacChanged(const double decosac);
|
2014-06-10 15:40:02 +00:00
|
|
|
void printDecoPlan();
|
2017-10-03 08:06:15 +00:00
|
|
|
void setAscrate75(int rate);
|
|
|
|
void setAscrate50(int rate);
|
|
|
|
void setAscratestops(int rate);
|
|
|
|
void setAscratelast6m(int rate);
|
|
|
|
void setDescrate(int rate);
|
2017-02-11 19:24:18 +00:00
|
|
|
void sacFactorChanged(const double factor);
|
|
|
|
void problemSolvingTimeChanged(const int min);
|
2014-06-25 12:00:03 +00:00
|
|
|
void setBottomPo2(double po2);
|
|
|
|
void setDecoPo2(double po2);
|
2016-05-21 10:14:23 +00:00
|
|
|
void setBestmixEND(int depth);
|
2014-07-02 20:07:38 +00:00
|
|
|
void setBackgasBreaks(bool dobreaks);
|
2015-08-15 13:16:51 +00:00
|
|
|
void disableDecoElements(int mode);
|
2017-11-02 20:00:54 +00:00
|
|
|
void disableBackgasBreaks(bool enabled);
|
2017-04-19 06:05:28 +00:00
|
|
|
void setDiveMode(int mode);
|
2014-06-10 15:40:02 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::plannerSettingsWidget ui;
|
2014-07-17 15:03:52 +00:00
|
|
|
void updateUnitsUI();
|
2015-07-03 21:07:58 +00:00
|
|
|
QSignalMapper *modeMapper;
|
2014-06-10 15:40:02 +00:00
|
|
|
};
|
|
|
|
|
2015-02-09 18:37:26 +00:00
|
|
|
#include "ui_plannerDetails.h"
|
|
|
|
|
|
|
|
class PlannerDetails : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit PlannerDetails(QWidget *parent = 0);
|
2015-02-09 22:14:08 +00:00
|
|
|
QPushButton *printPlan() const { return ui.printPlan; }
|
|
|
|
QTextEdit *divePlanOutput() const { return ui.divePlanOutput; }
|
2017-11-27 16:36:21 +00:00
|
|
|
QLabel *divePlannerOutputLabel() const { return ui.divePlanOutputLabel; }
|
2015-02-09 22:14:08 +00:00
|
|
|
|
2015-02-09 18:37:26 +00:00
|
|
|
private:
|
|
|
|
Ui::plannerDetails ui;
|
|
|
|
};
|
|
|
|
|
2014-02-11 18:14:46 +00:00
|
|
|
#endif // DIVEPLANNER_H
|