AppSettings.h 7.18 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 = NULL);
22

23 24 25 26 27 28
    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)
    Q_PROPERTY(Fact* batteryPercentRemainingAnnounce    READ batteryPercentRemainingAnnounce    CONSTANT)
    Q_PROPERTY(Fact* defaultMissionItemAltitude         READ defaultMissionItemAltitude         CONSTANT)
29 30
    Q_PROPERTY(Fact* telemetrySave                      READ telemetrySave                      CONSTANT)
    Q_PROPERTY(Fact* telemetrySaveNotArmed              READ telemetrySaveNotArmed              CONSTANT)
31
    Q_PROPERTY(Fact* audioMuted                         READ audioMuted                         CONSTANT)
32 33 34
    Q_PROPERTY(Fact* virtualJoystick                    READ virtualJoystick                    CONSTANT)
    Q_PROPERTY(Fact* appFontPointSize                   READ appFontPointSize                   CONSTANT)
    Q_PROPERTY(Fact* indoorPalette                      READ indoorPalette                      CONSTANT)
35
    Q_PROPERTY(Fact* showLargeCompass                   READ showLargeCompass                   CONSTANT)
36 37
    Q_PROPERTY(Fact* savePath                           READ savePath                           CONSTANT)
    Q_PROPERTY(Fact* autoLoadMissions                   READ autoLoadMissions                   CONSTANT)
38 39
    Q_PROPERTY(Fact* mapboxToken                        READ mapboxToken                        CONSTANT)
    Q_PROPERTY(Fact* esriToken                          READ esriToken                          CONSTANT)
40
    Q_PROPERTY(Fact* defaultFirmwareType                READ defaultFirmwareType                CONSTANT)
41 42 43 44

    Q_PROPERTY(QString missionSavePath      READ missionSavePath    NOTIFY savePathsChanged)
    Q_PROPERTY(QString parameterSavePath    READ parameterSavePath  NOTIFY savePathsChanged)
    Q_PROPERTY(QString telemetrySavePath    READ telemetrySavePath  NOTIFY savePathsChanged)
45
    Q_PROPERTY(QString logSavePath          READ logSavePath        NOTIFY savePathsChanged)
46
    Q_PROPERTY(QString videoSavePath        READ videoSavePath      NOTIFY savePathsChanged)
47

48
    Q_PROPERTY(QString planFileExtension        MEMBER planFileExtension        CONSTANT)
49
    Q_PROPERTY(QString missionFileExtension     MEMBER missionFileExtension     CONSTANT)
50
    Q_PROPERTY(QString waypointsFileExtension   MEMBER waypointsFileExtension   CONSTANT)
51 52
    Q_PROPERTY(QString parameterFileExtension   MEMBER parameterFileExtension   CONSTANT)
    Q_PROPERTY(QString telemetryFileExtension   MEMBER telemetryFileExtension   CONSTANT)
53
    Q_PROPERTY(QString logFileExtension         MEMBER logFileExtension         CONSTANT)
54 55 56 57 58 59 60

    Fact* offlineEditingFirmwareType        (void);
    Fact* offlineEditingVehicleType         (void);
    Fact* offlineEditingCruiseSpeed         (void);
    Fact* offlineEditingHoverSpeed          (void);
    Fact* batteryPercentRemainingAnnounce   (void);
    Fact* defaultMissionItemAltitude        (void);
61 62
    Fact* telemetrySave                     (void);
    Fact* telemetrySaveNotArmed             (void);
63 64 65 66
    Fact* audioMuted                        (void);
    Fact* virtualJoystick                   (void);
    Fact* appFontPointSize                  (void);
    Fact* indoorPalette                     (void);
67
    Fact* showLargeCompass                  (void);
68 69
    Fact* savePath                          (void);
    Fact* autoLoadMissions                  (void);
70 71
    Fact* mapboxToken                       (void);
    Fact* esriToken                         (void);
72
    Fact* defaultFirmwareType               (void);
73 74 75 76

    QString missionSavePath     (void);
    QString parameterSavePath   (void);
    QString telemetrySavePath   (void);
77
    QString logSavePath         (void);
78
    QString videoSavePath         (void);
79

80 81 82
    static MAV_AUTOPILOT offlineEditingFirmwareTypeFromFirmwareType(MAV_AUTOPILOT firmwareType);
    static MAV_TYPE offlineEditingVehicleTypeFromVehicleType(MAV_TYPE vehicleType);

83
    static const char* appSettingsGroupName;
84 85 86 87 88 89 90

    static const char* offlineEditingFirmwareTypeSettingsName;
    static const char* offlineEditingVehicleTypeSettingsName;
    static const char* offlineEditingCruiseSpeedSettingsName;
    static const char* offlineEditingHoverSpeedSettingsName;
    static const char* batteryPercentRemainingAnnounceSettingsName;
    static const char* defaultMissionItemAltitudeSettingsName;
91 92
    static const char* telemetrySaveName;
    static const char* telemetrySaveNotArmedName;
93
    static const char* audioMutedName;
94 95 96
    static const char* virtualJoystickName;
    static const char* appFontPointSizeName;
    static const char* indoorPaletteName;
97
    static const char* showLargeCompassName;
98 99
    static const char* savePathName;
    static const char* autoLoadMissionsName;
100 101
    static const char* mapboxTokenName;
    static const char* esriTokenName;
102
    static const char* defaultFirmwareTypeName;
103 104 105

    // Application wide file extensions
    static const char* parameterFileExtension;
106
    static const char* planFileExtension;
107
    static const char* missionFileExtension;
108
    static const char* waypointsFileExtension;
109 110 111
    static const char* fenceFileExtension;
    static const char* rallyPointFileExtension;
    static const char* telemetryFileExtension;
112
    static const char* logFileExtension;
113 114 115 116 117

    // Child directories of savePath for specific file types
    static const char* parameterDirectory;
    static const char* telemetryDirectory;
    static const char* missionDirectory;
118
    static const char* logDirectory;
119
    static const char* videoDirectory;
120 121 122

signals:
    void savePathsChanged(void);
123 124 125

private slots:
    void _indoorPaletteChanged(void);
126
    void _checkSavePathDirectories(void);
127 128 129 130 131 132 133 134

private:
    SettingsFact* _offlineEditingFirmwareTypeFact;
    SettingsFact* _offlineEditingVehicleTypeFact;
    SettingsFact* _offlineEditingCruiseSpeedFact;
    SettingsFact* _offlineEditingHoverSpeedFact;
    SettingsFact* _batteryPercentRemainingAnnounceFact;
    SettingsFact* _defaultMissionItemAltitudeFact;
135 136
    SettingsFact* _telemetrySaveFact;
    SettingsFact* _telemetrySaveNotArmedFact;
137 138 139 140
    SettingsFact* _audioMutedFact;
    SettingsFact* _virtualJoystickFact;
    SettingsFact* _appFontPointSizeFact;
    SettingsFact* _indoorPaletteFact;
141
    SettingsFact* _showLargeCompassFact;
142 143
    SettingsFact* _savePathFact;
    SettingsFact* _autoLoadMissionsFact;
144 145
    SettingsFact* _mapboxTokenFact;
    SettingsFact* _esriTokenFact;
146
    SettingsFact* _defaultFirmwareTypeFact;
147 148 149
};

#endif