QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
QGCOptions.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtGui/QColor>
4#include <QtCore/QLoggingCategory>
5#include <QtCore/QObject>
6#include <QtCore/QString>
7#include <QtCore/QUrl>
8#include <QtQmlIntegration/QtQmlIntegration>
9
10class QGCOptions;
11
12Q_DECLARE_LOGGING_CATEGORY(QGCFlyViewOptionsLog)
13
14class QGCFlyViewOptions : public QObject
15{
16 Q_OBJECT
17 QML_ELEMENT
18 QML_UNCREATABLE("")
19 Q_PROPERTY(bool showMultiVehicleList READ showMultiVehicleList CONSTANT)
20 Q_PROPERTY(bool showInstrumentPanel READ showInstrumentPanel CONSTANT)
21 Q_PROPERTY(bool showMapScale READ showMapScale CONSTANT)
22 Q_PROPERTY(bool guidedBarShowEmergencyStop READ guidedBarShowEmergencyStop NOTIFY guidedBarShowEmergencyStopChanged)
23 Q_PROPERTY(bool guidedBarShowOrbit READ guidedBarShowOrbit NOTIFY guidedBarShowOrbitChanged)
24 Q_PROPERTY(bool guidedBarShowROI READ guidedBarShowROI NOTIFY guidedBarShowROIChanged)
25
26public:
27 explicit QGCFlyViewOptions(QGCOptions *options, QObject *parent = nullptr);
29
30signals:
33 void guidedBarShowROIChanged(bool show);
34
35protected:
36 virtual bool showMultiVehicleList() const { return true; }
37 virtual bool showMapScale() const { return true; }
38 virtual bool showInstrumentPanel() const { return true; }
39 virtual bool guidedBarShowEmergencyStop() const { return true; }
40 virtual bool guidedBarShowOrbit() const { return true; }
41 virtual bool guidedBarShowROI() const { return true; }
42
43 const QGCOptions *_options = nullptr;
44};
45
46/*===========================================================================*/
47
48Q_DECLARE_LOGGING_CATEGORY(QGCOptionsLog)
49
50class QGCOptions : public QObject
51{
52 Q_OBJECT
53 QML_ELEMENT
54 QML_UNCREATABLE("")
55 Q_PROPERTY(bool allowJoystickSelection READ allowJoystickSelection NOTIFY allowJoystickSelectionChanged)
56 Q_PROPERTY(bool checkFirmwareVersion READ checkFirmwareVersion CONSTANT)
57 Q_PROPERTY(bool combineSettingsAndSetup READ combineSettingsAndSetup CONSTANT)
58 Q_PROPERTY(bool enableSaveMainWindowPosition READ enableSaveMainWindowPosition CONSTANT)
59 Q_PROPERTY(bool guidedActionsRequireRCRSSI READ guidedActionsRequireRCRSSI CONSTANT)
60 Q_PROPERTY(bool missionWaypointsOnly READ missionWaypointsOnly NOTIFY missionWaypointsOnlyChanged)
61 Q_PROPERTY(bool multiVehicleEnabled READ multiVehicleEnabled NOTIFY multiVehicleEnabledChanged)
62 Q_PROPERTY(bool sensorsHaveFixedOrientation READ sensorsHaveFixedOrientation CONSTANT)
63 Q_PROPERTY(bool showFirmwareUpgrade READ showFirmwareUpgrade NOTIFY showFirmwareUpgradeChanged)
64 Q_PROPERTY(bool showMissionAbsoluteAltitude READ showMissionAbsoluteAltitude NOTIFY showMissionAbsoluteAltitudeChanged)
65 Q_PROPERTY(bool showMissionStatus READ showMissionStatus CONSTANT)
66 Q_PROPERTY(bool showOfflineMapExport READ showOfflineMapExport NOTIFY showOfflineMapExportChanged)
67 Q_PROPERTY(bool showOfflineMapImport READ showOfflineMapImport NOTIFY showOfflineMapImportChanged)
68 Q_PROPERTY(bool showPX4LogTransferOptions READ showPX4LogTransferOptions CONSTANT)
69 Q_PROPERTY(bool showSensorCalibrationAccel READ showSensorCalibrationAccel NOTIFY showSensorCalibrationAccelChanged)
70 Q_PROPERTY(bool showSensorCalibrationAirspeed READ showSensorCalibrationAirspeed NOTIFY showSensorCalibrationAirspeedChanged)
71 Q_PROPERTY(bool showSensorCalibrationCompass READ showSensorCalibrationCompass NOTIFY showSensorCalibrationCompassChanged)
72 Q_PROPERTY(bool showSensorCalibrationGyro READ showSensorCalibrationGyro NOTIFY showSensorCalibrationGyroChanged)
73 Q_PROPERTY(bool showSensorCalibrationLevel READ showSensorCalibrationLevel NOTIFY showSensorCalibrationLevelChanged)
74 Q_PROPERTY(bool showSimpleMissionStart READ showSimpleMissionStart NOTIFY showSimpleMissionStartChanged)
75 Q_PROPERTY(bool useMobileFileDialog READ useMobileFileDialog CONSTANT)
76 Q_PROPERTY(double toolbarHeightMultiplier READ toolbarHeightMultiplier CONSTANT)
77 Q_PROPERTY(float devicePixelDensity READ devicePixelDensity NOTIFY devicePixelDensityChanged)
78 Q_PROPERTY(float devicePixelRatio READ devicePixelRatio NOTIFY devicePixelRatioChanged)
79 Q_PROPERTY(const QGCFlyViewOptions *flyView READ flyViewOptions CONSTANT)
80 Q_PROPERTY(QString firmwareUpgradeSingleURL READ firmwareUpgradeSingleURL CONSTANT)
81 Q_PROPERTY(QStringList surveyBuiltInPresetNames READ surveyBuiltInPresetNames CONSTANT)
82 Q_PROPERTY(QUrl preFlightChecklistUrl READ preFlightChecklistUrl CONSTANT)
83
84public:
85 explicit QGCOptions(QObject *parent = nullptr);
87
90 virtual bool combineSettingsAndSetup() const { return false; }
91
94 virtual double toolbarHeightMultiplier() const { return 1.0; }
95
98 virtual bool showMissionStatus() const { return true; }
99
101 virtual QUrl preFlightChecklistUrl() const { return QUrl::fromUserInput(QStringLiteral("qrc:/qml/QGroundControl/FlyView/PreFlightCheckList.qml")); }
102
104 virtual QColor toolbarBackgroundLight() const { return QColorConstants::White; }
105
107 virtual QColor toolbarBackgroundDark() const { return QColorConstants::Black; }
108
110 virtual bool showSensorCalibrationAccel() const { return true; }
111 virtual bool showSensorCalibrationAirspeed() const { return true; }
112 virtual bool showSensorCalibrationCompass() const { return true; }
113 virtual bool showSensorCalibrationGyro() const { return true; }
114 virtual bool showSensorCalibrationLevel() const { return true; }
115
117 virtual bool allowJoystickSelection() const { return true; }
118
119 virtual bool checkFirmwareVersion() const { return true; }
120
122 virtual bool guidedActionsRequireRCRSSI() const { return false; }
123
125 virtual bool missionWaypointsOnly() const { return false; }
126
128 virtual bool multiVehicleEnabled() const { return true; }
129
130 virtual bool sensorsHaveFixedOrientation() const { return false; }
131
132 virtual bool showFirmwareUpgrade() const { return true; }
133 virtual bool showMissionAbsoluteAltitude() const { return true; }
134 virtual bool showOfflineMapExport() const { return true; }
135 virtual bool showOfflineMapImport() const { return true; }
136 virtual bool showPX4LogTransferOptions() const { return true; }
137 virtual bool showSimpleMissionStart() const { return false; }
138
140 virtual bool enableSaveMainWindowPosition() const { return true; }
141
142 virtual QStringList surveyBuiltInPresetNames() const { return QStringList(); }
143
144#if defined (Q_OS_ANDROID) || defined(Q_OS_IOS)
145 virtual bool useMobileFileDialog() const { return true; }
146#else
147 virtual bool useMobileFileDialog() const { return false; }
148#endif
149
153 virtual QString firmwareUpgradeSingleURL() const { return QString(); }
154
156 virtual float devicePixelRatio() const { return 0.0f; }
157 virtual float devicePixelDensity() const { return 0.0f; }
158
159 virtual const QGCFlyViewOptions *flyViewOptions() const { return _defaultFlyViewOptions; }
160
161signals:
165 void missionWaypointsOnlyChanged(bool missionWaypointsOnly);
166 void multiVehicleEnabledChanged(bool multiVehicleEnabled);
177
178protected:
180};
Q_DECLARE_LOGGING_CATEGORY(AndroidSerialLog)
virtual bool guidedBarShowOrbit() const
Definition QGCOptions.h:40
virtual bool showMultiVehicleList() const
Definition QGCOptions.h:36
virtual bool guidedBarShowEmergencyStop() const
Definition QGCOptions.h:39
void guidedBarShowOrbitChanged(bool show)
void guidedBarShowEmergencyStopChanged(bool show)
void guidedBarShowROIChanged(bool show)
virtual bool showInstrumentPanel() const
Definition QGCOptions.h:38
virtual bool guidedBarShowROI() const
Definition QGCOptions.h:41
virtual bool showMapScale() const
Definition QGCOptions.h:37
void multiVehicleEnabledChanged(bool multiVehicleEnabled)
void showSimpleMissionStartChanged()
void showMissionAbsoluteAltitudeChanged()
void devicePixelRatioChanged()
void showSensorCalibrationGyroChanged(bool show)
void showSensorCalibrationCompassChanged(bool show)
void missionWaypointsOnlyChanged(bool missionWaypointsOnly)
const QGCFlyViewOptions * _defaultFlyViewOptions
Definition QGCOptions.h:179
void showSensorCalibrationLevelChanged(bool show)
void showSensorCalibrationAirspeedChanged(bool show)
void showSensorCalibrationAccelChanged(bool show)
void showOfflineMapImportChanged()
void showOfflineMapExportChanged()
void showFirmwareUpgradeChanged(bool show)
void devicePixelDensityChanged()
void allowJoystickSelectionChanged(bool allow)