Browse Source

Fix execution context of thread routines - note that this is not quite the architecture the Qt folks intended, but as they admit its the consequence of their architecture.

QGC4.4
Lorenz Meier 11 years ago
parent
commit
f741140ad5
  1. 4
      src/comm/QGCFlightGearLink.cc
  2. 4
      src/comm/QGCJSBSimLink.cc
  3. 4
      src/comm/QGCXPlaneLink.cc
  4. 4
      src/comm/SerialLink.cc
  5. 4
      src/comm/TCPLink.cc
  6. 3
      src/comm/UDPLink.cc

4
src/comm/QGCFlightGearLink.cc

@ -49,6 +49,10 @@ QGCFlightGearLink::QGCFlightGearLink(UASInterface* mav, QString startupArguments @@ -49,6 +49,10 @@ QGCFlightGearLink::QGCFlightGearLink(UASInterface* mav, QString startupArguments
_sensorHilEnabled(true),
barometerOffsetkPa(0.0f)
{
// We're doing it wrong - because the Qt folks got the API wrong:
// http://blog.qt.digia.com/blog/2010/06/17/youre-doing-it-wrong/
moveToThread(this);
this->host = host;
this->port = port+mav->getUASID();
this->connectState = false;

4
src/comm/QGCJSBSimLink.cc

@ -44,6 +44,10 @@ QGCJSBSimLink::QGCJSBSimLink(UASInterface* mav, QString startupArguments, QStrin @@ -44,6 +44,10 @@ QGCJSBSimLink::QGCJSBSimLink(UASInterface* mav, QString startupArguments, QStrin
process(NULL),
startupArguments(startupArguments)
{
// We're doing it wrong - because the Qt folks got the API wrong:
// http://blog.qt.digia.com/blog/2010/06/17/youre-doing-it-wrong/
moveToThread(this);
this->host = host;
this->port = port+mav->getUASID();
this->connectState = false;

4
src/comm/QGCXPlaneLink.cc

@ -58,6 +58,10 @@ QGCXPlaneLink::QGCXPlaneLink(UASInterface* mav, QString remoteHost, QHostAddress @@ -58,6 +58,10 @@ QGCXPlaneLink::QGCXPlaneLink(UASInterface* mav, QString remoteHost, QHostAddress
simUpdateHz(0),
_sensorHilEnabled(true)
{
// We're doing it wrong - because the Qt folks got the API wrong:
// http://blog.qt.digia.com/blog/2010/06/17/youre-doing-it-wrong/
moveToThread(this);
this->localHost = localHost;
this->localPort = localPort/*+mav->getUASID()*/;
this->connectState = false;

4
src/comm/SerialLink.cc

@ -28,6 +28,10 @@ SerialLink::SerialLink(QString portname, int baudRate, bool hardwareFlowControl, @@ -28,6 +28,10 @@ SerialLink::SerialLink(QString portname, int baudRate, bool hardwareFlowControl,
m_stopp(false),
m_reqReset(false)
{
// We're doing it wrong - because the Qt folks got the API wrong:
// http://blog.qt.digia.com/blog/2010/06/17/youre-doing-it-wrong/
moveToThread(this);
// Get the name of the current port in use.
m_portName = portname.trimmed();
if (m_portName == "" && getCurrentPorts().size() > 0)

4
src/comm/TCPLink.cc

@ -43,6 +43,10 @@ TCPLink::TCPLink(QHostAddress hostAddress, quint16 socketPort) : @@ -43,6 +43,10 @@ TCPLink::TCPLink(QHostAddress hostAddress, quint16 socketPort) :
_socket(NULL),
_socketIsConnected(false)
{
// We're doing it wrong - because the Qt folks got the API wrong:
// http://blog.qt.digia.com/blog/2010/06/17/youre-doing-it-wrong/
moveToThread(this);
_linkId = getNextLinkId();
_resetName();

3
src/comm/UDPLink.cc

@ -42,6 +42,9 @@ This file is part of the QGROUNDCONTROL project @@ -42,6 +42,9 @@ This file is part of the QGROUNDCONTROL project
UDPLink::UDPLink(QHostAddress host, quint16 port) :
socket(NULL)
{
// We're doing it wrong - because the Qt folks got the API wrong:
// http://blog.qt.digia.com/blog/2010/06/17/youre-doing-it-wrong/
moveToThread(this);
this->host = host;
this->port = port;

Loading…
Cancel
Save