Browse Source

Updated from reviewer feedback

QGC4.4
Jacob Dahl 5 years ago
parent
commit
7b5733dee0
  1. 19
      src/comm/UDPLink.cc
  2. 10
      src/ui/preferences/MavlinkSettings.qml

19
src/comm/UDPLink.cc

@ -291,21 +291,16 @@ bool UDPLink::_hardwareConnect() @@ -291,21 +291,16 @@ bool UDPLink::_hardwareConnect()
if (_connectState) {
_socket->joinMulticastGroup(QHostAddress("224.0.0.1"));
//-- Make sure we have a large enough IO buffers
#ifdef __mobile__
_socket->setSocketOption(QAbstractSocket::SendBufferSizeSocketOption, 64 * 1024);
if (_udpConfig->isTransmitOnly()) {
_socket->setSocketOption(QAbstractSocket::ReceiveBufferSizeSocketOption, 0);
} else {
_socket->setSocketOption(QAbstractSocket::ReceiveBufferSizeSocketOption, 128 * 1024);
}
int bufferSizeMultiplier = 1;
#else
_socket->setSocketOption(QAbstractSocket::SendBufferSizeSocketOption, 256 * 1024);
if (_udpConfig->isTransmitOnly()) {
_socket->setSocketOption(QAbstractSocket::ReceiveBufferSizeSocketOption, 0);;
} else {
_socket->setSocketOption(QAbstractSocket::ReceiveBufferSizeSocketOption, 512 * 1024);;
}
int bufferSizeMultiplier = 4;
#endif
int receiveBufferSize = _udpConfig->isTransmitOnly() ? 0 : 512 * 1024;
_socket->setSocketOption(QAbstractSocket::SendBufferSizeSocketOption, bufferSizeMultiplier * 64 * 1024);
_socket->setSocketOption(QAbstractSocket::ReceiveBufferSizeSocketOption, bufferSizeMultiplier * receiveBufferSize);
_registerZeroconf(_udpConfig->localPort(), kZeroconfRegistration);
QObject::connect(_socket, &QUdpSocket::readyRead, this, &UDPLink::readBytes);
emit connected();

10
src/ui/preferences/MavlinkSettings.qml

@ -166,24 +166,22 @@ Rectangle { @@ -166,24 +166,22 @@ Rectangle {
QGCLabel {
width: _labelWidth
anchors.baseline: mavlinkForwardingHostNameField.baseline
visible: QGroundControl.settingsManager.appSettings.forwardMavlink.rawValue &&
QGroundControl.settingsManager.appSettings.forwardMavlink.visible
visible: QGroundControl.settingsManager.appSettings.forwardMavlink.visible
text: qsTr("Host name:")
}
FactTextField {
id: mavlinkForwardingHostNameField
fact: QGroundControl.settingsManager.appSettings.forwardMavlinkHostName
width: _valueWidth
visible: QGroundControl.settingsManager.appSettings.forwardMavlink.rawValue &&
QGroundControl.settingsManager.appSettings.forwardMavlink.visible
visible: QGroundControl.settingsManager.appSettings.forwardMavlink.visible
enabled: QGroundControl.settingsManager.appSettings.forwardMavlink.rawValue
anchors.verticalCenter: parent.verticalCenter
}
}
QGCLabel {
text: qsTr("<i> Changing the host name requires restart of application. </i>")
visible: QGroundControl.settingsManager.appSettings.forwardMavlink.rawValue &&
QGroundControl.settingsManager.appSettings.forwardMavlink.visible
visible: QGroundControl.settingsManager.appSettings.forwardMavlink.visible
}
}
}

Loading…
Cancel
Save