AutoConnectSettings.cc 3.04 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
/****************************************************************************
 *
 *   (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.
 *
 ****************************************************************************/

#include "AutoConnectSettings.h"
11
#include "LinkManager.h"
12 13

#include <QQmlEngine>
Don Gagne's avatar
Don Gagne committed
14
#include <QtQml>
15

16
DECLARE_SETTINGGROUP(AutoConnect, "LinkManager")
17
{
18
    qmlRegisterUncreatableType<AutoConnectSettings>("QGroundControl.SettingsManager", 1, 0, "AutoConnectSettings", "Reference only"); \
19
}
20

21 22 23 24
DECLARE_SETTINGSFACT(AutoConnectSettings, autoConnectUDP)
DECLARE_SETTINGSFACT(AutoConnectSettings, udpListenPort)
DECLARE_SETTINGSFACT(AutoConnectSettings, udpTargetHostIP)
DECLARE_SETTINGSFACT(AutoConnectSettings, udpTargetHostPort)
25
DECLARE_SETTINGSFACT(AutoConnectSettings, nmeaUdpPort)
26

27
DECLARE_SETTINGSFACT_NO_FUNC(AutoConnectSettings, autoConnectPixhawk)
28 29
{
    if (!_autoConnectPixhawkFact) {
30
        _autoConnectPixhawkFact = _createSettingsFact(autoConnectPixhawkName);
31 32 33
#ifdef __ios__
        _autoConnectPixhawkFact->setVisible(false);
#endif
34 35 36 37
    }
    return _autoConnectPixhawkFact;
}

38
DECLARE_SETTINGSFACT_NO_FUNC(AutoConnectSettings, autoConnectSiKRadio)
39 40
{
    if (!_autoConnectSiKRadioFact) {
41
        _autoConnectSiKRadioFact = _createSettingsFact(autoConnectSiKRadioName);
42 43 44
#ifdef __ios__
        _autoConnectSiKRadioFact->setVisible(false);
#endif
45 46 47 48
    }
    return _autoConnectSiKRadioFact;
}

49
DECLARE_SETTINGSFACT_NO_FUNC(AutoConnectSettings, autoConnectPX4Flow)
50 51
{
    if (!_autoConnectPX4FlowFact) {
52
        _autoConnectPX4FlowFact = _createSettingsFact(autoConnectPX4FlowName);
53 54 55
#ifdef __ios__
        _autoConnectPX4FlowFact->setVisible(false);
#endif
56 57 58 59
    }
    return _autoConnectPX4FlowFact;
}

60
DECLARE_SETTINGSFACT_NO_FUNC(AutoConnectSettings, autoConnectRTKGPS)
61 62
{
    if (!_autoConnectRTKGPSFact) {
63
        _autoConnectRTKGPSFact = _createSettingsFact(autoConnectRTKGPSName);
64 65 66
#ifdef __ios__
        _autoConnectRTKGPSFact->setVisible(false);
#endif
67 68 69 70
    }
    return _autoConnectRTKGPSFact;
}

71
DECLARE_SETTINGSFACT_NO_FUNC(AutoConnectSettings, autoConnectLibrePilot)
72 73
{
    if (!_autoConnectLibrePilotFact) {
74
        _autoConnectLibrePilotFact = _createSettingsFact(autoConnectLibrePilotName);
75 76 77
#ifdef __ios__
        _autoConnectLibrePilotFact->setVisible(false);
#endif
78 79 80
    }
    return _autoConnectLibrePilotFact;
}
81

82
DECLARE_SETTINGSFACT_NO_FUNC(AutoConnectSettings, autoConnectNmeaPort)
83 84 85
{
    if (!_autoConnectNmeaPortFact) {
        _autoConnectNmeaPortFact = _createSettingsFact(autoConnectNmeaPortName);
86 87 88
#ifdef __ios__
        _autoConnectNmeaPortFact->setVisible(false);
#endif
89 90 91 92
    }
    return _autoConnectNmeaPortFact;
}

93
DECLARE_SETTINGSFACT_NO_FUNC(AutoConnectSettings, autoConnectNmeaBaud)
94 95 96
{
    if (!_autoConnectNmeaBaudFact) {
        _autoConnectNmeaBaudFact = _createSettingsFact(autoConnectNmeaBaudName);
97 98 99
#ifdef __ios__
        _autoConnectNmeaBaudFact->setVisible(false);
#endif
100 101 102
    }
    return _autoConnectNmeaBaudFact;
}