AppSettings.h 8.83 KB
Newer Older
1 2 3 4 5 6 7 8 9
/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/

10 11
#ifndef AppSettings_H
#define AppSettings_H
12

13
#include "SettingsGroup.h"
14
#include "QGCMAVLink.h"
15

16
class AppSettings : public SettingsGroup
17 18 19 20
{
    Q_OBJECT
    
public:
21
    AppSettings(QObject* parent = nullptr);
22

23 24 25 26
    Q_PROPERTY(Fact* offlineEditingFirmwareType         READ offlineEditingFirmwareType         CONSTANT)
    Q_PROPERTY(Fact* offlineEditingVehicleType          READ offlineEditingVehicleType          CONSTANT)
    Q_PROPERTY(Fact* offlineEditingCruiseSpeed          READ offlineEditingCruiseSpeed          CONSTANT)
    Q_PROPERTY(Fact* offlineEditingHoverSpeed           READ offlineEditingHoverSpeed           CONSTANT)
27 28
    Q_PROPERTY(Fact* offlineEditingAscentSpeed          READ offlineEditingAscentSpeed          CONSTANT)
    Q_PROPERTY(Fact* offlineEditingDescentSpeed         READ offlineEditingDescentSpeed         CONSTANT)
29 30
    Q_PROPERTY(Fact* batteryPercentRemainingAnnounce    READ batteryPercentRemainingAnnounce    CONSTANT)
    Q_PROPERTY(Fact* defaultMissionItemAltitude         READ defaultMissionItemAltitude         CONSTANT)
31 32
    Q_PROPERTY(Fact* telemetrySave                      READ telemetrySave                      CONSTANT)
    Q_PROPERTY(Fact* telemetrySaveNotArmed              READ telemetrySaveNotArmed              CONSTANT)
33
    Q_PROPERTY(Fact* audioMuted                         READ audioMuted                         CONSTANT)
34 35 36
    Q_PROPERTY(Fact* virtualJoystick                    READ virtualJoystick                    CONSTANT)
    Q_PROPERTY(Fact* appFontPointSize                   READ appFontPointSize                   CONSTANT)
    Q_PROPERTY(Fact* indoorPalette                      READ indoorPalette                      CONSTANT)
37
    Q_PROPERTY(Fact* showLargeCompass                   READ showLargeCompass                   CONSTANT)
38 39
    Q_PROPERTY(Fact* savePath                           READ savePath                           CONSTANT)
    Q_PROPERTY(Fact* autoLoadMissions                   READ autoLoadMissions                   CONSTANT)
40
    Q_PROPERTY(Fact* useChecklist                       READ useChecklist                       CONSTANT)
41 42
    Q_PROPERTY(Fact* mapboxToken                        READ mapboxToken                        CONSTANT)
    Q_PROPERTY(Fact* esriToken                          READ esriToken                          CONSTANT)
43
    Q_PROPERTY(Fact* defaultFirmwareType                READ defaultFirmwareType                CONSTANT)
44
    Q_PROPERTY(Fact* gstDebug                           READ gstDebug                           CONSTANT)
45
    Q_PROPERTY(Fact* followTarget                       READ followTarget                       CONSTANT)
46 47 48 49

    Q_PROPERTY(QString missionSavePath      READ missionSavePath    NOTIFY savePathsChanged)
    Q_PROPERTY(QString parameterSavePath    READ parameterSavePath  NOTIFY savePathsChanged)
    Q_PROPERTY(QString telemetrySavePath    READ telemetrySavePath  NOTIFY savePathsChanged)
50
    Q_PROPERTY(QString logSavePath          READ logSavePath        NOTIFY savePathsChanged)
51
    Q_PROPERTY(QString videoSavePath        READ videoSavePath      NOTIFY savePathsChanged)
52
    Q_PROPERTY(QString crashSavePath        READ crashSavePath      NOTIFY savePathsChanged)
53

54
    Q_PROPERTY(QString planFileExtension        MEMBER planFileExtension        CONSTANT)
55
    Q_PROPERTY(QString missionFileExtension     MEMBER missionFileExtension     CONSTANT)
56
    Q_PROPERTY(QString waypointsFileExtension   MEMBER waypointsFileExtension   CONSTANT)
57 58
    Q_PROPERTY(QString parameterFileExtension   MEMBER parameterFileExtension   CONSTANT)
    Q_PROPERTY(QString telemetryFileExtension   MEMBER telemetryFileExtension   CONSTANT)
59
    Q_PROPERTY(QString kmlFileExtension         MEMBER kmlFileExtension         CONSTANT)
60
    Q_PROPERTY(QString shpFileExtension         MEMBER shpFileExtension         CONSTANT)
61
    Q_PROPERTY(QString logFileExtension         MEMBER logFileExtension         CONSTANT)
62 63 64 65 66

    Fact* offlineEditingFirmwareType        (void);
    Fact* offlineEditingVehicleType         (void);
    Fact* offlineEditingCruiseSpeed         (void);
    Fact* offlineEditingHoverSpeed          (void);
67 68
    Fact* offlineEditingAscentSpeed         (void);
    Fact* offlineEditingDescentSpeed        (void);
69 70
    Fact* batteryPercentRemainingAnnounce   (void);
    Fact* defaultMissionItemAltitude        (void);
71 72
    Fact* telemetrySave                     (void);
    Fact* telemetrySaveNotArmed             (void);
73 74 75 76
    Fact* audioMuted                        (void);
    Fact* virtualJoystick                   (void);
    Fact* appFontPointSize                  (void);
    Fact* indoorPalette                     (void);
77
    Fact* showLargeCompass                  (void);
78 79
    Fact* savePath                          (void);
    Fact* autoLoadMissions                  (void);
80
    Fact* useChecklist                      (void);
81 82
    Fact* mapboxToken                       (void);
    Fact* esriToken                         (void);
83
    Fact* defaultFirmwareType               (void);
84
    Fact* gstDebug                          (void);
85
    Fact* followTarget                      (void);
86 87 88 89

    QString missionSavePath     (void);
    QString parameterSavePath   (void);
    QString telemetrySavePath   (void);
90
    QString logSavePath         (void);
91 92
    QString videoSavePath       (void);
    QString crashSavePath       (void);
93

94 95 96
    static MAV_AUTOPILOT offlineEditingFirmwareTypeFromFirmwareType(MAV_AUTOPILOT firmwareType);
    static MAV_TYPE offlineEditingVehicleTypeFromVehicleType(MAV_TYPE vehicleType);

97
    static const char* name;
98
    static const char* settingsGroup;
99 100 101 102 103

    static const char* offlineEditingFirmwareTypeSettingsName;
    static const char* offlineEditingVehicleTypeSettingsName;
    static const char* offlineEditingCruiseSpeedSettingsName;
    static const char* offlineEditingHoverSpeedSettingsName;
104 105
    static const char* offlineEditingAscentSpeedSettingsName;
    static const char* offlineEditingDescentSpeedSettingsName;
106 107
    static const char* batteryPercentRemainingAnnounceSettingsName;
    static const char* defaultMissionItemAltitudeSettingsName;
108 109
    static const char* telemetrySaveName;
    static const char* telemetrySaveNotArmedName;
110
    static const char* audioMutedName;
111 112 113
    static const char* virtualJoystickName;
    static const char* appFontPointSizeName;
    static const char* indoorPaletteName;
114
    static const char* showLargeCompassName;
115 116
    static const char* savePathName;
    static const char* autoLoadMissionsName;
117
    static const char* useChecklistName;
118 119
    static const char* mapboxTokenName;
    static const char* esriTokenName;
120
    static const char* defaultFirmwareTypeName;
121
    static const char* gstDebugName;
122
    static const char* followTargetName;
123 124 125

    // Application wide file extensions
    static const char* parameterFileExtension;
126
    static const char* planFileExtension;
127
    static const char* missionFileExtension;
128
    static const char* waypointsFileExtension;
129 130 131
    static const char* fenceFileExtension;
    static const char* rallyPointFileExtension;
    static const char* telemetryFileExtension;
132
    static const char* kmlFileExtension;
133
    static const char* shpFileExtension;
134
    static const char* logFileExtension;
135 136 137 138 139

    // Child directories of savePath for specific file types
    static const char* parameterDirectory;
    static const char* telemetryDirectory;
    static const char* missionDirectory;
140
    static const char* logDirectory;
141
    static const char* videoDirectory;
142
    static const char* crashDirectory;
143 144 145

signals:
    void savePathsChanged(void);
146 147 148

private slots:
    void _indoorPaletteChanged(void);
149
    void _checkSavePathDirectories(void);
150 151 152 153 154 155

private:
    SettingsFact* _offlineEditingFirmwareTypeFact;
    SettingsFact* _offlineEditingVehicleTypeFact;
    SettingsFact* _offlineEditingCruiseSpeedFact;
    SettingsFact* _offlineEditingHoverSpeedFact;
156 157
    SettingsFact* _offlineEditingAscentSpeedFact;
    SettingsFact* _offlineEditingDescentSpeedFact;
158 159
    SettingsFact* _batteryPercentRemainingAnnounceFact;
    SettingsFact* _defaultMissionItemAltitudeFact;
160 161
    SettingsFact* _telemetrySaveFact;
    SettingsFact* _telemetrySaveNotArmedFact;
162 163 164 165
    SettingsFact* _audioMutedFact;
    SettingsFact* _virtualJoystickFact;
    SettingsFact* _appFontPointSizeFact;
    SettingsFact* _indoorPaletteFact;
166
    SettingsFact* _showLargeCompassFact;
167 168
    SettingsFact* _savePathFact;
    SettingsFact* _autoLoadMissionsFact;
169
    SettingsFact* _useChecklistFact;
170 171
    SettingsFact* _mapboxTokenFact;
    SettingsFact* _esriTokenFact;
172
    SettingsFact* _defaultFirmwareTypeFact;
173
    SettingsFact* _gstDebugFact;
174
    SettingsFact* _followTargetFact;
175 176 177
};

#endif