AppSettings.h 4.26 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

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

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

21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
    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)
    DEFINE_SETTINGFACT(virtualJoystick)
    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)
46

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

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

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

66 67 68 69 70 71
    QString missionSavePath     ();
    QString parameterSavePath   ();
    QString telemetrySavePath   ();
    QString logSavePath         ();
    QString videoSavePath       ();
    QString crashSavePath       ();
72

73 74
    static MAV_AUTOPILOT    offlineEditingFirmwareTypeFromFirmwareType  (MAV_AUTOPILOT firmwareType);
    static MAV_TYPE         offlineEditingVehicleTypeFromVehicleType    (MAV_TYPE vehicleType);
75 76 77

    // Application wide file extensions
    static const char* parameterFileExtension;
78
    static const char* planFileExtension;
79
    static const char* missionFileExtension;
80
    static const char* waypointsFileExtension;
81 82 83
    static const char* fenceFileExtension;
    static const char* rallyPointFileExtension;
    static const char* telemetryFileExtension;
84
    static const char* kmlFileExtension;
85
    static const char* shpFileExtension;
86
    static const char* logFileExtension;
87 88 89 90 91

    // Child directories of savePath for specific file types
    static const char* parameterDirectory;
    static const char* telemetryDirectory;
    static const char* missionDirectory;
92
    static const char* logDirectory;
93
    static const char* videoDirectory;
94
    static const char* crashDirectory;
95 96

signals:
97
    void savePathsChanged();
98 99

private slots:
100 101
    void _indoorPaletteChanged();
    void _checkSavePathDirectories();
102 103

};