Commit 41866c2f authored by Don Gagne's avatar Don Gagne

Stop logging on last vehicle gone

parent 820e98a2
...@@ -108,6 +108,10 @@ void MAVLinkProtocol::setToolbox(QGCToolbox *toolbox) ...@@ -108,6 +108,10 @@ void MAVLinkProtocol::setToolbox(QGCToolbox *toolbox)
connect(this, &MAVLinkProtocol::protocolStatusMessage, _app, &QGCApplication::criticalMessageBoxOnMainThread); connect(this, &MAVLinkProtocol::protocolStatusMessage, _app, &QGCApplication::criticalMessageBoxOnMainThread);
connect(this, &MAVLinkProtocol::saveTempFlightDataLog, _app, &QGCApplication::saveTempFlightDataLogOnMainThread); connect(this, &MAVLinkProtocol::saveTempFlightDataLog, _app, &QGCApplication::saveTempFlightDataLogOnMainThread);
#ifndef __mobile__
connect(_multiVehicleManager->vehicles(), &QmlObjectListModel::countChanged, this, &MAVLinkProtocol::_vehicleCountChanged);
#endif
emit versionCheckChanged(m_enable_version_check); emit versionCheckChanged(m_enable_version_check);
} }
...@@ -217,13 +221,6 @@ void MAVLinkProtocol::_linkStatusChanged(LinkInterface* link, bool connected) ...@@ -217,13 +221,6 @@ void MAVLinkProtocol::_linkStatusChanged(LinkInterface* link, bool connected)
} }
Q_UNUSED(found); Q_UNUSED(found);
Q_ASSERT(found); Q_ASSERT(found);
#ifndef __mobile__
if (_connectedLinks.count() == 0) {
// Last link is gone, close out logging
_stopLogging();
}
#endif
} }
} }
...@@ -729,4 +726,12 @@ void MAVLinkProtocol::deleteTempLogFiles(void) ...@@ -729,4 +726,12 @@ void MAVLinkProtocol::deleteTempLogFiles(void)
QFile::remove(fileInfo.filePath()); QFile::remove(fileInfo.filePath());
} }
} }
void MAVLinkProtocol::_vehicleCountChanged(int count)
{
if (count == 0) {
// Last vehicle is gone, close out logging
_stopLogging();
}
}
#endif #endif
...@@ -283,6 +283,9 @@ signals: ...@@ -283,6 +283,9 @@ signals:
/// @brief Emitted when a temporary log file is ready for saving /// @brief Emitted when a temporary log file is ready for saving
void saveTempFlightDataLog(QString tempLogfile); void saveTempFlightDataLog(QString tempLogfile);
private slots:
void _vehicleCountChanged(int count);
private: private:
void _linkStatusChanged(LinkInterface* link, bool connected); void _linkStatusChanged(LinkInterface* link, bool connected);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment