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) : ...@@ -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);
} }
...@@ -883,26 +889,31 @@ void MainWindow::showHILConfigurationWidget(UASInterface* uas) ...@@ -883,26 +889,31 @@ void MainWindow::showHILConfigurationWidget(UASInterface* uas)
if (mav && !hilDocks.contains(mav->getUASID())) 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); QGCHilConfiguration* hconf = new QGCHilConfiguration(mav, this);
QString hilDockName = tr("HIL Config (%1)").arg(uas->getUASName()); QString hilDockName = tr("HIL Config (%1)").arg(uas->getUASName());
QDockWidget* hilDock = new QDockWidget(hilDockName, this); createDockWidget(centerStack->currentWidget(),hconf,hilDockName,QString("HIL_CONFIG_%1").arg(uas->getUASID()),currentView,Qt::LeftDockWidgetArea);
hilDock->setWidget(hconf); //QDockWidget* hilDock = new QDockWidget(hilDockName, this);
hilDock->setObjectName(QString("HIL_CONFIG_%1").arg(uas->getUASID())); //hilDock->setWidget(hconf);
//hilDock->setObjectName(QString("HIL_CONFIG_%1").arg(uas->getUASID()));
//addTool(hilDock, hilDockName, Qt::LeftDockWidgetArea); //addTool(hilDock, hilDockName, Qt::LeftDockWidgetArea);
hilDocks.insert(mav->getUASID(), hilDock); //hilDocks.insert(mav->getUASID(), hilDock);
if (currentView != VIEW_SIMULATION) //if (currentView != VIEW_SIMULATION)
hilDock->hide(); // hilDock->hide();
else //else
hilDock->show(); // hilDock->show();
} }
} }
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);
...@@ -1743,7 +1754,8 @@ void MainWindow::UASCreated(UASInterface* uas) ...@@ -1743,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)
{ {
......
...@@ -275,7 +275,7 @@ void QGCVehicleConfig::loadQgcConfig(bool primary) ...@@ -275,7 +275,7 @@ void QGCVehicleConfig::loadQgcConfig(bool primary)
QPushButton *button = new QPushButton(ui->scrollAreaWidgetContents_3); QPushButton *button = new QPushButton(ui->scrollAreaWidgetContents_3);
connect(button,SIGNAL(clicked()),this,SLOT(menuButtonClicked())); connect(button,SIGNAL(clicked()),this,SLOT(menuButtonClicked()));
ui->navBarLayout->insertWidget(2,button); ui->navBarLayout->insertWidget(2,button);
button->setMinimumHeight(100); button->setMinimumHeight(75);
button->setMinimumWidth(100); button->setMinimumWidth(100);
button->show(); button->show();
button->setText(dir); button->setText(dir);
...@@ -328,7 +328,7 @@ void QGCVehicleConfig::loadQgcConfig(bool primary) ...@@ -328,7 +328,7 @@ void QGCVehicleConfig::loadQgcConfig(bool primary)
ui->stackedWidget->insertWidget(2,tab); ui->stackedWidget->insertWidget(2,tab);
buttonToWidgetMap[button] = tab; buttonToWidgetMap[button] = tab;
button->setMinimumHeight(100); button->setMinimumHeight(75);
button->setMinimumWidth(100); button->setMinimumWidth(100);
button->show(); button->show();
button->setText(dir); button->setText(dir);
......
...@@ -13,18 +13,18 @@ ...@@ -13,18 +13,18 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_11" stretch="1,2,1"> <layout class="QHBoxLayout" name="horizontalLayout_11" stretch="1,4,1">
<item> <item>
<widget class="QScrollArea" name="scrollArea_6"> <widget class="QScrollArea" name="scrollArea_6">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>125</width> <width>135</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>125</width> <width>135</width>
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>123</width> <width>133</width>
<height>582</height> <height>582</height>
</rect> </rect>
</property> </property>
...@@ -51,13 +51,13 @@ ...@@ -51,13 +51,13 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>100</width>
<height>100</height> <height>75</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>100</width> <width>16777215</width>
<height>100</height> <height>16777215</height>
</size> </size>
</property> </property>
<property name="text"> <property name="text">
...@@ -71,13 +71,7 @@ Calibration</string> ...@@ -71,13 +71,7 @@ Calibration</string>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>100</width>
<height>100</height> <height>75</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size> </size>
</property> </property>
<property name="text"> <property name="text">
...@@ -91,13 +85,7 @@ Calibration</string> ...@@ -91,13 +85,7 @@ Calibration</string>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>100</width>
<height>100</height> <height>75</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size> </size>
</property> </property>
<property name="text"> <property name="text">
...@@ -111,13 +99,7 @@ Config</string> ...@@ -111,13 +99,7 @@ Config</string>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>100</width>
<height>100</height> <height>75</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size> </size>
</property> </property>
<property name="text"> <property name="text">
...@@ -800,8 +782,8 @@ p, li { white-space: pre-wrap; } ...@@ -800,8 +782,8 @@ p, li { white-space: pre-wrap; }
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>314</width> <width>98</width>
<height>508</height> <height>28</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_10"> <layout class="QVBoxLayout" name="verticalLayout_10">
...@@ -875,8 +857,8 @@ p, li { white-space: pre-wrap; } ...@@ -875,8 +857,8 @@ p, li { white-space: pre-wrap; }
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>314</width> <width>98</width>
<height>434</height> <height>28</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_4">
...@@ -912,8 +894,8 @@ p, li { white-space: pre-wrap; } ...@@ -912,8 +894,8 @@ p, li { white-space: pre-wrap; }
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>313</width> <width>98</width>
<height>434</height> <height>28</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_5"> <layout class="QHBoxLayout" name="horizontalLayout_5">
...@@ -991,8 +973,8 @@ p, li { white-space: pre-wrap; } ...@@ -991,8 +973,8 @@ p, li { white-space: pre-wrap; }
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>161</width> <width>98</width>
<height>446</height> <height>28</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_7"> <layout class="QVBoxLayout" name="verticalLayout_7">
...@@ -1028,8 +1010,8 @@ p, li { white-space: pre-wrap; } ...@@ -1028,8 +1010,8 @@ p, li { white-space: pre-wrap; }
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>160</width> <width>98</width>
<height>446</height> <height>28</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_8"> <layout class="QVBoxLayout" name="verticalLayout_8">
...@@ -1079,7 +1061,7 @@ p, li { white-space: pre-wrap; } ...@@ -1079,7 +1061,7 @@ p, li { white-space: pre-wrap; }
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>30</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </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