Commit d25d3be9 authored by dongfang's avatar dongfang

Merge remote-tracking branch 'diydrones/mp_merge_new'

Added triple layout PFD
parents 76716145 5843b6ac
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -178,7 +178,10 @@ HSIDisplay::HSIDisplay(QWidget *parent) :
connect(&statusClearTimer, SIGNAL(timeout()), this, SLOT(clearStatusMessage()));
statusClearTimer.start(3000);
setActiveUAS(UASManager::instance()->getActiveUAS());
if (UASManager::instance()->getActiveUAS())
{
setActiveUAS(UASManager::instance()->getActiveUAS());
}
setFocusPolicy(Qt::StrongFocus);
}
......
......@@ -345,8 +345,9 @@ QString MainWindow::getWindowStateKey()
return QString::number(currentView)+"_windowstate_" + UASManager::instance()->getActiveUAS()->getAutopilotTypeName();
}
else
return QString::number(currentView)+"_windowstate";
{
return QString::number(currentView)+"_windowstate";
}
}
QString MainWindow::getWindowGeometryKey()
......@@ -727,7 +728,12 @@ void MainWindow::loadDockWidget(QString name)
{
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);
}
......@@ -883,26 +889,31 @@ void MainWindow::showHILConfigurationWidget(UASInterface* uas)
if (mav && !hilDocks.contains(mav->getUASID()))
{
//QGCToolWidget* tool = new QGCToolWidget("Unnamed Tool " + QString::number(ui.menuTools->actions().size()));
//createDockWidget(centerStack->currentWidget(),tool,"Unnamed Tool " + QString::number(ui.menuTools->actions().size()),"UNNAMED_TOOL_" + QString::number(ui.menuTools->actions().size())+"DOCK",currentView,Qt::BottomDockWidgetArea);
QGCHilConfiguration* hconf = new QGCHilConfiguration(mav, this);
QString hilDockName = tr("HIL Config (%1)").arg(uas->getUASName());
QDockWidget* hilDock = new QDockWidget(hilDockName, this);
hilDock->setWidget(hconf);
hilDock->setObjectName(QString("HIL_CONFIG_%1").arg(uas->getUASID()));
createDockWidget(centerStack->currentWidget(),hconf,hilDockName,QString("HIL_CONFIG_%1").arg(uas->getUASID()),currentView,Qt::LeftDockWidgetArea);
//QDockWidget* hilDock = new QDockWidget(hilDockName, this);
//hilDock->setWidget(hconf);
//hilDock->setObjectName(QString("HIL_CONFIG_%1").arg(uas->getUASID()));
//addTool(hilDock, hilDockName, Qt::LeftDockWidgetArea);
hilDocks.insert(mav->getUASID(), hilDock);
//hilDocks.insert(mav->getUASID(), hilDock);
if (currentView != VIEW_SIMULATION)
hilDock->hide();
else
hilDock->show();
//if (currentView != VIEW_SIMULATION)
// hilDock->hide();
//else
// hilDock->show();
}
}
void MainWindow::closeEvent(QCloseEvent *event)
{
if (isVisible()) storeViewState();
storeSettings();
aboutToCloseFlag = true;
storeSettings();
mavlink->storeSettings();
UASManager::instance()->storeSettings();
QMainWindow::closeEvent(event);
......@@ -1743,7 +1754,8 @@ void MainWindow::UASCreated(UASInterface* uas)
connect(uas, SIGNAL(systemSpecsChanged(int)), this, SLOT(UASSpecsChanged(int)));
// HIL
showHILConfigurationWidget(uas);
//We only want to show it when it's explicitly requested. This is now handled by loadViewState()
//showHILConfigurationWidget(uas);
if (!linechartWidget)
{
......
......@@ -275,7 +275,7 @@ void QGCVehicleConfig::loadQgcConfig(bool primary)
QPushButton *button = new QPushButton(ui->scrollAreaWidgetContents_3);
connect(button,SIGNAL(clicked()),this,SLOT(menuButtonClicked()));
ui->navBarLayout->insertWidget(2,button);
button->setMinimumHeight(100);
button->setMinimumHeight(75);
button->setMinimumWidth(100);
button->show();
button->setText(dir);
......@@ -328,7 +328,7 @@ void QGCVehicleConfig::loadQgcConfig(bool primary)
ui->stackedWidget->insertWidget(2,tab);
buttonToWidgetMap[button] = tab;
button->setMinimumHeight(100);
button->setMinimumHeight(75);
button->setMinimumWidth(100);
button->show();
button->setText(dir);
......
......@@ -13,18 +13,18 @@
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_11" stretch="1,2,1">
<layout class="QHBoxLayout" name="horizontalLayout_11" stretch="1,4,1">
<item>
<widget class="QScrollArea" name="scrollArea_6">
<property name="minimumSize">
<size>
<width>125</width>
<width>135</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>125</width>
<width>135</width>
<height>16777215</height>
</size>
</property>
......@@ -36,7 +36,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>123</width>
<width>133</width>
<height>582</height>
</rect>
</property>
......@@ -51,13 +51,13 @@
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
<height>75</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
......@@ -71,13 +71,7 @@ Calibration</string>
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
<height>75</height>
</size>
</property>
<property name="text">
......@@ -91,13 +85,7 @@ Calibration</string>
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
<height>75</height>
</size>
</property>
<property name="text">
......@@ -111,13 +99,7 @@ Config</string>
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
<height>75</height>
</size>
</property>
<property name="text">
......@@ -800,8 +782,8 @@ p, li { white-space: pre-wrap; }
<rect>
<x>0</x>
<y>0</y>
<width>314</width>
<height>508</height>
<width>98</width>
<height>28</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
......@@ -875,8 +857,8 @@ p, li { white-space: pre-wrap; }
<rect>
<x>0</x>
<y>0</y>
<width>314</width>
<height>434</height>
<width>98</width>
<height>28</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
......@@ -912,8 +894,8 @@ p, li { white-space: pre-wrap; }
<rect>
<x>0</x>
<y>0</y>
<width>313</width>
<height>434</height>
<width>98</width>
<height>28</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
......@@ -991,8 +973,8 @@ p, li { white-space: pre-wrap; }
<rect>
<x>0</x>
<y>0</y>
<width>161</width>
<height>446</height>
<width>98</width>
<height>28</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
......@@ -1028,8 +1010,8 @@ p, li { white-space: pre-wrap; }
<rect>
<x>0</x>
<y>0</y>
<width>160</width>
<height>446</height>
<width>98</width>
<height>28</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_8">
......@@ -1079,7 +1061,7 @@ p, li { white-space: pre-wrap; }
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<width>30</width>
<height>20</height>
</size>
</property>
......
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