1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-22 12:54:14 +01:00

OP-248 Enable serial device polling on Windows too as automatic detection seems to be unreliable.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2354 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
edouard 2011-01-09 18:43:03 +00:00 committed by edouard
parent 9827746847
commit 79f72bda47

View File

@ -76,19 +76,24 @@ SerialConnection::SerialConnection()
: m_enumerateThread(this) : m_enumerateThread(this)
{ {
serialHandle = NULL; serialHandle = NULL;
#ifdef Q_OS_WIN
//I'm cheating a little bit here: // Experimental: enable polling on all OS'es since there
//Knowing if the device enumeration really changed is a bit complicated // were reports that autodetect does not work on XP amongst
//so I just signal it whenever we have a device event... // others.
QMainWindow *mw = Core::ICore::instance()->mainWindow();
QObject::connect(mw, SIGNAL(deviceChange()), //#ifdef Q_OS_WIN
this, SLOT(onEnumerationChanged())); // //I'm cheating a little bit here:
#else // //Knowing if the device enumeration really changed is a bit complicated
// //so I just signal it whenever we have a device event...
// QMainWindow *mw = Core::ICore::instance()->mainWindow();
// QObject::connect(mw, SIGNAL(deviceChange()),
// this, SLOT(onEnumerationChanged()));
//#else
// Other OSes do not send such signals: // Other OSes do not send such signals:
QObject::connect(&m_enumerateThread, SIGNAL(enumerationChanged()), QObject::connect(&m_enumerateThread, SIGNAL(enumerationChanged()),
this, SLOT(onEnumerationChanged())); this, SLOT(onEnumerationChanged()));
m_enumerateThread.start(); m_enumerateThread.start();
#endif //#endif
} }
SerialConnection::~SerialConnection() SerialConnection::~SerialConnection()