Commit 3c0c01d6 authored by Lorenz Meier's avatar Lorenz Meier

Mainwindow: Fix HIL config deletion

parent f10f22a7
...@@ -796,6 +796,7 @@ void MainWindow::connectCommonActions() ...@@ -796,6 +796,7 @@ void MainWindow::connectCommonActions()
// Connect internal actions // Connect internal actions
connect(UASManager::instance(), SIGNAL(UASCreated(UASInterface*)), this, SLOT(UASCreated(UASInterface*))); connect(UASManager::instance(), SIGNAL(UASCreated(UASInterface*)), this, SLOT(UASCreated(UASInterface*)));
connect(UASManager::instance(), SIGNAL(UASDeleted(int)), this, SLOT(UASDeleted(int)));
// Unmanned System controls // Unmanned System controls
connect(_ui.actionLiftoff, SIGNAL(triggered()), UASManager::instance(), SLOT(launchActiveUAS())); connect(_ui.actionLiftoff, SIGNAL(triggered()), UASManager::instance(), SLOT(launchActiveUAS()));
...@@ -909,6 +910,14 @@ void MainWindow::UASCreated(UASInterface* uas) ...@@ -909,6 +910,14 @@ void MainWindow::UASCreated(UASInterface* uas)
} }
} }
void MainWindow::UASDeleted(int uasId)
{
if (_mapUasId2HilDockWidget.contains(uasId)) {
_mapUasId2HilDockWidget[uasId]->deleteLater();
_mapUasId2HilDockWidget.remove(uasId);
}
}
/// Stores the state of the toolbar, status bar and widgets associated with the current view /// Stores the state of the toolbar, status bar and widgets associated with the current view
void MainWindow::_storeCurrentViewState(void) void MainWindow::_storeCurrentViewState(void)
{ {
......
...@@ -146,6 +146,9 @@ public slots: ...@@ -146,6 +146,9 @@ public slots:
/** @brief Add a new UAS */ /** @brief Add a new UAS */
void UASCreated(UASInterface* uas); void UASCreated(UASInterface* uas);
/** @brief Remove an old UAS */
void UASDeleted(int uasID);
void handleMisconfiguration(UASInterface* uas); void handleMisconfiguration(UASInterface* uas);
/** @brief Load configuration views */ /** @brief Load configuration views */
void loadSetupView(); void loadSetupView();
......
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