|
|
|
@ -44,7 +44,7 @@
@@ -44,7 +44,7 @@
|
|
|
|
|
* |
|
|
|
|
* @see QMainWindow::show() |
|
|
|
|
**/ |
|
|
|
|
MainWindow::MainWindow(QWidget *parent) : |
|
|
|
|
MainWindow::MainWindow(QWidget *parent): |
|
|
|
|
QMainWindow(parent), |
|
|
|
|
toolsMenuActions(), |
|
|
|
|
currentView(VIEW_MAVLINK), |
|
|
|
@ -90,8 +90,6 @@ MainWindow::~MainWindow()
@@ -90,8 +90,6 @@ MainWindow::~MainWindow()
|
|
|
|
|
statusBar = NULL; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::buildCommonWidgets() |
|
|
|
|
{ |
|
|
|
|
//TODO: move protocol outside UI
|
|
|
|
@ -128,6 +126,7 @@ void MainWindow::buildCommonWidgets()
@@ -128,6 +126,7 @@ void MainWindow::buildCommonWidgets()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MainWindow::buildPxWidgets() |
|
|
|
|
{ |
|
|
|
|
//FIXME: memory of acceptList will never be freed again
|
|
|
|
@ -146,18 +145,30 @@ void MainWindow::buildPxWidgets()
@@ -146,18 +145,30 @@ void MainWindow::buildPxWidgets()
|
|
|
|
|
|
|
|
|
|
// Center widgets
|
|
|
|
|
linechartWidget = new Linecharts(this); |
|
|
|
|
addToCentralWidgetsMenu(linechartWidget, "Line Plots", SLOT(showCentralWidget()), CENTRAL_LINECHART); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hudWidget = new HUD(320, 240, this); |
|
|
|
|
addToCentralWidgetsMenu(hudWidget, "HUD", SLOT(showCentralWidget()), CENTRAL_HUD); |
|
|
|
|
|
|
|
|
|
dataplotWidget = new QGCDataPlot2D(this); |
|
|
|
|
addToCentralWidgetsMenu(dataplotWidget, "Data Plots", SLOT(showCentralWidget()), CENTRAL_DATA_PLOT); |
|
|
|
|
|
|
|
|
|
#ifdef QGC_OSG_ENABLED |
|
|
|
|
_3DWidget = Q3DWidgetFactory::get("PIXHAWK"); |
|
|
|
|
addToCentralWidgetsMenu(_3DWidget, "Local 3D", SLOT(showCentralWidget()), CENTRAL_3D_LOCAL); |
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#ifdef QGC_OSGEARTH_ENABLED |
|
|
|
|
_3DMapWidget = Q3DWidgetFactory::get("MAP3D"); |
|
|
|
|
addToCentralWidgetsMenu(_3DMapWidget, "OSG Earth 3D", SLOT(showCentralWidget()), CENTRAL_OSGEARTH); |
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|
#if (defined Q_OS_WIN) | (defined Q_OS_MAC) |
|
|
|
|
gEarthWidget = new QGCGoogleEarthView(this); |
|
|
|
|
addToCentralWidgetsMenu(gEarthWidget, "Google Earth", SLOT(showCentralWidget()), CENTRAL_GOOGLE_EARTH); |
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
// Dock widgets
|
|
|
|
@ -244,10 +255,12 @@ void MainWindow::addToCentralWidgetsMenu ( QWidget* widget,
@@ -244,10 +255,12 @@ void MainWindow::addToCentralWidgetsMenu ( QWidget* widget,
|
|
|
|
|
TOOLS_WIDGET_NAMES centralWidget){ |
|
|
|
|
QAction* tempAction; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add the separator that will separate tools from central Widgets
|
|
|
|
|
if (!toolsMenuActions[CENTRAL_SEPARATOR]){ |
|
|
|
|
tempAction = ui.menuTools->addSeparator(); |
|
|
|
|
toolsMenuActions[CENTRAL_SEPARATOR] = tempAction; |
|
|
|
|
tempAction->setData(CENTRAL_SEPARATOR); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
tempAction = ui.menuTools->addAction(title); |
|
|
|
@ -264,9 +277,10 @@ void MainWindow::addToCentralWidgetsMenu ( QWidget* widget,
@@ -264,9 +277,10 @@ void MainWindow::addToCentralWidgetsMenu ( QWidget* widget,
|
|
|
|
|
if (!settings.contains(chKey)){ |
|
|
|
|
settings.setValue(chKey,false); |
|
|
|
|
tempAction->setChecked(false); |
|
|
|
|
} else { |
|
|
|
|
tempAction->setChecked(settings.value(chKey).toBool()); |
|
|
|
|
} |
|
|
|
|
// else {
|
|
|
|
|
// tempAction->setChecked(settings.value(chKey).toBool());
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// connect the action
|
|
|
|
|
connect(tempAction,SIGNAL(triggered()),this, slotName); |
|
|
|
@ -279,14 +293,16 @@ void MainWindow::showCentralWidget(){
@@ -279,14 +293,16 @@ void MainWindow::showCentralWidget(){
|
|
|
|
|
int tool = senderAction->data().toInt(); |
|
|
|
|
QString chKey; |
|
|
|
|
|
|
|
|
|
// check the current action
|
|
|
|
|
|
|
|
|
|
if (senderAction && dockWidgets[tool]){ |
|
|
|
|
|
|
|
|
|
// uncheck all central widget actions
|
|
|
|
|
QHashIterator<int, QAction*> i(toolsMenuActions); |
|
|
|
|
while (i.hasNext()) { |
|
|
|
|
i.next(); |
|
|
|
|
|
|
|
|
|
if (i.value()->data().toInt() >= 255){ |
|
|
|
|
i.next(); |
|
|
|
|
qDebug() << "shCW" << i.key() << "read"; |
|
|
|
|
if (i.value() && i.value()->data().toInt() > 255){ |
|
|
|
|
i.value()->setChecked(false); |
|
|
|
|
|
|
|
|
|
// update the settings
|
|
|
|
@ -296,6 +312,7 @@ void MainWindow::showCentralWidget(){
@@ -296,6 +312,7 @@ void MainWindow::showCentralWidget(){
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// check the current action
|
|
|
|
|
qDebug() << senderAction->text(); |
|
|
|
|
senderAction->setChecked(true); |
|
|
|
|
|
|
|
|
|
// update the central widget
|
|
|
|
@ -304,6 +321,8 @@ void MainWindow::showCentralWidget(){
@@ -304,6 +321,8 @@ void MainWindow::showCentralWidget(){
|
|
|
|
|
// store the selected central widget
|
|
|
|
|
chKey = buildMenuKey (SUB_SECTION_CHECKED,static_cast<TOOLS_WIDGET_NAMES>(tool), currentView); |
|
|
|
|
settings.setValue(chKey,true); |
|
|
|
|
|
|
|
|
|
presentView(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -315,6 +334,7 @@ void MainWindow::addToToolsMenu ( QWidget* widget,
@@ -315,6 +334,7 @@ void MainWindow::addToToolsMenu ( QWidget* widget,
|
|
|
|
|
QAction* tempAction; |
|
|
|
|
QString posKey, chKey; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (toolsMenuActions[CENTRAL_SEPARATOR]){ |
|
|
|
|
tempAction = new QAction(title, this); |
|
|
|
|
ui.menuTools->insertAction(toolsMenuActions[CENTRAL_SEPARATOR], |
|
|
|
@ -329,6 +349,7 @@ void MainWindow::addToToolsMenu ( QWidget* widget,
@@ -329,6 +349,7 @@ void MainWindow::addToToolsMenu ( QWidget* widget,
|
|
|
|
|
// populate the Hashes
|
|
|
|
|
toolsMenuActions[tool] = tempAction; |
|
|
|
|
dockWidgets[tool] = widget; |
|
|
|
|
qDebug() << widget; |
|
|
|
|
|
|
|
|
|
posKey = buildMenuKey (SUB_SECTION_LOCATION,tool, currentView); |
|
|
|
|
|
|
|
|
@ -351,14 +372,55 @@ void MainWindow::addToToolsMenu ( QWidget* widget,
@@ -351,14 +372,55 @@ void MainWindow::addToToolsMenu ( QWidget* widget,
|
|
|
|
|
// connect the action
|
|
|
|
|
connect(tempAction,SIGNAL(triggered()),this, slotName); |
|
|
|
|
|
|
|
|
|
connect(static_cast <QDockWidget *>(dockWidgets[tool]), |
|
|
|
|
connect(qobject_cast <QDockWidget *>(dockWidgets[tool]), |
|
|
|
|
SIGNAL(visibilityChanged(bool)), this, SLOT(updateVisibilitySettings(bool))); |
|
|
|
|
|
|
|
|
|
connect(static_cast <QDockWidget *>(dockWidgets[tool]), |
|
|
|
|
connect(qobject_cast <QDockWidget *>(dockWidgets[tool]), |
|
|
|
|
SIGNAL(dockLocationChanged(Qt::DockWidgetArea)), this, SLOT(updateLocationSettings(Qt::DockWidgetArea))); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MainWindow::showToolWidget(){ |
|
|
|
|
QAction* temp = qobject_cast<QAction *>(sender()); |
|
|
|
|
int tool = temp->data().toInt(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (temp && dockWidgets[tool]){ |
|
|
|
|
if (temp->isChecked()){ |
|
|
|
|
addDockWidget(dockWidgetLocations[tool], qobject_cast<QDockWidget *> (dockWidgets[tool])); |
|
|
|
|
qobject_cast<QDockWidget *>(dockWidgets[tool])->show(); |
|
|
|
|
} else { |
|
|
|
|
removeDockWidget(qobject_cast<QDockWidget *>(dockWidgets[tool])); |
|
|
|
|
} |
|
|
|
|
QString chKey = buildMenuKey (SUB_SECTION_CHECKED,static_cast<TOOLS_WIDGET_NAMES>(tool), currentView); |
|
|
|
|
settings.setValue(chKey,temp->isChecked()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::showTheWidget (TOOLS_WIDGET_NAMES widget, VIEW_SECTIONS view){ |
|
|
|
|
bool tempVisible; |
|
|
|
|
Qt::DockWidgetArea tempLocation; |
|
|
|
|
QDockWidget* tempWidget = static_cast <QDockWidget *>(dockWidgets[widget]); |
|
|
|
|
|
|
|
|
|
tempVisible = settings.value(buildMenuKey (SUB_SECTION_CHECKED,widget,view)).toBool(); |
|
|
|
|
|
|
|
|
|
if (tempWidget){ |
|
|
|
|
toolsMenuActions[widget]->setChecked(tempVisible); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//qDebug() << buildMenuKey (SUB_SECTION_CHECKED,widget,view) << tempVisible;
|
|
|
|
|
|
|
|
|
|
tempLocation = static_cast <Qt::DockWidgetArea>(settings.value(buildMenuKey (SUB_SECTION_LOCATION,widget, view)).toInt()); |
|
|
|
|
|
|
|
|
|
if (tempWidget && tempVisible){ |
|
|
|
|
addDockWidget(tempLocation, tempWidget); |
|
|
|
|
tempWidget->show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QString MainWindow::buildMenuKey(SETTINGS_SECTIONS section, TOOLS_WIDGET_NAMES tool, VIEW_SECTIONS view){ |
|
|
|
|
// Key is built as follows: autopilot_type/section_menu/view/tool/section
|
|
|
|
|
int apType; |
|
|
|
@ -374,24 +436,6 @@ QString MainWindow::buildMenuKey(SETTINGS_SECTIONS section, TOOLS_WIDGET_NAMES t
@@ -374,24 +436,6 @@ QString MainWindow::buildMenuKey(SETTINGS_SECTIONS section, TOOLS_WIDGET_NAMES t
|
|
|
|
|
QString::number(section) + "/" ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::showToolWidget(){ |
|
|
|
|
QAction* temp = qobject_cast<QAction *>(sender()); |
|
|
|
|
int tool = temp->data().toInt(); |
|
|
|
|
|
|
|
|
|
if (temp && dockWidgets[tool]){ |
|
|
|
|
if (temp->isChecked()){ |
|
|
|
|
addDockWidget(dockWidgetLocations[tool], static_cast <QDockWidget *> (dockWidgets[tool])); |
|
|
|
|
static_cast <QDockWidget *>(dockWidgets[tool])->show(); |
|
|
|
|
} else { |
|
|
|
|
removeDockWidget(static_cast <QDockWidget *>(dockWidgets[tool])); |
|
|
|
|
} |
|
|
|
|
QString chKey = buildMenuKey (SUB_SECTION_CHECKED,static_cast<TOOLS_WIDGET_NAMES>(tool), currentView); |
|
|
|
|
settings.setValue(chKey,temp->isChecked()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::updateVisibilitySettings (bool vis){ |
|
|
|
|
Q_UNUSED(vis); |
|
|
|
|
|
|
|
|
@ -974,359 +1018,109 @@ void MainWindow::clearView()
@@ -974,359 +1018,109 @@ void MainWindow::clearView()
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MainWindow::loadSlugsView() |
|
|
|
|
void MainWindow::loadEngineerView() |
|
|
|
|
{ |
|
|
|
|
clearView(); |
|
|
|
|
// Engineer view, used in EMAV2009
|
|
|
|
|
|
|
|
|
|
// LINE CHART
|
|
|
|
|
if (linechartWidget) |
|
|
|
|
{ |
|
|
|
|
QStackedWidget *centerStack = dynamic_cast<QStackedWidget*>(centralWidget()); |
|
|
|
|
if (centerStack) |
|
|
|
|
{ |
|
|
|
|
linechartWidget->setActive(true); |
|
|
|
|
centerStack->setCurrentWidget(linechartWidget); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// UAS CONTROL
|
|
|
|
|
if (controlDockWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::LeftDockWidgetArea, controlDockWidget); |
|
|
|
|
controlDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// UAS LIST
|
|
|
|
|
if (listDockWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, listDockWidget); |
|
|
|
|
listDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// UAS STATUS
|
|
|
|
|
if (infoDockWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::LeftDockWidgetArea, infoDockWidget); |
|
|
|
|
infoDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// WAYPOINT LIST
|
|
|
|
|
if (waypointsDockWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, waypointsDockWidget); |
|
|
|
|
waypointsDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// DEBUG CONSOLE
|
|
|
|
|
if (debugConsoleDockWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, debugConsoleDockWidget); |
|
|
|
|
debugConsoleDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
clearView(); |
|
|
|
|
|
|
|
|
|
// Slugs Data View
|
|
|
|
|
if (slugsDataWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::RightDockWidgetArea, slugsDataWidget); |
|
|
|
|
slugsDataWidget->show(); |
|
|
|
|
} |
|
|
|
|
currentView = VIEW_ENGINEER; |
|
|
|
|
|
|
|
|
|
// Slugs Data View
|
|
|
|
|
if (slugsHilSimWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::LeftDockWidgetArea, slugsHilSimWidget); |
|
|
|
|
slugsHilSimWidget->show(); |
|
|
|
|
} |
|
|
|
|
this->show(); |
|
|
|
|
presentView(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MainWindow::loadPixhawkEngineerView() |
|
|
|
|
void MainWindow::loadOperatorView() |
|
|
|
|
{ |
|
|
|
|
clearView(); |
|
|
|
|
|
|
|
|
|
currentView = VIEW_OPERATOR; |
|
|
|
|
|
|
|
|
|
presentView(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MainWindow::loadDataView() |
|
|
|
|
void MainWindow::loadPilotView() |
|
|
|
|
{ |
|
|
|
|
clearView(); |
|
|
|
|
|
|
|
|
|
// DATAPLOT
|
|
|
|
|
if (dataplotWidget) |
|
|
|
|
{ |
|
|
|
|
QStackedWidget *centerStack = dynamic_cast<QStackedWidget*>(centralWidget()); |
|
|
|
|
if (centerStack) |
|
|
|
|
centerStack->setCurrentWidget(dataplotWidget); |
|
|
|
|
} |
|
|
|
|
currentView = VIEW_PILOT; |
|
|
|
|
|
|
|
|
|
presentView(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MainWindow::loadDataView(QString fileName) |
|
|
|
|
void MainWindow::loadMAVLinkView() |
|
|
|
|
{ |
|
|
|
|
clearView(); |
|
|
|
|
|
|
|
|
|
// DATAPLOT
|
|
|
|
|
if (dataplotWidget) |
|
|
|
|
{ |
|
|
|
|
QStackedWidget *centerStack = dynamic_cast<QStackedWidget*>(centralWidget()); |
|
|
|
|
if (centerStack) |
|
|
|
|
{ |
|
|
|
|
centerStack->setCurrentWidget(dataplotWidget); |
|
|
|
|
dataplotWidget->loadFile(fileName); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
currentView = VIEW_MAVLINK; |
|
|
|
|
|
|
|
|
|
presentView(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MainWindow::presentView() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef QGC_OSG_ENABLED |
|
|
|
|
// 3D map
|
|
|
|
|
if (_3DWidget) |
|
|
|
|
{ |
|
|
|
|
if (centerStack) |
|
|
|
|
{ |
|
|
|
|
//map3DWidget->setActive(true);
|
|
|
|
|
centerStack->setCurrentWidget(_3DWidget); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
qDebug() << "LC"; |
|
|
|
|
if (linechartWidget){ |
|
|
|
|
qDebug () << buildMenuKey (SUB_SECTION_CHECKED,CENTRAL_LINECHART,currentView) << |
|
|
|
|
settings.value(buildMenuKey (SUB_SECTION_CHECKED,CENTRAL_LINECHART,currentView)).toBool() ; |
|
|
|
|
if (settings.value(buildMenuKey (SUB_SECTION_CHECKED,CENTRAL_LINECHART,currentView)).toBool()){ |
|
|
|
|
if (centerStack) { |
|
|
|
|
linechartWidget->setActive(true); |
|
|
|
|
centerStack->setCurrentWidget(linechartWidget); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
linechartWidget->setActive(false); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MainWindow::loadSlugsEngineerView() |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MainWindow::load3DMapView() |
|
|
|
|
{ |
|
|
|
|
#ifdef QGC_OSGEARTH_ENABLED |
|
|
|
|
clearView(); |
|
|
|
|
// MAP
|
|
|
|
|
qDebug() << "MAP"; |
|
|
|
|
showTheCentralWidget(CENTRAL_MAP, currentView); |
|
|
|
|
|
|
|
|
|
// 3D map
|
|
|
|
|
if (_3DMapWidget) |
|
|
|
|
{ |
|
|
|
|
QStackedWidget *centerStack = dynamic_cast<QStackedWidget*>(centralWidget()); |
|
|
|
|
if (centerStack) |
|
|
|
|
{ |
|
|
|
|
//map3DWidget->setActive(true);
|
|
|
|
|
centerStack->setCurrentWidget(_3DMapWidget); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// PROTOCOL
|
|
|
|
|
qDebug() << "CP"; |
|
|
|
|
showTheCentralWidget(CENTRAL_PROTOCOL, currentView); |
|
|
|
|
|
|
|
|
|
// UAS CONTROL
|
|
|
|
|
if (controlDockWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::LeftDockWidgetArea, controlDockWidget); |
|
|
|
|
controlDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
// HEAD UP DISPLAY
|
|
|
|
|
qDebug() << "HUD"; |
|
|
|
|
if (hudWidget){ |
|
|
|
|
qDebug() << buildMenuKey(SUB_SECTION_CHECKED,CENTRAL_HUD,currentView) << |
|
|
|
|
settings.value(buildMenuKey (SUB_SECTION_CHECKED,CENTRAL_HUD,currentView)).toBool(); |
|
|
|
|
if (settings.value(buildMenuKey (SUB_SECTION_CHECKED,CENTRAL_HUD,currentView)).toBool()){ |
|
|
|
|
if (centerStack) { |
|
|
|
|
centerStack->setCurrentWidget(hudWidget); |
|
|
|
|
hudWidget->start(); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
hudWidget->stop(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// UAS LIST
|
|
|
|
|
if (listDockWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, listDockWidget); |
|
|
|
|
listDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
// Show docked widgets based on current view and autopilot type
|
|
|
|
|
|
|
|
|
|
// WAYPOINT LIST
|
|
|
|
|
if (waypointsDockWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, waypointsDockWidget); |
|
|
|
|
waypointsDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
// UAS CONTROL
|
|
|
|
|
showTheWidget(MENU_UAS_CONTROL, currentView); |
|
|
|
|
|
|
|
|
|
// HORIZONTAL SITUATION INDICATOR
|
|
|
|
|
if (hsiDockWidget) |
|
|
|
|
{ |
|
|
|
|
HSIDisplay* hsi = dynamic_cast<HSIDisplay*>( hsiDockWidget->widget() ); |
|
|
|
|
if (hsi) |
|
|
|
|
{ |
|
|
|
|
hsi->start(); |
|
|
|
|
addDockWidget(Qt::LeftDockWidgetArea, hsiDockWidget); |
|
|
|
|
hsiDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
this->show(); |
|
|
|
|
} |
|
|
|
|
// UAS LIST
|
|
|
|
|
showTheWidget(MENU_UAS_LIST, currentView); |
|
|
|
|
|
|
|
|
|
void MainWindow::loadGoogleEarthView() |
|
|
|
|
{ |
|
|
|
|
#if (defined Q_OS_WIN) | (defined Q_OS_MAC) |
|
|
|
|
clearView(); |
|
|
|
|
// WAYPOINT LIST
|
|
|
|
|
showTheWidget(MENU_WAYPOINTS, currentView); |
|
|
|
|
|
|
|
|
|
// 3D map
|
|
|
|
|
if (gEarthWidget) |
|
|
|
|
{ |
|
|
|
|
QStackedWidget *centerStack = dynamic_cast<QStackedWidget*>(centralWidget()); |
|
|
|
|
if (centerStack) |
|
|
|
|
{ |
|
|
|
|
centerStack->setCurrentWidget(gEarthWidget); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// UAS CONTROL
|
|
|
|
|
if (controlDockWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::LeftDockWidgetArea, controlDockWidget); |
|
|
|
|
controlDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// UAS LIST
|
|
|
|
|
if (listDockWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, listDockWidget); |
|
|
|
|
listDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// WAYPOINT LIST
|
|
|
|
|
if (waypointsDockWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, waypointsDockWidget); |
|
|
|
|
waypointsDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// HORIZONTAL SITUATION INDICATOR
|
|
|
|
|
if (hsiDockWidget) |
|
|
|
|
{ |
|
|
|
|
HSIDisplay* hsi = dynamic_cast<HSIDisplay*>( hsiDockWidget->widget() ); |
|
|
|
|
if (hsi) |
|
|
|
|
{ |
|
|
|
|
hsi->start(); |
|
|
|
|
addDockWidget(Qt::LeftDockWidgetArea, hsiDockWidget); |
|
|
|
|
hsiDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this->show(); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::load3DView() |
|
|
|
|
{ |
|
|
|
|
#ifdef QGC_OSG_ENABLED |
|
|
|
|
clearView(); |
|
|
|
|
|
|
|
|
|
// 3D map
|
|
|
|
|
if (_3DWidget) |
|
|
|
|
{ |
|
|
|
|
QStackedWidget *centerStack = dynamic_cast<QStackedWidget*>(centralWidget()); |
|
|
|
|
if (centerStack) |
|
|
|
|
{ |
|
|
|
|
//map3DWidget->setActive(true);
|
|
|
|
|
centerStack->setCurrentWidget(_3DWidget); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// UAS CONTROL
|
|
|
|
|
if (controlDockWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::LeftDockWidgetArea, controlDockWidget); |
|
|
|
|
controlDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// UAS LIST
|
|
|
|
|
if (listDockWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, listDockWidget); |
|
|
|
|
listDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// WAYPOINT LIST
|
|
|
|
|
if (waypointsDockWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, waypointsDockWidget); |
|
|
|
|
waypointsDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// HORIZONTAL SITUATION INDICATOR
|
|
|
|
|
if (hsiDockWidget) |
|
|
|
|
{ |
|
|
|
|
HSIDisplay* hsi = dynamic_cast<HSIDisplay*>( hsiDockWidget->widget() ); |
|
|
|
|
if (hsi) |
|
|
|
|
{ |
|
|
|
|
hsi->start(); |
|
|
|
|
addDockWidget(Qt::LeftDockWidgetArea, hsiDockWidget); |
|
|
|
|
hsiDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
this->show(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MainWindow::loadEngineerView() |
|
|
|
|
{ |
|
|
|
|
clearView(); |
|
|
|
|
|
|
|
|
|
currentView = VIEW_ENGINEER; |
|
|
|
|
|
|
|
|
|
presentView(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MainWindow::loadOperatorView() |
|
|
|
|
{ |
|
|
|
|
clearView(); |
|
|
|
|
|
|
|
|
|
currentView = VIEW_OPERATOR; |
|
|
|
|
|
|
|
|
|
presentView(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MainWindow::loadPilotView() |
|
|
|
|
{ |
|
|
|
|
clearView(); |
|
|
|
|
|
|
|
|
|
currentView = VIEW_PILOT; |
|
|
|
|
|
|
|
|
|
presentView(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MainWindow::loadMAVLinkView() |
|
|
|
|
{ |
|
|
|
|
clearView(); |
|
|
|
|
|
|
|
|
|
currentView = VIEW_MAVLINK; |
|
|
|
|
|
|
|
|
|
presentView(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MainWindow::presentView() { |
|
|
|
|
|
|
|
|
|
#ifdef QGC_OSG_ENABLED |
|
|
|
|
// 3D map
|
|
|
|
|
if (_3DWidget) |
|
|
|
|
{ |
|
|
|
|
if (centerStack) |
|
|
|
|
{ |
|
|
|
|
//map3DWidget->setActive(true);
|
|
|
|
|
centerStack->setCurrentWidget(_3DWidget); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#else |
|
|
|
|
|
|
|
|
|
showCentralWidget(CENTRAL_LINECHART, currentView); |
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
// MAP
|
|
|
|
|
showCentralWidget(CENTRAL_MAP, currentView); |
|
|
|
|
|
|
|
|
|
// PROTOCOL
|
|
|
|
|
showCentralWidget(CENTRAL_PROTOCOL, currentView); |
|
|
|
|
|
|
|
|
|
// HEAD UP DISPLAY
|
|
|
|
|
if (hudWidget && |
|
|
|
|
settings.value(buildMenuKey (SUB_SECTION_CHECKED,MENU_HSI,currentView)).toBool()){ |
|
|
|
|
if (centerStack) |
|
|
|
|
{ |
|
|
|
|
//map3DWidget->setActive(true);
|
|
|
|
|
centerStack->setCurrentWidget(hudWidget); |
|
|
|
|
hudWidget->start(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Show docked widgets based on current view and autopilot type
|
|
|
|
|
|
|
|
|
|
// UAS CONTROL
|
|
|
|
|
showTheWidget(MENU_UAS_CONTROL, currentView); |
|
|
|
|
|
|
|
|
|
// UAS LIST
|
|
|
|
|
showTheWidget(MENU_UAS_LIST, currentView); |
|
|
|
|
|
|
|
|
|
// WAYPOINT LIST
|
|
|
|
|
showTheWidget(MENU_WAYPOINTS, currentView); |
|
|
|
|
|
|
|
|
|
// UAS STATUS
|
|
|
|
|
showTheWidget(MENU_STATUS, currentView); |
|
|
|
|
// UAS STATUS
|
|
|
|
|
showTheWidget(MENU_STATUS, currentView); |
|
|
|
|
|
|
|
|
|
// DETECTION
|
|
|
|
|
showTheWidget(MENU_DETECTION, currentView); |
|
|
|
@ -1342,6 +1136,22 @@ void MainWindow::presentView() {
@@ -1342,6 +1136,22 @@ void MainWindow::presentView() {
|
|
|
|
|
|
|
|
|
|
// HUD
|
|
|
|
|
showTheWidget(MENU_HUD, currentView); |
|
|
|
|
if (headUpDockWidget) |
|
|
|
|
{ |
|
|
|
|
HUD* tmpHud = dynamic_cast<HUD*>( headUpDockWidget->widget() ); |
|
|
|
|
if (tmpHud){ |
|
|
|
|
if (settings.value(buildMenuKey (SUB_SECTION_CHECKED,MENU_HUD,currentView)).toBool()){ |
|
|
|
|
tmpHud->start(); |
|
|
|
|
addDockWidget(static_cast <Qt::DockWidgetArea>(settings.value(buildMenuKey (SUB_SECTION_LOCATION,MENU_HUD, currentView)).toInt()), |
|
|
|
|
hsiDockWidget); |
|
|
|
|
headUpDockWidget->show(); |
|
|
|
|
} else { |
|
|
|
|
tmpHud->stop(); |
|
|
|
|
headUpDockWidget->hide(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// RC View
|
|
|
|
|
showTheWidget(MENU_RC_VIEW, currentView); |
|
|
|
@ -1359,45 +1169,56 @@ void MainWindow::presentView() {
@@ -1359,45 +1169,56 @@ void MainWindow::presentView() {
|
|
|
|
|
showTheWidget(MENU_SLUGS_CAMERA, currentView); |
|
|
|
|
|
|
|
|
|
// HORIZONTAL SITUATION INDICATOR
|
|
|
|
|
showTheWidget(MENU_HSI, currentView); |
|
|
|
|
if (hsiDockWidget) |
|
|
|
|
{ |
|
|
|
|
HSIDisplay* hsi = dynamic_cast<HSIDisplay*>( hsiDockWidget->widget() ); |
|
|
|
|
if (hsi && |
|
|
|
|
settings.value(buildMenuKey (SUB_SECTION_CHECKED,MENU_HSI,currentView)).toBool()) |
|
|
|
|
{ |
|
|
|
|
if (hsi){ |
|
|
|
|
if (settings.value(buildMenuKey (SUB_SECTION_CHECKED,MENU_HSI,currentView)).toBool()){ |
|
|
|
|
hsi->start(); |
|
|
|
|
addDockWidget(static_cast <Qt::DockWidgetArea>(settings.value(buildMenuKey (SUB_SECTION_LOCATION,MENU_HSI, currentView)).toInt()), |
|
|
|
|
hsiDockWidget); |
|
|
|
|
hsiDockWidget->show(); |
|
|
|
|
} else { |
|
|
|
|
hsi->stop(); |
|
|
|
|
hsiDockWidget->hide(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// HEAD DOWN 1
|
|
|
|
|
showTheWidget(MENU_HDD_1, currentView); |
|
|
|
|
if (headDown1DockWidget) |
|
|
|
|
{ |
|
|
|
|
HDDisplay *hdd = dynamic_cast<HDDisplay*>(headDown1DockWidget->widget()); |
|
|
|
|
if (hdd && |
|
|
|
|
settings.value(buildMenuKey (SUB_SECTION_CHECKED,MENU_HDD_1,currentView)).toBool()) |
|
|
|
|
{ |
|
|
|
|
if (hdd) { |
|
|
|
|
if (settings.value(buildMenuKey (SUB_SECTION_CHECKED,MENU_HDD_1,currentView)).toBool()) { |
|
|
|
|
addDockWidget(static_cast <Qt::DockWidgetArea>(settings.value(buildMenuKey (SUB_SECTION_LOCATION,MENU_HDD_1, currentView)).toInt()), |
|
|
|
|
headDown1DockWidget); |
|
|
|
|
headDown1DockWidget->show(); |
|
|
|
|
hdd->start(); |
|
|
|
|
} else { |
|
|
|
|
headDown1DockWidget->hide();; |
|
|
|
|
hdd->stop(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// HEAD DOWN 2
|
|
|
|
|
showTheWidget(MENU_HDD_2, currentView); |
|
|
|
|
if (headDown2DockWidget) |
|
|
|
|
{ |
|
|
|
|
HDDisplay *hdd = dynamic_cast<HDDisplay*>(headDown2DockWidget->widget()); |
|
|
|
|
if (hdd && |
|
|
|
|
settings.value(buildMenuKey (SUB_SECTION_CHECKED,MENU_HDD_2,currentView)).toBool()) |
|
|
|
|
{ |
|
|
|
|
if (hdd){ |
|
|
|
|
if (settings.value(buildMenuKey (SUB_SECTION_CHECKED,MENU_HDD_2,currentView)).toBool()){ |
|
|
|
|
addDockWidget(static_cast <Qt::DockWidgetArea>(settings.value(buildMenuKey (SUB_SECTION_LOCATION,MENU_HDD_2, currentView)).toInt()), |
|
|
|
|
headDown2DockWidget); |
|
|
|
|
headDown2DockWidget->show(); |
|
|
|
|
hdd->start(); |
|
|
|
|
} else { |
|
|
|
|
headDown2DockWidget->hide(); |
|
|
|
|
hdd->stop(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1407,36 +1228,13 @@ void MainWindow::presentView() {
@@ -1407,36 +1228,13 @@ void MainWindow::presentView() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::showTheWidget (TOOLS_WIDGET_NAMES widget, VIEW_SECTIONS view){ |
|
|
|
|
bool tempVisible; |
|
|
|
|
Qt::DockWidgetArea tempLocation; |
|
|
|
|
QDockWidget* tempWidget = static_cast <QDockWidget *>(dockWidgets[widget]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tempVisible = settings.value(buildMenuKey (SUB_SECTION_CHECKED,widget,view)).toBool(); |
|
|
|
|
|
|
|
|
|
if (toolsMenuActions[widget]){ |
|
|
|
|
toolsMenuActions[widget]->setChecked(tempVisible); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
qDebug() << buildMenuKey (SUB_SECTION_CHECKED,widget,view) << tempVisible; |
|
|
|
|
|
|
|
|
|
tempLocation = static_cast <Qt::DockWidgetArea>(settings.value(buildMenuKey (SUB_SECTION_LOCATION,widget, view)).toInt()); |
|
|
|
|
|
|
|
|
|
if (tempWidget && tempVisible){ |
|
|
|
|
addDockWidget(tempLocation, tempWidget); |
|
|
|
|
tempWidget->show(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::showCentralWidget (TOOLS_WIDGET_NAMES centralWidget, VIEW_SECTIONS view){ |
|
|
|
|
void MainWindow::showTheCentralWidget (TOOLS_WIDGET_NAMES centralWidget, VIEW_SECTIONS view){ |
|
|
|
|
bool tempVisible; |
|
|
|
|
QWidget* tempWidget = dockWidgets[centralWidget]; |
|
|
|
|
|
|
|
|
|
tempVisible = settings.value(buildMenuKey (SUB_SECTION_CHECKED,centralWidget,view)).toBool(); |
|
|
|
|
|
|
|
|
|
qDebug() << buildMenuKey (SUB_SECTION_CHECKED,centralWidget,view) << tempVisible; |
|
|
|
|
if (toolsMenuActions[centralWidget]){ |
|
|
|
|
toolsMenuActions[centralWidget]->setChecked(tempVisible); |
|
|
|
|
} |
|
|
|
@ -1446,6 +1244,20 @@ void MainWindow::showCentralWidget (TOOLS_WIDGET_NAMES centralWidget, VIEW_SECTI
@@ -1446,6 +1244,20 @@ void MainWindow::showCentralWidget (TOOLS_WIDGET_NAMES centralWidget, VIEW_SECTI
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
========================================================== |
|
|
|
|
Potentially Deprecated |
|
|
|
|
========================================================== |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
void MainWindow::loadPixhawkEngineerView() |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::loadAllView() |
|
|
|
|
{ |
|
|
|
|
clearView(); |
|
|
|
@ -1459,7 +1271,7 @@ void MainWindow::loadAllView()
@@ -1459,7 +1271,7 @@ void MainWindow::loadAllView()
|
|
|
|
|
headDown1DockWidget->show(); |
|
|
|
|
hdd->start(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if (headDown2DockWidget) |
|
|
|
|
{ |
|
|
|
@ -1542,6 +1354,191 @@ void MainWindow::loadWidgets()
@@ -1542,6 +1354,191 @@ void MainWindow::loadWidgets()
|
|
|
|
|
//loadPilotView();
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MainWindow::loadDataView() |
|
|
|
|
{ |
|
|
|
|
clearView(); |
|
|
|
|
|
|
|
|
|
// DATAPLOT
|
|
|
|
|
if (dataplotWidget) |
|
|
|
|
{ |
|
|
|
|
QStackedWidget *centerStack = dynamic_cast<QStackedWidget*>(centralWidget()); |
|
|
|
|
if (centerStack) |
|
|
|
|
centerStack->setCurrentWidget(dataplotWidget); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MainWindow::loadDataView(QString fileName) |
|
|
|
|
{ |
|
|
|
|
clearView(); |
|
|
|
|
|
|
|
|
|
// DATAPLOT
|
|
|
|
|
if (dataplotWidget) |
|
|
|
|
{ |
|
|
|
|
QStackedWidget *centerStack = dynamic_cast<QStackedWidget*>(centralWidget()); |
|
|
|
|
if (centerStack) |
|
|
|
|
{ |
|
|
|
|
centerStack->setCurrentWidget(dataplotWidget); |
|
|
|
|
dataplotWidget->loadFile(fileName); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MainWindow::load3DMapView() |
|
|
|
|
{ |
|
|
|
|
#ifdef QGC_OSGEARTH_ENABLED |
|
|
|
|
clearView(); |
|
|
|
|
|
|
|
|
|
// 3D map
|
|
|
|
|
if (_3DMapWidget) |
|
|
|
|
{ |
|
|
|
|
QStackedWidget *centerStack = dynamic_cast<QStackedWidget*>(centralWidget()); |
|
|
|
|
if (centerStack) |
|
|
|
|
{ |
|
|
|
|
//map3DWidget->setActive(true);
|
|
|
|
|
centerStack->setCurrentWidget(_3DMapWidget); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// UAS CONTROL
|
|
|
|
|
if (controlDockWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::LeftDockWidgetArea, controlDockWidget); |
|
|
|
|
controlDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// UAS LIST
|
|
|
|
|
if (listDockWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, listDockWidget); |
|
|
|
|
listDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// WAYPOINT LIST
|
|
|
|
|
if (waypointsDockWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, waypointsDockWidget); |
|
|
|
|
waypointsDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// HORIZONTAL SITUATION INDICATOR
|
|
|
|
|
if (hsiDockWidget) |
|
|
|
|
{ |
|
|
|
|
HSIDisplay* hsi = dynamic_cast<HSIDisplay*>( hsiDockWidget->widget() ); |
|
|
|
|
if (hsi) |
|
|
|
|
{ |
|
|
|
|
hsi->start(); |
|
|
|
|
addDockWidget(Qt::LeftDockWidgetArea, hsiDockWidget); |
|
|
|
|
hsiDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
this->show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MainWindow::loadGoogleEarthView() |
|
|
|
|
{ |
|
|
|
|
#if (defined Q_OS_WIN) | (defined Q_OS_MAC) |
|
|
|
|
clearView(); |
|
|
|
|
|
|
|
|
|
// 3D map
|
|
|
|
|
if (gEarthWidget) |
|
|
|
|
{ |
|
|
|
|
QStackedWidget *centerStack = dynamic_cast<QStackedWidget*>(centralWidget()); |
|
|
|
|
if (centerStack) |
|
|
|
|
{ |
|
|
|
|
centerStack->setCurrentWidget(gEarthWidget); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// UAS CONTROL
|
|
|
|
|
if (controlDockWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::LeftDockWidgetArea, controlDockWidget); |
|
|
|
|
controlDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// UAS LIST
|
|
|
|
|
if (listDockWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, listDockWidget); |
|
|
|
|
listDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// WAYPOINT LIST
|
|
|
|
|
if (waypointsDockWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, waypointsDockWidget); |
|
|
|
|
waypointsDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// HORIZONTAL SITUATION INDICATOR
|
|
|
|
|
if (hsiDockWidget) |
|
|
|
|
{ |
|
|
|
|
HSIDisplay* hsi = dynamic_cast<HSIDisplay*>( hsiDockWidget->widget() ); |
|
|
|
|
if (hsi) |
|
|
|
|
{ |
|
|
|
|
hsi->start(); |
|
|
|
|
addDockWidget(Qt::LeftDockWidgetArea, hsiDockWidget); |
|
|
|
|
hsiDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this->show(); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MainWindow::load3DView() |
|
|
|
|
{ |
|
|
|
|
#ifdef QGC_OSG_ENABLED |
|
|
|
|
clearView(); |
|
|
|
|
|
|
|
|
|
// 3D map
|
|
|
|
|
if (_3DWidget) |
|
|
|
|
{ |
|
|
|
|
QStackedWidget *centerStack = dynamic_cast<QStackedWidget*>(centralWidget()); |
|
|
|
|
if (centerStack) |
|
|
|
|
{ |
|
|
|
|
//map3DWidget->setActive(true);
|
|
|
|
|
centerStack->setCurrentWidget(_3DWidget); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// UAS CONTROL
|
|
|
|
|
if (controlDockWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::LeftDockWidgetArea, controlDockWidget); |
|
|
|
|
controlDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// UAS LIST
|
|
|
|
|
if (listDockWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, listDockWidget); |
|
|
|
|
listDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// WAYPOINT LIST
|
|
|
|
|
if (waypointsDockWidget) |
|
|
|
|
{ |
|
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, waypointsDockWidget); |
|
|
|
|
waypointsDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// HORIZONTAL SITUATION INDICATOR
|
|
|
|
|
if (hsiDockWidget) |
|
|
|
|
{ |
|
|
|
|
HSIDisplay* hsi = dynamic_cast<HSIDisplay*>( hsiDockWidget->widget() ); |
|
|
|
|
if (hsi) |
|
|
|
|
{ |
|
|
|
|
hsi->start(); |
|
|
|
|
addDockWidget(Qt::LeftDockWidgetArea, hsiDockWidget); |
|
|
|
|
hsiDockWidget->show(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
this->show(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
================================== |
|
|
|
|