AppSettings.h 4.7 KB
Newer Older
1 2 3 4 5 6 7 8
/****************************************************************************
 *
 *   (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.
 *
 ****************************************************************************/
9
#pragma once
10
#include <QTranslator>
11

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

15
class AppSettings : public SettingsGroup
16 17
{
    Q_OBJECT
18

19
public:
20
    AppSettings(QObject* parent = nullptr);
21

22 23 24 25 26 27 28 29 30 31 32 33 34
    DEFINE_SETTING_NAME_GROUP()

    DEFINE_SETTINGFACT(offlineEditingFirmwareType)
    DEFINE_SETTINGFACT(offlineEditingVehicleType)
    DEFINE_SETTINGFACT(offlineEditingCruiseSpeed)
    DEFINE_SETTINGFACT(offlineEditingHoverSpeed)
    DEFINE_SETTINGFACT(offlineEditingAscentSpeed)
    DEFINE_SETTINGFACT(offlineEditingDescentSpeed)
    DEFINE_SETTINGFACT(batteryPercentRemainingAnnounce)
    DEFINE_SETTINGFACT(defaultMissionItemAltitude)
    DEFINE_SETTINGFACT(telemetrySave)
    DEFINE_SETTINGFACT(telemetrySaveNotArmed)
    DEFINE_SETTINGFACT(audioMuted)
35
    DEFINE_SETTINGFACT(checkInternet)
36
    DEFINE_SETTINGFACT(virtualJoystick)
37
    DEFINE_SETTINGFACT(virtualJoystickCentralized)
38 39 40 41 42 43 44 45 46 47 48
    DEFINE_SETTINGFACT(appFontPointSize)
    DEFINE_SETTINGFACT(indoorPalette)
    DEFINE_SETTINGFACT(showLargeCompass)
    DEFINE_SETTINGFACT(savePath)
    DEFINE_SETTINGFACT(autoLoadMissions)
    DEFINE_SETTINGFACT(useChecklist)
    DEFINE_SETTINGFACT(mapboxToken)
    DEFINE_SETTINGFACT(esriToken)
    DEFINE_SETTINGFACT(defaultFirmwareType)
    DEFINE_SETTINGFACT(gstDebugLevel)
    DEFINE_SETTINGFACT(followTarget)
49 50
    DEFINE_SETTINGFACT(enableTaisync)
    DEFINE_SETTINGFACT(enableTaisyncVideo)
51
    DEFINE_SETTINGFACT(enableMicrohard)
52
    DEFINE_SETTINGFACT(language)
53
    DEFINE_SETTINGFACT(disableAllPersistence)
Gus Grubba's avatar
Gus Grubba committed
54
    DEFINE_SETTINGFACT(usePairing)
55
    DEFINE_SETTINGFACT(saveCsvTelemetry)
56

57 58 59
    // Although this is a global setting it only affects ArduPilot vehicle since PX4 automatically starts the stream from the vehicle side
    DEFINE_SETTINGFACT(apmStartMavlinkStreams)

60 61 62
    Q_PROPERTY(QString missionSavePath      READ missionSavePath    NOTIFY savePathsChanged)
    Q_PROPERTY(QString parameterSavePath    READ parameterSavePath  NOTIFY savePathsChanged)
    Q_PROPERTY(QString telemetrySavePath    READ telemetrySavePath  NOTIFY savePathsChanged)
63
    Q_PROPERTY(QString logSavePath          READ logSavePath        NOTIFY savePathsChanged)
64
    Q_PROPERTY(QString videoSavePath        READ videoSavePath      NOTIFY savePathsChanged)
65
    Q_PROPERTY(QString crashSavePath        READ crashSavePath      NOTIFY savePathsChanged)
66

67
    Q_PROPERTY(QString planFileExtension        MEMBER planFileExtension        CONSTANT)
68
    Q_PROPERTY(QString missionFileExtension     MEMBER missionFileExtension     CONSTANT)
69
    Q_PROPERTY(QString waypointsFileExtension   MEMBER waypointsFileExtension   CONSTANT)
70 71
    Q_PROPERTY(QString parameterFileExtension   MEMBER parameterFileExtension   CONSTANT)
    Q_PROPERTY(QString telemetryFileExtension   MEMBER telemetryFileExtension   CONSTANT)
72
    Q_PROPERTY(QString kmlFileExtension         MEMBER kmlFileExtension         CONSTANT)
73
    Q_PROPERTY(QString shpFileExtension         MEMBER shpFileExtension         CONSTANT)
74
    Q_PROPERTY(QString logFileExtension         MEMBER logFileExtension         CONSTANT)
75

76 77 78 79 80 81
    QString missionSavePath     ();
    QString parameterSavePath   ();
    QString telemetrySavePath   ();
    QString logSavePath         ();
    QString videoSavePath       ();
    QString crashSavePath       ();
82

83 84
    static MAV_AUTOPILOT    offlineEditingFirmwareTypeFromFirmwareType  (MAV_AUTOPILOT firmwareType);
    static MAV_TYPE         offlineEditingVehicleTypeFromVehicleType    (MAV_TYPE vehicleType);
85 86 87

    // Application wide file extensions
    static const char* parameterFileExtension;
88
    static const char* planFileExtension;
89
    static const char* missionFileExtension;
90
    static const char* waypointsFileExtension;
91 92 93
    static const char* fenceFileExtension;
    static const char* rallyPointFileExtension;
    static const char* telemetryFileExtension;
94
    static const char* kmlFileExtension;
95
    static const char* shpFileExtension;
96
    static const char* logFileExtension;
97 98 99 100 101

    // Child directories of savePath for specific file types
    static const char* parameterDirectory;
    static const char* telemetryDirectory;
    static const char* missionDirectory;
102
    static const char* logDirectory;
103
    static const char* videoDirectory;
104
    static const char* crashDirectory;
105 106

signals:
107
    void savePathsChanged();
108 109

private slots:
110 111
    void _indoorPaletteChanged();
    void _checkSavePathDirectories();
112 113 114 115
    void _languageChanged();

private:
    QTranslator _QGCTranslator;
116 117

};