Commit f741140a authored by Lorenz Meier's avatar Lorenz Meier

Fix execution context of thread routines - note that this is not quite the...

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.
parent 0cdcad1a
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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)
......
......@@ -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();
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment