Browse Source

Fix UDP Auto-Connect for iOS.

QGC4.4
dogmaphobic 10 years ago
parent
commit
b5fb612db6
  1. 7
      src/comm/LinkManager.cc
  2. 2
      src/comm/LinkManager.h
  3. 3
      src/ui/preferences/GeneralSettings.qml

7
src/comm/LinkManager.cc

@ -95,10 +95,9 @@ void LinkManager::setToolbox(QGCToolbox *toolbox)
_mavlinkProtocol = _toolbox->mavlinkProtocol(); _mavlinkProtocol = _toolbox->mavlinkProtocol();
connect(_mavlinkProtocol, &MAVLinkProtocol::vehicleHeartbeatInfo, this, &LinkManager::_vehicleHeartbeatInfo); connect(_mavlinkProtocol, &MAVLinkProtocol::vehicleHeartbeatInfo, this, &LinkManager::_vehicleHeartbeatInfo);
#ifndef __ios__
connect(&_portListTimer, &QTimer::timeout, this, &LinkManager::_updateAutoConnectLinks); connect(&_portListTimer, &QTimer::timeout, this, &LinkManager::_updateAutoConnectLinks);
_portListTimer.start(1000); _portListTimer.start(1000);
#endif
} }
LinkInterface* LinkManager::createConnectedLink(LinkConfiguration* config, bool autoconnectLink) LinkInterface* LinkManager::createConnectedLink(LinkConfiguration* config, bool autoconnectLink)
@ -415,7 +414,6 @@ SerialConfiguration* LinkManager::_autoconnectConfigurationsContainsPort(const Q
} }
#endif #endif
#ifndef __ios__
void LinkManager::_updateAutoConnectLinks(void) void LinkManager::_updateAutoConnectLinks(void)
{ {
if (_connectionsSuspended || qgcApp()->runningUnitTests()) { if (_connectionsSuspended || qgcApp()->runningUnitTests()) {
@ -430,6 +428,7 @@ void LinkManager::_updateAutoConnectLinks(void)
} }
#ifndef __ios__
QStringList currentPorts; QStringList currentPorts;
QList<QGCSerialPortInfo> portList = QGCSerialPortInfo::availablePorts(); QList<QGCSerialPortInfo> portList = QGCSerialPortInfo::availablePorts();
@ -522,8 +521,8 @@ void LinkManager::_updateAutoConnectLinks(void)
_autoconnectConfigurations.removeOne(pDeleteConfig); _autoconnectConfigurations.removeOne(pDeleteConfig);
delete pDeleteConfig; delete pDeleteConfig;
} }
#endif // __ios__
} }
#endif
bool LinkManager::anyConnectedLinks(void) bool LinkManager::anyConnectedLinks(void)
{ {

2
src/comm/LinkManager.h

@ -205,9 +205,7 @@ private:
bool _configurationsLoaded; ///< true: Link configurations have been loaded bool _configurationsLoaded; ///< true: Link configurations have been loaded
bool _connectionsSuspended; ///< true: all new connections should not be allowed bool _connectionsSuspended; ///< true: all new connections should not be allowed
QString _connectionsSuspendedReason; ///< User visible reason for suspension QString _connectionsSuspendedReason; ///< User visible reason for suspension
#ifndef __ios__
QTimer _portListTimer; QTimer _portListTimer;
#endif
uint32_t _mavlinkChannelsUsedBitMask; uint32_t _mavlinkChannelsUsedBitMask;
MAVLinkProtocol* _mavlinkProtocol; MAVLinkProtocol* _mavlinkProtocol;

3
src/ui/preferences/GeneralSettings.qml

@ -201,18 +201,21 @@ Rectangle {
QGCCheckBox { QGCCheckBox {
text: "Pixhawk" text: "Pixhawk"
visible: !ScreenTools.isiOS
checked: QGroundControl.linkManager.autoconnectPixhawk checked: QGroundControl.linkManager.autoconnectPixhawk
onClicked: QGroundControl.linkManager.autoconnectPixhawk = checked onClicked: QGroundControl.linkManager.autoconnectPixhawk = checked
} }
QGCCheckBox { QGCCheckBox {
text: "3DR Radio" text: "3DR Radio"
visible: !ScreenTools.isiOS
checked: QGroundControl.linkManager.autoconnect3DRRadio checked: QGroundControl.linkManager.autoconnect3DRRadio
onClicked: QGroundControl.linkManager.autoconnect3DRRadio = checked onClicked: QGroundControl.linkManager.autoconnect3DRRadio = checked
} }
QGCCheckBox { QGCCheckBox {
text: "PX4 Flow" text: "PX4 Flow"
visible: !ScreenTools.isiOS
checked: QGroundControl.linkManager.autoconnectPX4Flow checked: QGroundControl.linkManager.autoconnectPX4Flow
onClicked: QGroundControl.linkManager.autoconnectPX4Flow = checked onClicked: QGroundControl.linkManager.autoconnectPX4Flow = checked
} }

Loading…
Cancel
Save