diff --git a/src/qgcunittest/MockUASManager.cc b/src/qgcunittest/MockUASManager.cc index 960bafedec7d74cb3ba62bbcafbabad4b062a885..aa8a095662b87e54ab3d3ea22fff272c69a314ea 100644 --- a/src/qgcunittest/MockUASManager.cc +++ b/src/qgcunittest/MockUASManager.cc @@ -50,7 +50,6 @@ void MockUASManager::setMockActiveUAS(MockUAS* mockUAS) { // We don't support swiching between different UAS //_mockUAS->setSelected(); - emit activeUASSet(_mockUAS->getUASID()); emit activeUASStatusChanged(_mockUAS, true); emit activeUASStatusChanged(_mockUAS->getUASID(), true); } diff --git a/src/qgcunittest/MockUASManager.h b/src/qgcunittest/MockUASManager.h index 79d826477d0e737de22a72fd7bb9bccb6e44b80a..286f60920b9726b98e1ca482ea575e649858bff7 100644 --- a/src/qgcunittest/MockUASManager.h +++ b/src/qgcunittest/MockUASManager.h @@ -41,7 +41,6 @@ class MockUASManager : public UASManagerInterface signals: // The following signals from UASManager interface are supported: // void activeUASSet(UASInterface* UAS); - // void activeUASSet(int systemId); // void activeUASStatusChanged(UASInterface* UAS, bool active); // void activeUASStatusChanged(int systemId, bool active); diff --git a/src/uas/UASManager.cc b/src/uas/UASManager.cc index 875819c8e65d003d66ccf31a86b13f626055a75c..b749af1e28b4670502c91f64dac828b485595e99 100644 --- a/src/uas/UASManager.cc +++ b/src/uas/UASManager.cc @@ -473,7 +473,6 @@ void UASManager::setActiveUAS(UASInterface* uas) if (activeUAS) { activeUAS->setSelected(); - emit activeUASSet(activeUAS->getUASID()); emit activeUASSetListIndex(systems.indexOf(activeUAS)); emit activeUASStatusChanged(activeUAS, true); emit activeUASStatusChanged(activeUAS->getUASID(), true); diff --git a/src/uas/UASManagerInterface.h b/src/uas/UASManagerInterface.h index bf611c6d72b34e82033844dfc3932eea73fefcb4..6b49af394439c78a0cf298ab47999ac2277f4820 100644 --- a/src/uas/UASManagerInterface.h +++ b/src/uas/UASManagerInterface.h @@ -105,8 +105,6 @@ signals: /** @brief The UAS currently under main operator control changed */ void activeUASSet(UASInterface* UAS); /** @brief The UAS currently under main operator control changed */ - void activeUASSet(int systemId); - /** @brief The UAS currently under main operator control changed */ void activeUASSetListIndex(int listIndex); /** @brief The UAS currently under main operator control changed */ void activeUASStatusChanged(UASInterface* UAS, bool active); diff --git a/src/ui/QGCWaypointListMulti.cc b/src/ui/QGCWaypointListMulti.cc index ce34b7188221750ca10de52c9ed5d139b053a9d0..cf3e2bc685670834959b73a77fc6d9de5fa20058 100644 --- a/src/ui/QGCWaypointListMulti.cc +++ b/src/ui/QGCWaypointListMulti.cc @@ -9,8 +9,8 @@ QGCWaypointListMulti::QGCWaypointListMulti(QWidget *parent) : { ui->setupUi(this); setMinimumSize(600, 80); - connect(UASManager::instance(), SIGNAL(UASCreated(UASInterface*)), this, SLOT(systemCreated(UASInterface*))); - connect(UASManager::instance(), SIGNAL(activeUASSet(int)), this, SLOT(systemSetActive(int))); + connect(UASManager::instance(), &UASManager::UASCreated, this, &QGCWaypointListMulti::systemCreated); + connect(UASManager::instance(), &UASManager::activeUASSet, this, &QGCWaypointListMulti::systemSetActive); WaypointList* list = new WaypointList(ui->stackedWidget, UASManager::instance()->getActiveUASWaypointManager()); lists.insert(offline_uas_id, list); @@ -18,7 +18,7 @@ QGCWaypointListMulti::QGCWaypointListMulti(QWidget *parent) : if (UASManager::instance()->getActiveUAS()) { systemCreated(UASManager::instance()->getActiveUAS()); - systemSetActive(UASManager::instance()->getActiveUAS()->getUASID()); + systemSetActive(UASManager::instance()->getActiveUAS()); } } @@ -50,9 +50,9 @@ void QGCWaypointListMulti::systemCreated(UASInterface* uas) connect(uas, SIGNAL(destroyed(QObject*)), this, SLOT(systemDeleted(QObject*))); } -void QGCWaypointListMulti::systemSetActive(int uas) +void QGCWaypointListMulti::systemSetActive(UASInterface* uas) { - WaypointList* list = lists.value(uas, NULL); + WaypointList* list = lists.value(uas->getUASID(), NULL); if (list) { ui->stackedWidget->setCurrentWidget(list); } diff --git a/src/ui/QGCWaypointListMulti.h b/src/ui/QGCWaypointListMulti.h index 392d79ec1ef197b4bd00c913c2ab14126a02c9db..774f385e40e23b6edcda04ff893f28e4e07ee6b5 100644 --- a/src/ui/QGCWaypointListMulti.h +++ b/src/ui/QGCWaypointListMulti.h @@ -23,7 +23,7 @@ public: public slots: void systemDeleted(QObject* uas); void systemCreated(UASInterface* uas); - void systemSetActive(int uas); + void systemSetActive(UASInterface* uas); protected: quint16 offline_uas_id; diff --git a/src/ui/linechart/Linecharts.cc b/src/ui/linechart/Linecharts.cc index 750e082020d02f0663b63ddbe40b48223c1c8543..6e97aaef4365d2e6a01747b8d95990a97fcf042c 100644 --- a/src/ui/linechart/Linecharts.cc +++ b/src/ui/linechart/Linecharts.cc @@ -18,10 +18,7 @@ Linecharts::Linecharts(QWidget *parent) : foreach (UASInterface* sys, systems) { addSystem(sys); } - connect(UASManager::instance(), SIGNAL(UASCreated(UASInterface*)), - this, SLOT(addSystem(UASInterface*))); - connect(UASManager::instance(), SIGNAL(activeUASSet(int)), - this, SLOT(selectSystem(int))); + connect(UASManager::instance(), &UASManager::UASCreated, this, &Linecharts::addSystem); } void Linecharts::showEvent(QShowEvent* event) @@ -59,32 +56,6 @@ void Linecharts::hideEvent(QHideEvent* event) emit visibilityChanged(false); } -void Linecharts::selectSystem(int systemid) -{ - Q_UNUSED(systemid); -// QWidget* prevWidget = currentWidget(); -// if (prevWidget) -// { -// LinechartWidget* chart = dynamic_cast(prevWidget); -// if (chart) -// { -// chart->setActive(false); -// chart->setActiveSystem(systemid); -// } -// } -// QWidget* widget = plots.value(systemid, NULL); -// if (widget) -// { -// setCurrentWidget(widget); -// LinechartWidget* chart = dynamic_cast(widget); -// if (chart) -// { -// chart->setActive(true); -// chart->setActiveSystem(systemid); -// } -// } -} - void Linecharts::addSystem(UASInterface* uas) { // FIXME Add removeSystem() call diff --git a/src/ui/linechart/Linecharts.h b/src/ui/linechart/Linecharts.h index 20474b760999e3a98f42832aceab582462ba60fb..ced7734ebaee1e585dae4ed82eed52c8196025cf 100644 --- a/src/ui/linechart/Linecharts.h +++ b/src/ui/linechart/Linecharts.h @@ -20,8 +20,6 @@ signals: void visibilityChanged(bool visible); public slots: - /** @brief Select plot for one system */ - void selectSystem(int systemid); /** @brief Add a new system to the list of plots */ void addSystem(UASInterface* uas); /** @brief Add a new generic message source (not a system) */