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
|
|
|
|
|
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>
|
2013-08-26 16:18:21 +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
|
|
|
|
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:
|
2020-10-25 21:27:39 +00:00
|
|
|
explicit DivePlannerWidget(QWidget *parent = 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);
|
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:
|
2020-10-25 21:27:39 +00:00
|
|
|
explicit PlannerSettingsWidget(QWidget *parent = 0);
|
2018-07-31 05:41:19 +00:00
|
|
|
~PlannerSettingsWidget();
|
2014-06-10 15:40:02 +00:00
|
|
|
public
|
|
|
|
slots:
|
|
|
|
void settingsChanged();
|
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);
|
2019-01-10 20:18:53 +00:00
|
|
|
void setBailoutVisibility(int mode);
|
2014-06-10 15:40:02 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::plannerSettingsWidget ui;
|
2014-07-17 15:03:52 +00:00
|
|
|
void updateUnitsUI();
|
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; }
|
2020-11-25 06:31:19 +00:00
|
|
|
public
|
|
|
|
slots:
|
|
|
|
void setPlanNotes(QString plan);
|
2015-02-09 22:14:08 +00:00
|
|
|
|
2015-02-09 18:37:26 +00:00
|
|
|
private:
|
|
|
|
Ui::plannerDetails ui;
|
|
|
|
};
|
|
|
|
|
2020-11-25 06:31:19 +00:00
|
|
|
// The planner widgets make up three quadrants
|
|
|
|
class PlannerWidgets : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
PlannerWidgets();
|
|
|
|
void planDive();
|
|
|
|
void replanDive();
|
|
|
|
public
|
|
|
|
slots:
|
|
|
|
void printDecoPlan();
|
|
|
|
public:
|
|
|
|
DivePlannerWidget plannerWidget;
|
|
|
|
PlannerSettingsWidget plannerSettingsWidget;
|
|
|
|
PlannerDetails plannerDetails;
|
|
|
|
};
|
|
|
|
|
2014-02-11 18:14:46 +00:00
|
|
|
#endif // DIVEPLANNER_H
|