Commit 913c6417 authored by Michael Carpenter's avatar Michael Carpenter

Fix for layout glitch when using HIL Configuration, and added checks to see if...

Fix for layout glitch when using HIL Configuration, and added checks to see if there is an active UAS before attempting to connect HSIDisplay signals
parent af3fc38c
...@@ -178,7 +178,10 @@ HSIDisplay::HSIDisplay(QWidget *parent) : ...@@ -178,7 +178,10 @@ HSIDisplay::HSIDisplay(QWidget *parent) :
connect(&statusClearTimer, SIGNAL(timeout()), this, SLOT(clearStatusMessage())); connect(&statusClearTimer, SIGNAL(timeout()), this, SLOT(clearStatusMessage()));
statusClearTimer.start(3000); statusClearTimer.start(3000);
setActiveUAS(UASManager::instance()->getActiveUAS()); if (UASManager::instance()->getActiveUAS())
{
setActiveUAS(UASManager::instance()->getActiveUAS());
}
setFocusPolicy(Qt::StrongFocus); setFocusPolicy(Qt::StrongFocus);
} }
......
...@@ -345,8 +345,9 @@ QString MainWindow::getWindowStateKey() ...@@ -345,8 +345,9 @@ QString MainWindow::getWindowStateKey()
return QString::number(currentView)+"_windowstate_" + UASManager::instance()->getActiveUAS()->getAutopilotTypeName(); return QString::number(currentView)+"_windowstate_" + UASManager::instance()->getActiveUAS()->getAutopilotTypeName();
} }
else else
{
return QString::number(currentView)+"_windowstate"; return QString::number(currentView)+"_windowstate";
}
} }
QString MainWindow::getWindowGeometryKey() QString MainWindow::getWindowGeometryKey()
...@@ -727,7 +728,12 @@ void MainWindow::loadDockWidget(QString name) ...@@ -727,7 +728,12 @@ void MainWindow::loadDockWidget(QString name)
{ {
return; return;
} }
if (name == "UNMANNED_SYSTEM_CONTROL_DOCKWIDGET") if (name.startsWith("HIL_CONFIG"))
{
//It's a HIL widget.
showHILConfigurationWidget(UASManager::instance()->getActiveUAS());
}
else if (name == "UNMANNED_SYSTEM_CONTROL_DOCKWIDGET")
{ {
createDockWidget(centerStack->currentWidget(),new UASControlWidget(this),tr("Control"),"UNMANNED_SYSTEM_CONTROL_DOCKWIDGET",currentView,Qt::LeftDockWidgetArea); createDockWidget(centerStack->currentWidget(),new UASControlWidget(this),tr("Control"),"UNMANNED_SYSTEM_CONTROL_DOCKWIDGET",currentView,Qt::LeftDockWidgetArea);
} }
...@@ -906,8 +912,8 @@ void MainWindow::showHILConfigurationWidget(UASInterface* uas) ...@@ -906,8 +912,8 @@ void MainWindow::showHILConfigurationWidget(UASInterface* uas)
void MainWindow::closeEvent(QCloseEvent *event) void MainWindow::closeEvent(QCloseEvent *event)
{ {
if (isVisible()) storeViewState(); if (isVisible()) storeViewState();
storeSettings();
aboutToCloseFlag = true; aboutToCloseFlag = true;
storeSettings();
mavlink->storeSettings(); mavlink->storeSettings();
UASManager::instance()->storeSettings(); UASManager::instance()->storeSettings();
QMainWindow::closeEvent(event); QMainWindow::closeEvent(event);
...@@ -1748,7 +1754,8 @@ void MainWindow::UASCreated(UASInterface* uas) ...@@ -1748,7 +1754,8 @@ void MainWindow::UASCreated(UASInterface* uas)
connect(uas, SIGNAL(systemSpecsChanged(int)), this, SLOT(UASSpecsChanged(int))); connect(uas, SIGNAL(systemSpecsChanged(int)), this, SLOT(UASSpecsChanged(int)));
// HIL // HIL
showHILConfigurationWidget(uas); //We only want to show it when it's explicitly requested. This is now handled by loadViewState()
//showHILConfigurationWidget(uas);
if (!linechartWidget) if (!linechartWidget)
{ {
......
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