5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
21 #ifndef SIMULATORMAINWINDOW_H
22 #define SIMULATORMAINWINDOW_H
24 #include "simulator.h"
26 #include <QDockWidget>
28 #include <QMainWindow>
33 class RadioOutputsWidget
;
34 class SimulatorWidget
;
35 class SimulatorInterface
;
36 class TrainerSimulator
;
37 class TelemetrySimulator
;
42 class SimulatorMainWindow
;
45 using namespace Simulator
;
47 class SimulatorMainWindow
: public QMainWindow
52 explicit SimulatorMainWindow(QWidget
* parent
, const QString
& firmwareId
= "", quint8 flags
=0, Qt::WindowFlags wflags
= Qt::WindowFlags());
53 ~SimulatorMainWindow();
55 int getExitStatus(QString
* msg
= Q_NULLPTR
);
56 bool setRadioData(RadioData
* radioData
);
57 bool useTempDataPath(bool deleteOnClose
= true);
58 bool setOptions(SimulatorOptions
& options
, bool withSave
= true);
59 virtual QMenu
* createPopupMenu();
64 void showMenuBar(bool show
);
65 void showRadioFixedSize(Qt::Orientation orientation
, bool fixed
);
66 void showRadioFixedWidth(bool fixed
);
67 void showRadioFixedHeight(bool fixed
);
68 void showRadioDocked(bool dock
);
71 void simulatorStart();
72 void simulatorRestart();
75 virtual void closeEvent(QCloseEvent
*);
76 virtual void changeEvent(QEvent
*e
);
77 void restoreUiState();
79 void toggleMenuBar(bool show
);
80 void setRadioSizePolicy(int fixType
);
81 void toggleRadioDocked(bool dock
);
82 void openJoystickDialog(bool);
83 void showHelp(bool show
);
86 void createDockWidgets();
87 void addTool(QDockWidget
* widget
, Qt::DockWidgetArea area
, QIcon icon
= QIcon(), QKeySequence shortcut
= QKeySequence());
89 SimulatorInterface
* m_simulator
;
91 Ui::SimulatorMainWindow
* ui
;
92 SimulatorWidget
* m_simulatorWidget
;
93 DebugOutput
* m_consoleWidget
;
94 RadioOutputsWidget
* m_outputsWidget
;
96 QDockWidget
* m_simulatorDockWidget
;
97 QDockWidget
* m_consoleDockWidget
;
98 QDockWidget
* m_telemetryDockWidget
;
99 QDockWidget
* m_trainerDockWidget
;
100 QDockWidget
* m_outputsDockWidget
;
104 QVector
<keymapHelp_t
> m_keymapHelp
;
105 QString m_simulatorId
;
106 QString m_exitStatusMsg
;
107 int m_exitStatusCode
;
108 int m_radioProfileId
;
109 int m_radioSizeConstraint
;
111 bool m_showRadioDocked
;
114 const static quint16 m_savedUiStateVersion
;
117 #endif // SIMULATORMAINWINDOW_H