AutoConnectSettings.cc 3.11 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 19
    QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership); \
    qmlRegisterUncreatableType<AutoConnectSettings>("QGroundControl.SettingsManager", 1, 0, "AutoConnectSettings", "Reference only"); \
20
}
21

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

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

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

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

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

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

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

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