mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-29 21:50:26 +00:00
7f8c3592ce
Add minimum gas calculation to planner output. Add the two UI parameters prefs.sacfactor and prefs.problemsolvingtime. Connect UI signals and slots for recalculation of diveplan. Disable minimum gas calculation if there was already a warning before. If minimum gas result is larger then cylinder start pressure give warning message instead of result. Add line break before pO2 warnings but only if warnings exist. Signed-off-by: Joachim Ritter <jritter@bitsenke.de> Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
108 lines
2.5 KiB
C++
108 lines
2.5 KiB
C++
#ifndef DIVEPLANNER_H
|
|
#define DIVEPLANNER_H
|
|
|
|
#include <QGraphicsPathItem>
|
|
#include <QAbstractTableModel>
|
|
#include <QAbstractButton>
|
|
#include <QDateTime>
|
|
#include <QSignalMapper>
|
|
|
|
#include "core/dive.h"
|
|
|
|
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 salinityChanged(const double salinity);
|
|
void printDecoPlan();
|
|
void setSurfacePressure(int surface_pressure);
|
|
void setSalinity(int salinity);
|
|
|
|
private:
|
|
Ui::DivePlanner ui;
|
|
QAbstractButton *replanButton;
|
|
};
|
|
|
|
#include "ui_plannerSettings.h"
|
|
|
|
class PlannerSettingsWidget : public QWidget {
|
|
Q_OBJECT
|
|
public:
|
|
explicit PlannerSettingsWidget(QWidget *parent = 0, Qt::WindowFlags f = 0);
|
|
virtual ~PlannerSettingsWidget();
|
|
public
|
|
slots:
|
|
void settingsChanged();
|
|
void bottomSacChanged(const double bottomSac);
|
|
void decoSacChanged(const double decosac);
|
|
void printDecoPlan();
|
|
void setAscRate75(int rate);
|
|
void setAscRate50(int rate);
|
|
void setAscRateStops(int rate);
|
|
void setAscRateLast6m(int rate);
|
|
void setDescRate(int rate);
|
|
void sacFactorChanged(const double factor);
|
|
void problemSolvingTimeChanged(const int min);
|
|
void setBottomPo2(double po2);
|
|
void setDecoPo2(double po2);
|
|
void setBestmixEND(int depth);
|
|
void setBackgasBreaks(bool dobreaks);
|
|
void disableDecoElements(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; }
|
|
|
|
private:
|
|
Ui::plannerDetails ui;
|
|
};
|
|
|
|
#endif // DIVEPLANNER_H
|