1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +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)));
// setup our reconnect timers
// TODO these are never started because telemetryConnected is not called anymore
reconnect = new QTimer(this);
reconnectCheck = new QTimer(this);
connect(reconnect, SIGNAL(timeout()), this, SLOT(reconnectSlot()));
reconnectCheck = new QTimer(this);
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 *)));
}
// TODO needs documentation?
void ConnectionManager::addWidget(QWidget *widget)
{
@ -272,7 +273,7 @@ void ConnectionManager::onConnectClicked()
*/
void ConnectionManager::telemetryConnected()
{
qDebug() << "TelemetryMonitor: connected";
qDebug() << "ConnectionManager::telemetryConnected";
if (reconnectCheck->isActive()) {
reconnectCheck->stop();
@ -284,7 +285,7 @@ void ConnectionManager::telemetryConnected()
*/
void ConnectionManager::telemetryDisconnected()
{
qDebug() << "TelemetryMonitor: disconnected";
qDebug() << "ConnectionManager::telemetryDisconnected";
if (m_ioDev) {
if (m_connectionDevice.connection->shortName() == "Serial") {
@ -297,17 +298,18 @@ void ConnectionManager::telemetryDisconnected()
void ConnectionManager::reconnectSlot()
{
qDebug() << "reconnect";
qDebug() << "ConnectionManager::reconnectSlot";
if (m_ioDev->isOpen()) {
m_ioDev->close();
}
if (m_ioDev->open(QIODevice::ReadWrite)) {
qDebug() << "reconnect successfull";
qDebug() << "ConnectionManager::reconnectSlot - reconnect successful";
reconnect->stop();
reconnectCheck->start(20000);
} 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;
d.connection = NULL;

View File

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