From 49170f06288cd668e9224d1ad5102e0037799d11 Mon Sep 17 00:00:00 2001 From: pip Date: Mon, 28 Feb 2011 00:35:11 +0000 Subject: [PATCH] Monitor telemetry disconnection. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2914 ebee16cc-31ac-478f-84a7-5cbb03baadba --- .../src/plugins/coreplugin/connectionmanager.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/coreplugin/connectionmanager.cpp b/ground/openpilotgcs/src/plugins/coreplugin/connectionmanager.cpp index ccd35cf88..1bf0d4ab7 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/connectionmanager.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/connectionmanager.cpp @@ -164,11 +164,15 @@ void ConnectionManager::onConnectionClosed(QObject *obj) // Pip if (!m_connectionDevice.connection || m_connectionDevice.connection != obj) return; + m_connectionDevice.connection->closeDevice(m_connectionDevice.devName); m_connectionDevice.connection = NULL; m_ioDev = NULL; m_connectBtn->setText("Connect"); m_availableDevList->setEnabled(true); + + // signal interested plugins that user is disconnecting his device + emit deviceDisconnected(); } void ConnectionManager::onConnectionDestroyed(QObject *obj) // Pip @@ -213,8 +217,8 @@ void ConnectionManager::onConnectPressed() return; } - connect(m_connectionDevice.connection, SIGNAL(deviceClosed(QObject *)), this, SLOT(onConnectionClosed(QObject *))); // Pip - connect(m_connectionDevice.connection, SIGNAL(destroyed(QObject *)), this, SLOT(onConnectionDestroyed(QObject *))); // Pip + connect(m_connectionDevice.connection, SIGNAL(deviceClosed(QObject *)), this, SLOT(onConnectionClosed(QObject *)), Qt::QueuedConnection); + connect(m_connectionDevice.connection, SIGNAL(destroyed(QObject *)), this, SLOT(onConnectionDestroyed(QObject *)), Qt::QueuedConnection); //signal interested plugins that the user wants to connect to the device emit deviceConnected(m_ioDev);