|
|
|
@ -216,8 +216,6 @@ void MainWindow::init()
@@ -216,8 +216,6 @@ void MainWindow::init()
|
|
|
|
|
toolBar = new QGCToolBar(this); |
|
|
|
|
this->addToolBar(toolBar); |
|
|
|
|
|
|
|
|
|
ui.actionHardwareConfig->setText(tr("Config")); |
|
|
|
|
|
|
|
|
|
// Add actions for average users (displayed next to each other)
|
|
|
|
|
QList<QAction*> actions; |
|
|
|
|
actions << ui.actionFlightView; |
|
|
|
@ -228,10 +226,12 @@ void MainWindow::init()
@@ -228,10 +226,12 @@ void MainWindow::init()
|
|
|
|
|
|
|
|
|
|
// Add actions for advanced users (displayed in dropdown under "advanced")
|
|
|
|
|
QList<QAction*> advancedActions; |
|
|
|
|
advancedActions << ui.actionSimulation_View; |
|
|
|
|
advancedActions << ui.actionSimulationView; |
|
|
|
|
advancedActions << ui.actionEngineersView; |
|
|
|
|
|
|
|
|
|
toolBar->setPerspectiveChangeAdvancedActions(advancedActions); |
|
|
|
|
} else { |
|
|
|
|
ui.actionHardwareConfig->setText(tr("Hardware")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
customStatusBar = new QGCStatusBar(this); |
|
|
|
@ -266,7 +266,7 @@ void MainWindow::init()
@@ -266,7 +266,7 @@ void MainWindow::init()
|
|
|
|
|
apmToolBar->setFlightPlanViewAction(ui.actionMissionView); |
|
|
|
|
apmToolBar->setHardwareViewAction(ui.actionHardwareConfig); |
|
|
|
|
apmToolBar->setSoftwareViewAction(ui.actionSoftwareConfig); |
|
|
|
|
apmToolBar->setSimulationViewAction(ui.actionSimulation_View); |
|
|
|
|
apmToolBar->setSimulationViewAction(ui.actionSimulationView); |
|
|
|
|
apmToolBar->setTerminalViewAction(ui.actionTerminalView); |
|
|
|
|
|
|
|
|
|
QDockWidget *widget = new QDockWidget(tr("APM Tool Bar"),this); |
|
|
|
@ -435,10 +435,10 @@ QString MainWindow::getWindowStateKey()
@@ -435,10 +435,10 @@ QString MainWindow::getWindowStateKey()
|
|
|
|
|
{ |
|
|
|
|
if (UASManager::instance()->getActiveUAS()) |
|
|
|
|
{ |
|
|
|
|
return QString::number(currentView)+"_windowstate_" + UASManager::instance()->getActiveUAS()->getAutopilotTypeName(); |
|
|
|
|
return QString::number(currentView)+"_windowstate_" + QString::number(getCustomMode()) + "_" + UASManager::instance()->getActiveUAS()->getAutopilotTypeName(); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
return QString::number(currentView)+"_windowstate"; |
|
|
|
|
return QString::number(currentView)+"_windowstate_" + QString::number(getCustomMode()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QString MainWindow::getWindowGeometryKey() |
|
|
|
@ -543,6 +543,15 @@ void MainWindow::buildCommonWidgets()
@@ -543,6 +543,15 @@ void MainWindow::buildCommonWidgets()
|
|
|
|
|
addToCentralStackedWidget(pilotView, VIEW_FLIGHT, "Pilot"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!terminalView) |
|
|
|
|
{ |
|
|
|
|
terminalView = new SubMainWindow(this); |
|
|
|
|
terminalView->setObjectName("VIEW_TERMINAL"); |
|
|
|
|
TerminalConsole *terminalConsole = new TerminalConsole(this); |
|
|
|
|
terminalView->setCentralWidget(terminalConsole); |
|
|
|
|
addToCentralStackedWidget(terminalView, VIEW_TERMINAL, tr("Terminal View")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (getCustomMode() == CUSTOM_MODE_APM) { |
|
|
|
|
if (!configView) |
|
|
|
|
{ |
|
|
|
@ -559,14 +568,7 @@ void MainWindow::buildCommonWidgets()
@@ -559,14 +568,7 @@ void MainWindow::buildCommonWidgets()
|
|
|
|
|
softwareConfigView->setCentralWidget(new ApmSoftwareConfig(this)); |
|
|
|
|
addToCentralStackedWidget(softwareConfigView, VIEW_SOFTWARE_CONFIG, "Software"); |
|
|
|
|
} |
|
|
|
|
if (!terminalView) |
|
|
|
|
{ |
|
|
|
|
terminalView = new SubMainWindow(this); |
|
|
|
|
terminalView->setObjectName("VIEW_TERMINAL"); |
|
|
|
|
TerminalConsole *terminalConsole = new TerminalConsole(this); |
|
|
|
|
terminalView->setCentralWidget(terminalConsole); |
|
|
|
|
addToCentralStackedWidget(terminalView, VIEW_TERMINAL, tr("Terminal View")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
if (!configView) |
|
|
|
|
{ |
|
|
|
@ -596,7 +598,7 @@ void MainWindow::buildCommonWidgets()
@@ -596,7 +598,7 @@ void MainWindow::buildCommonWidgets()
|
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#if QGC_GOOGLE_EARTH_ENABLED |
|
|
|
|
#ifdef QGC_GOOGLE_EARTH_ENABLED |
|
|
|
|
if (!googleEarthView) |
|
|
|
|
{ |
|
|
|
|
googleEarthView = new SubMainWindow(this); |
|
|
|
@ -1262,19 +1264,29 @@ void MainWindow::connectCommonActions()
@@ -1262,19 +1264,29 @@ void MainWindow::connectCommonActions()
|
|
|
|
|
perspectives->addAction(ui.actionEngineersView); |
|
|
|
|
perspectives->addAction(ui.actionMavlinkView); |
|
|
|
|
perspectives->addAction(ui.actionFlightView); |
|
|
|
|
perspectives->addAction(ui.actionSimulation_View); |
|
|
|
|
perspectives->addAction(ui.actionSimulationView); |
|
|
|
|
perspectives->addAction(ui.actionMissionView); |
|
|
|
|
//perspectives->addAction(ui.actionConfiguration_2);
|
|
|
|
|
perspectives->addAction(ui.actionHardwareConfig); |
|
|
|
|
if (getCustomMode() == CUSTOM_MODE_APM) { |
|
|
|
|
perspectives->addAction(ui.actionSoftwareConfig); |
|
|
|
|
} |
|
|
|
|
perspectives->addAction(ui.actionSoftwareConfig); |
|
|
|
|
perspectives->addAction(ui.actionTerminalView); |
|
|
|
|
perspectives->addAction(ui.actionUnconnectedView); |
|
|
|
|
perspectives->addAction(ui.actionGoogleEarthView); |
|
|
|
|
perspectives->addAction(ui.actionLocal3DView); |
|
|
|
|
perspectives->setExclusive(true); |
|
|
|
|
|
|
|
|
|
/* Hide the actions that are not relevant */ |
|
|
|
|
ui.actionSoftwareConfig->setVisible(getCustomMode() == CUSTOM_MODE_APM); |
|
|
|
|
#ifndef QGC_MAVGEN_ENABLED |
|
|
|
|
ui.actionMavlinkView->setVisible(false); |
|
|
|
|
#endif |
|
|
|
|
#ifndef QGC_GOOGLE_EARTH_ENABLED |
|
|
|
|
ui.actionGoogleEarthView->setVisible(false); |
|
|
|
|
#endif |
|
|
|
|
#ifndef QGC_OSG_ENABLED |
|
|
|
|
ui.actionLocal3DView->setVisible(false); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
// Mark the right one as selected
|
|
|
|
|
if (currentView == VIEW_ENGINEER) |
|
|
|
|
{ |
|
|
|
@ -1293,8 +1305,8 @@ void MainWindow::connectCommonActions()
@@ -1293,8 +1305,8 @@ void MainWindow::connectCommonActions()
|
|
|
|
|
} |
|
|
|
|
if (currentView == VIEW_SIMULATION) |
|
|
|
|
{ |
|
|
|
|
ui.actionSimulation_View->setChecked(true); |
|
|
|
|
ui.actionSimulation_View->activate(QAction::Trigger); |
|
|
|
|
ui.actionSimulationView->setChecked(true); |
|
|
|
|
ui.actionSimulationView->activate(QAction::Trigger); |
|
|
|
|
} |
|
|
|
|
if (currentView == VIEW_MISSION) |
|
|
|
|
{ |
|
|
|
@ -1358,21 +1370,16 @@ void MainWindow::connectCommonActions()
@@ -1358,21 +1370,16 @@ void MainWindow::connectCommonActions()
|
|
|
|
|
|
|
|
|
|
// Views actions
|
|
|
|
|
connect(ui.actionFlightView, SIGNAL(triggered()), this, SLOT(loadPilotView())); |
|
|
|
|
connect(ui.actionSimulation_View, SIGNAL(triggered()), this, SLOT(loadSimulationView())); |
|
|
|
|
connect(ui.actionSimulationView, SIGNAL(triggered()), this, SLOT(loadSimulationView())); |
|
|
|
|
connect(ui.actionEngineersView, SIGNAL(triggered()), this, SLOT(loadEngineerView())); |
|
|
|
|
connect(ui.actionMissionView, SIGNAL(triggered()), this, SLOT(loadOperatorView())); |
|
|
|
|
connect(ui.actionUnconnectedView, SIGNAL(triggered()), this, SLOT(loadUnconnectedView())); |
|
|
|
|
connect(ui.actionHardwareConfig,SIGNAL(triggered()),this,SLOT(loadHardwareConfigView())); |
|
|
|
|
connect(ui.actionGoogleEarthView, SIGNAL(triggered()), this, SLOT(loadGoogleEarthView())); |
|
|
|
|
connect(ui.actionLocal3DView, SIGNAL(triggered()), this, SLOT(loadLocal3DView())); |
|
|
|
|
connect(ui.actionSimulationView, SIGNAL(triggered()), this, SLOT(loadSimulationView())); |
|
|
|
|
connect(ui.actionHardwareConfig, SIGNAL(triggered()), this, SLOT(loadHardwareConfigView())); |
|
|
|
|
|
|
|
|
|
if (getCustomMode() == CUSTOM_MODE_APM) { |
|
|
|
|
connect(ui.actionSoftwareConfig,SIGNAL(triggered()),this,SLOT(loadSoftwareConfigView())); |
|
|
|
|
connect(ui.actionTerminalView,SIGNAL(triggered()),this,SLOT(loadTerminalView())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
connect(ui.actionSoftwareConfig,SIGNAL(triggered()),this,SLOT(loadSoftwareConfigView())); |
|
|
|
|
connect(ui.actionTerminalView,SIGNAL(triggered()),this,SLOT(loadTerminalView())); |
|
|
|
|
connect(ui.actionMavlinkView, SIGNAL(triggered()), this, SLOT(loadMAVLinkView())); |
|
|
|
|
|
|
|
|
|
// Help Actions
|
|
|
|
@ -2049,7 +2056,7 @@ void MainWindow::loadSimulationView()
@@ -2049,7 +2056,7 @@ void MainWindow::loadSimulationView()
|
|
|
|
|
{ |
|
|
|
|
storeViewState(); |
|
|
|
|
currentView = VIEW_SIMULATION; |
|
|
|
|
ui.actionSimulation_View->setChecked(true); |
|
|
|
|
ui.actionSimulationView->setChecked(true); |
|
|
|
|
loadViewState(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|