1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-18 08:54:15 +01:00

LP-245 config: minor logging cleanup

This commit is contained in:
Philippe Renon 2016-09-23 09:28:09 +02:00
parent 4e08553de7
commit 4000303482
2 changed files with 15 additions and 13 deletions

View File

@ -72,9 +72,11 @@ ConnectionManager::ConnectionManager(Internal::MainWindow *mainWindow) :
QObject::connect(m_availableDevList, SIGNAL(currentIndexChanged(int)), this, SLOT(onDeviceSelectionChanged(int))); QObject::connect(m_availableDevList, SIGNAL(currentIndexChanged(int)), this, SLOT(onDeviceSelectionChanged(int)));
// setup our reconnect timers // setup our reconnect timers
// TODO these are never started because telemetryConnected is not called anymore
reconnect = new QTimer(this); reconnect = new QTimer(this);
reconnectCheck = new QTimer(this);
connect(reconnect, SIGNAL(timeout()), this, SLOT(reconnectSlot())); connect(reconnect, SIGNAL(timeout()), this, SLOT(reconnectSlot()));
reconnectCheck = new QTimer(this);
connect(reconnectCheck, SIGNAL(timeout()), this, SLOT(reconnectCheckSlot())); connect(reconnectCheck, SIGNAL(timeout()), this, SLOT(reconnectCheckSlot()));
} }
@ -92,7 +94,6 @@ void ConnectionManager::init()
QObject::connect(ExtensionSystem::PluginManager::instance(), SIGNAL(aboutToRemoveObject(QObject *)), this, SLOT(aboutToRemoveObject(QObject *))); QObject::connect(ExtensionSystem::PluginManager::instance(), SIGNAL(aboutToRemoveObject(QObject *)), this, SLOT(aboutToRemoveObject(QObject *)));
} }
// TODO needs documentation? // TODO needs documentation?
void ConnectionManager::addWidget(QWidget *widget) void ConnectionManager::addWidget(QWidget *widget)
{ {
@ -272,7 +273,7 @@ void ConnectionManager::onConnectClicked()
*/ */
void ConnectionManager::telemetryConnected() void ConnectionManager::telemetryConnected()
{ {
qDebug() << "TelemetryMonitor: connected"; qDebug() << "ConnectionManager::telemetryConnected";
if (reconnectCheck->isActive()) { if (reconnectCheck->isActive()) {
reconnectCheck->stop(); reconnectCheck->stop();
@ -284,7 +285,7 @@ void ConnectionManager::telemetryConnected()
*/ */
void ConnectionManager::telemetryDisconnected() void ConnectionManager::telemetryDisconnected()
{ {
qDebug() << "TelemetryMonitor: disconnected"; qDebug() << "ConnectionManager::telemetryDisconnected";
if (m_ioDev) { if (m_ioDev) {
if (m_connectionDevice.connection->shortName() == "Serial") { if (m_connectionDevice.connection->shortName() == "Serial") {
@ -297,17 +298,18 @@ void ConnectionManager::telemetryDisconnected()
void ConnectionManager::reconnectSlot() void ConnectionManager::reconnectSlot()
{ {
qDebug() << "reconnect"; qDebug() << "ConnectionManager::reconnectSlot";
if (m_ioDev->isOpen()) { if (m_ioDev->isOpen()) {
m_ioDev->close(); m_ioDev->close();
} }
if (m_ioDev->open(QIODevice::ReadWrite)) { if (m_ioDev->open(QIODevice::ReadWrite)) {
qDebug() << "reconnect successfull"; qDebug() << "ConnectionManager::reconnectSlot - reconnect successful";
reconnect->stop(); reconnect->stop();
reconnectCheck->start(20000); reconnectCheck->start(20000);
} else { } else {
qDebug() << "reconnect NOT successfull"; qDebug() << "ConnectionManager::reconnectSlot - reconnect NOT successful";
} }
} }
@ -328,7 +330,7 @@ DevListItem ConnectionManager::findDevice(const QString &devName)
} }
} }
qDebug() << "findDevice: cannot find " << devName << " in device list"; qWarning() << "ConnectionManager::findDevice - cannot find " << devName << " in device list";
DevListItem d; DevListItem d;
d.connection = NULL; d.connection = NULL;

View File

@ -89,7 +89,7 @@ void TelemetryMonitor::startRetrievingObjects()
} }
} }
// Start retrieving // Start retrieving
qDebug() << "TelemetryMonitor::startRetrievingObjects() - retrieving" << queue.length() << "objects"; qDebug() << "TelemetryMonitor::startRetrievingObjects - retrieving" << queue.length() << "objects";
retrieveNextObject(); retrieveNextObject();
} }
@ -98,7 +98,7 @@ void TelemetryMonitor::startRetrievingObjects()
*/ */
void TelemetryMonitor::stopRetrievingObjects() void TelemetryMonitor::stopRetrievingObjects()
{ {
qDebug("Object retrieval has been cancelled"); qDebug() << "TelemetryMonitor::stopRetrievingObjects - object retrieval has been cancelled";
queue.clear(); queue.clear();
} }
@ -109,7 +109,7 @@ void TelemetryMonitor::retrieveNextObject()
{ {
// If queue is empty return // If queue is empty return
if (queue.isEmpty()) { if (queue.isEmpty()) {
qDebug() << "TelemetryMonitor::retrieveNextObject - Object retrieval completed"; qDebug() << "TelemetryMonitor::retrieveNextObject - object retrieval completed";
if (firmwareIAPObj->getBoardType()) { if (firmwareIAPObj->getBoardType()) {
emit connected(); emit connected();
} else { } else {
@ -254,12 +254,12 @@ void TelemetryMonitor::processStatsUpdates()
// Act on new connections or disconnections // Act on new connections or disconnections
if (gcsStats.Status == GCSTelemetryStats::STATUS_CONNECTED && gcsStats.Status != oldStatus) { if (gcsStats.Status == GCSTelemetryStats::STATUS_CONNECTED && gcsStats.Status != oldStatus) {
statsTimer->setInterval(STATS_UPDATE_PERIOD_MS); statsTimer->setInterval(STATS_UPDATE_PERIOD_MS);
qDebug() << "TelemetryMonitor::processStatsUpdates() - connection with the autopilot established"; qDebug() << "TelemetryMonitor::processStatsUpdates - connection with the autopilot established";
startRetrievingObjects(); startRetrievingObjects();
} }
if (gcsStats.Status == GCSTelemetryStats::STATUS_DISCONNECTED && gcsStats.Status != oldStatus) { if (gcsStats.Status == GCSTelemetryStats::STATUS_DISCONNECTED && gcsStats.Status != oldStatus) {
statsTimer->setInterval(STATS_CONNECT_PERIOD_MS); statsTimer->setInterval(STATS_CONNECT_PERIOD_MS);
qDebug() << "TelemetryMonitor::processStatsUpdates() - Connection with the autopilot lost"; qDebug() << "TelemetryMonitor::processStatsUpdates - connection with the autopilot lost";
emit disconnected(); emit disconnected();
} }
} }