subsurface/desktop-widgets/diveplanner.h
jan Iversen c976385aed desktop-widgets: replace variables to plannerShared
Use plannerShared setter to update the variables in qPref.
This will also signal the cylindermodel to calculate a new bestmix.

variables:
   bottompo2
   decopo2
   bestmixend

Signed-off-by: Jan Iversen <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26 09:58:47 -08:00

101 lines
2.3 KiB
C++

// SPDX-License-Identifier: GPL-2.0
#ifndef DIVEPLANNER_H
#define DIVEPLANNER_H
#include <QGraphicsPathItem>
#include <QAbstractTableModel>
#include <QAbstractButton>
#include <QDateTime>
#include <QSignalMapper>
class QListView;
class QModelIndex;
class DivePlannerPointsModel;
class DiveHandler : public QObject, public QGraphicsEllipseItem {
Q_OBJECT
public:
DiveHandler();
protected:
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
signals:
void moved();
void clicked();
void released();
private:
int parentIndex();
public
slots:
void selfRemove();
void changeGas();
private:
QTime t;
};
#include "ui_diveplanner.h"
class DivePlannerWidget : public QWidget {
Q_OBJECT
public:
explicit DivePlannerWidget(QWidget *parent = 0, Qt::WindowFlags f = 0);
void setReplanButton(bool replan);
public
slots:
void setupStartTime(QDateTime startTime);
void settingsChanged();
void atmPressureChanged(const int pressure);
void heightChanged(const int height);
void waterTypeChanged(const int index);
void customSalinityChanged(double density);
void printDecoPlan();
void setSurfacePressure(int surface_pressure);
void setSalinity(int salinity);
private:
Ui::DivePlanner ui;
QAbstractButton *replanButton;
void waterTypeUpdateTexts();
};
#include "ui_plannerSettings.h"
class PlannerSettingsWidget : public QWidget {
Q_OBJECT
public:
explicit PlannerSettingsWidget(QWidget *parent = 0, Qt::WindowFlags f = 0);
~PlannerSettingsWidget();
public
slots:
void settingsChanged();
void printDecoPlan();
void setBackgasBreaks(bool dobreaks);
void disableDecoElements(int mode);
void disableBackgasBreaks(bool enabled);
void setDiveMode(int mode);
void setBailoutVisibility(int mode);
private:
Ui::plannerSettingsWidget ui;
void updateUnitsUI();
QSignalMapper *modeMapper;
};
#include "ui_plannerDetails.h"
class PlannerDetails : public QWidget {
Q_OBJECT
public:
explicit PlannerDetails(QWidget *parent = 0);
QPushButton *printPlan() const { return ui.printPlan; }
QTextEdit *divePlanOutput() const { return ui.divePlanOutput; }
QLabel *divePlannerOutputLabel() const { return ui.divePlanOutputLabel; }
private:
Ui::plannerDetails ui;
};
#endif // DIVEPLANNER_H