Commit 713a9da2 authored by Lorenz Meier's avatar Lorenz Meier

Re-enable the local 3D and Google Earth 3D views, needs testing

parent 398d1622
...@@ -555,6 +555,29 @@ void MainWindow::buildCommonWidgets() ...@@ -555,6 +555,29 @@ void MainWindow::buildCommonWidgets()
addToCentralStackedWidget(mavlinkView, VIEW_MAVLINK, tr("Mavlink Generator")); addToCentralStackedWidget(mavlinkView, VIEW_MAVLINK, tr("Mavlink Generator"));
} }
#if (defined _MSC_VER) | (defined Q_OS_MAC)
if (!googleEarthView)
{
googleEarthView = new SubMainWindow(this);
googleEarthView->setObjectName("VIEW_GOOGLEEARTH");
googleEarthView->setCentralWidget(new QGCGoogleEarthView(this));
addToCentralStackedWidget(googleEarthView, VIEW_GOOGLEEARTH, tr("Google Earth View"));
}
#endif
#ifdef QGC_OSG_ENABLED
if (q3DWidget)
{
q3DWidget = Q3DWidgetFactory::get("PIXHAWK", this);
q3DWidget->setObjectName("VIEW_3DWIDGET");
local3DView = new SubMainWindow(this);
local3DView->setObjectName("VIEW_LOCAL3D");
local3DView->setCentralWidget(q3DWidget);
addToCentralStackedWidget(local3DView, VIEW_LOCAL3D, tr("Local 3D View"));
}
#endif
if (!simView) if (!simView)
{ {
simView = new SubMainWindow(this); simView = new SubMainWindow(this);
...@@ -660,24 +683,6 @@ void MainWindow::buildCommonWidgets() ...@@ -660,24 +683,6 @@ void MainWindow::buildCommonWidgets()
dataplotWidget = new QGCDataPlot2D(this); dataplotWidget = new QGCDataPlot2D(this);
addCentralWidget(dataplotWidget, tr("Logfile Plot")); addCentralWidget(dataplotWidget, tr("Logfile Plot"));
}*/ }*/
#ifdef QGC_OSG_ENABLED
if (q3DWidget)
{
q3DWidget = Q3DWidgetFactory::get("PIXHAWK", this);
q3DWidget->setObjectName("VIEW_3DWIDGET");
addToCentralStackedWidget(q3DWidget, VIEW_3DWIDGET, tr("Local 3D"));
}
#endif
#if (defined _MSC_VER) /*| (defined Q_OS_MAC) mac os doesn't support gearth right now */
if (!earthWidget)
{
earthWidget = new QGCGoogleEarthView(this);
addToCentralStackedWidget(earthWidget,VIEW_GOOGLEEARTH, tr("Google Earth"));
}
#endif
} }
void MainWindow::addTool(SubMainWindow *parent,VIEW_SECTIONS view,QDockWidget* widget, const QString& title, Qt::DockWidgetArea area) void MainWindow::addTool(SubMainWindow *parent,VIEW_SECTIONS view,QDockWidget* widget, const QString& title, Qt::DockWidgetArea area)
...@@ -1265,6 +1270,16 @@ void MainWindow::connectCommonActions() ...@@ -1265,6 +1270,16 @@ void MainWindow::connectCommonActions()
ui.actionTerminalView->setChecked(true); ui.actionTerminalView->setChecked(true);
ui.actionTerminalView->activate(QAction::Trigger); ui.actionTerminalView->activate(QAction::Trigger);
} }
if (currentView == VIEW_GOOGLEEARTH)
{
ui.actionGoogleEarthView->setChecked(true);
ui.actionGoogleEarthView->activate(QAction::Trigger);
}
if (currentView == VIEW_LOCAL3D)
{
ui.actionLocal3DView->setChecked(true);
ui.actionLocal3DView->activate(QAction::Trigger);
}
if (currentView == VIEW_UNCONNECTED) if (currentView == VIEW_UNCONNECTED)
{ {
ui.actionUnconnectedView->setChecked(true); ui.actionUnconnectedView->setChecked(true);
...@@ -1302,6 +1317,8 @@ void MainWindow::connectCommonActions() ...@@ -1302,6 +1317,8 @@ void MainWindow::connectCommonActions()
connect(ui.actionMissionView, SIGNAL(triggered()), this, SLOT(loadOperatorView())); connect(ui.actionMissionView, SIGNAL(triggered()), this, SLOT(loadOperatorView()));
connect(ui.actionUnconnectedView, SIGNAL(triggered()), this, SLOT(loadUnconnectedView())); connect(ui.actionUnconnectedView, SIGNAL(triggered()), this, SLOT(loadUnconnectedView()));
connect(ui.actionHardwareConfig,SIGNAL(triggered()),this,SLOT(loadHardwareConfigView())); connect(ui.actionHardwareConfig,SIGNAL(triggered()),this,SLOT(loadHardwareConfigView()));
connect(ui.actionGoogleEarthView, SIGNAL(triggered()), this, SLOT(loadGoogleEarthView()));
connect(ui.actionLocal3DView, SIGNAL(triggered()), this, SLOT(loadLocal3DView()));
if (getCustomMode() == CUSTOM_MODE_APM) { if (getCustomMode() == CUSTOM_MODE_APM) {
connect(ui.actionSoftwareConfig,SIGNAL(triggered()),this,SLOT(loadSoftwareConfigView())); connect(ui.actionSoftwareConfig,SIGNAL(triggered()),this,SLOT(loadSoftwareConfigView()));
...@@ -1840,7 +1857,12 @@ void MainWindow::loadViewState() ...@@ -1840,7 +1857,12 @@ void MainWindow::loadViewState()
case VIEW_TERMINAL: case VIEW_TERMINAL:
centerStack->setCurrentWidget(terminalView); centerStack->setCurrentWidget(terminalView);
break; break;
case VIEW_GOOGLEEARTH:
centerStack->setCurrentWidget(googleEarthView);
break;
case VIEW_LOCAL3D:
centerStack->setCurrentWidget(local3DView);
break;
case VIEW_UNCONNECTED: case VIEW_UNCONNECTED:
case VIEW_FULL: case VIEW_FULL:
default: default:
...@@ -1939,6 +1961,27 @@ void MainWindow::loadTerminalView() ...@@ -1939,6 +1961,27 @@ void MainWindow::loadTerminalView()
} }
} }
void MainWindow::loadGoogleEarthView()
{
if (currentView != VIEW_GOOGLEEARTH)
{
storeViewState();
currentView = VIEW_GOOGLEEARTH;
ui.actionGoogleEarthView->setChecked(true);
loadViewState();
}
}
void MainWindow::loadLocal3DView()
{
if (currentView != VIEW_LOCAL3D)
{
storeViewState();
currentView = VIEW_LOCAL3D;
ui.actionLocal3DView->setChecked(true);
loadViewState();
}
}
void MainWindow::loadUnconnectedView() void MainWindow::loadUnconnectedView()
{ {
......
...@@ -240,6 +240,10 @@ public slots: ...@@ -240,6 +240,10 @@ public slots:
void loadMAVLinkView(); void loadMAVLinkView();
/** @brief Load Terminal Console views */ /** @brief Load Terminal Console views */
void loadTerminalView(); void loadTerminalView();
/** @brief Load Google Earth View */
void loadGoogleEarthView();
/** @brief Load local 3D view */
void loadLocal3DView();
/** @brief Show the online help for users */ /** @brief Show the online help for users */
void showHelp(); void showHelp();
...@@ -333,7 +337,7 @@ protected: ...@@ -333,7 +337,7 @@ protected:
VIEW_HARDWARE_CONFIG, VIEW_HARDWARE_CONFIG,
VIEW_SOFTWARE_CONFIG, VIEW_SOFTWARE_CONFIG,
VIEW_TERMINAL, VIEW_TERMINAL,
VIEW_3DWIDGET, VIEW_LOCAL3D,
VIEW_GOOGLEEARTH, VIEW_GOOGLEEARTH,
VIEW_UNCONNECTED, ///< View in unconnected mode, when no UAS is available VIEW_UNCONNECTED, ///< View in unconnected mode, when no UAS is available
VIEW_FULL ///< All widgets shown at once VIEW_FULL ///< All widgets shown at once
...@@ -406,6 +410,8 @@ protected: ...@@ -406,6 +410,8 @@ protected:
QPointer<SubMainWindow> engineeringView; QPointer<SubMainWindow> engineeringView;
QPointer<SubMainWindow> simView; QPointer<SubMainWindow> simView;
QPointer<SubMainWindow> terminalView; QPointer<SubMainWindow> terminalView;
QPointer<SubMainWindow> googleEarthView;
QPointer<SubMainWindow> local3DView;
// Center widgets // Center widgets
QPointer<Linecharts> linechartWidget; QPointer<Linecharts> linechartWidget;
......
...@@ -102,6 +102,8 @@ ...@@ -102,6 +102,8 @@
<addaction name="actionTerminalView"/> <addaction name="actionTerminalView"/>
<addaction name="actionEngineersView"/> <addaction name="actionEngineersView"/>
<addaction name="actionSimulationView"/> <addaction name="actionSimulationView"/>
<addaction name="actionGoogleEarthView"/>
<addaction name="actionLocal3DView"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionFirmwareUpdateView"/> <addaction name="actionFirmwareUpdateView"/>
<addaction name="actionMavlinkView"/> <addaction name="actionMavlinkView"/>
...@@ -502,6 +504,16 @@ ...@@ -502,6 +504,16 @@
<string>Terminal</string> <string>Terminal</string>
</property> </property>
</action> </action>
<action name="actionGoogleEarthView">
<property name="text">
<string>Google Earth</string>
</property>
</action>
<action name="actionLocal3DView">
<property name="text">
<string>Local 3D View</string>
</property>
</action>
</widget> </widget>
<layoutdefault spacing="6" margin="11"/> <layoutdefault spacing="6" margin="11"/>
<resources> <resources>
......
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