1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-19 09:54:15 +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)
{
serialHandle = NULL;
#ifdef Q_OS_WIN
//I'm cheating a little bit here:
//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
// Experimental: enable polling on all OS'es since there
// were reports that autodetect does not work on XP amongst
// others.
//#ifdef Q_OS_WIN
// //I'm cheating a little bit here:
// //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:
QObject::connect(&m_enumerateThread, SIGNAL(enumerationChanged()),
this, SLOT(onEnumerationChanged()));
m_enumerateThread.start();
#endif
//#endif
}
SerialConnection::~SerialConnection()