From 4d13d78e13bb137649973a5720f48fa23f0f694c Mon Sep 17 00:00:00 2001 From: dogmaphobic Date: Sun, 12 Apr 2015 16:43:01 -0400 Subject: [PATCH] Experimental mapping/planning tool. --- QGCApplication.pro | 7 +- qgroundcontrol.qrc | 48 ++-- src/QmlControls/QGCColoredImage.qml | 19 +- src/ui/MainWindow.cc | 144 +++++++----- src/ui/MainWindow.h | 29 ++- src/ui/MainWindow.ui | 18 +- src/ui/flightdisplay/FlightDisplay.qml | 22 +- src/ui/mapdisplay/MapDisplay.qml | 216 ++++++++++++++++++ src/ui/mapdisplay/QGCMapDisplay.cc | 91 ++++++++ src/ui/mapdisplay/QGCMapDisplay.h | 65 ++++++ .../QGCAltitudeWidget.qml | 0 .../QGCAttitudeWidget.qml | 0 .../components => qmlcommon}/QGCCompass.qml | 0 .../QGCCurrentAltitude.qml | 0 .../QGCCurrentSpeed.qml | 0 .../QGCMapBackground.qml | 5 +- src/ui/qmlcommon/QGCMapToolButton.qml | 71 ++++++ .../QGCPitchWidget.qml | 0 .../components => qmlcommon}/QGCSlider.qml | 0 .../QGCSpeedWidget.qml | 0 src/ui/qmlcommon/QGCWaypointEditor.qml | 39 ++++ src/ui/qmlcommon/buttonHome.svg | 11 + src/ui/qmlcommon/buttonLeft.svg | 19 ++ src/ui/qmlcommon/buttonRight.svg | 19 ++ .../components => qmlcommon}/compass.svg | 0 .../compassNeedle.svg | 0 .../components => qmlcommon}/crossHair.svg | 0 .../components => qmlcommon}/qmldir | 6 +- .../components => qmlcommon}/rollDial.svg | 0 .../rollDialWhite.svg | 0 .../components => qmlcommon}/rollPointer.svg | 0 .../rollPointerWhite.svg | 0 .../components => qmlcommon}/scale.png | Bin .../components => qmlcommon}/scale_end.png | Bin src/ui/toolbar/MainToolBar.cc | 15 +- src/ui/toolbar/MainToolBar.qml | 4 +- 36 files changed, 720 insertions(+), 128 deletions(-) create mode 100644 src/ui/mapdisplay/MapDisplay.qml create mode 100644 src/ui/mapdisplay/QGCMapDisplay.cc create mode 100644 src/ui/mapdisplay/QGCMapDisplay.h rename src/ui/{flightdisplay/components => qmlcommon}/QGCAltitudeWidget.qml (100%) rename src/ui/{flightdisplay/components => qmlcommon}/QGCAttitudeWidget.qml (100%) rename src/ui/{flightdisplay/components => qmlcommon}/QGCCompass.qml (100%) rename src/ui/{flightdisplay/components => qmlcommon}/QGCCurrentAltitude.qml (100%) rename src/ui/{flightdisplay/components => qmlcommon}/QGCCurrentSpeed.qml (100%) rename src/ui/{flightdisplay/components => qmlcommon}/QGCMapBackground.qml (97%) create mode 100644 src/ui/qmlcommon/QGCMapToolButton.qml rename src/ui/{flightdisplay/components => qmlcommon}/QGCPitchWidget.qml (100%) rename src/ui/{flightdisplay/components => qmlcommon}/QGCSlider.qml (100%) rename src/ui/{flightdisplay/components => qmlcommon}/QGCSpeedWidget.qml (100%) create mode 100644 src/ui/qmlcommon/QGCWaypointEditor.qml create mode 100644 src/ui/qmlcommon/buttonHome.svg create mode 100644 src/ui/qmlcommon/buttonLeft.svg create mode 100644 src/ui/qmlcommon/buttonRight.svg rename src/ui/{flightdisplay/components => qmlcommon}/compass.svg (100%) rename src/ui/{flightdisplay/components => qmlcommon}/compassNeedle.svg (100%) rename src/ui/{flightdisplay/components => qmlcommon}/crossHair.svg (100%) rename src/ui/{flightdisplay/components => qmlcommon}/qmldir (68%) rename src/ui/{flightdisplay/components => qmlcommon}/rollDial.svg (100%) rename src/ui/{flightdisplay/components => qmlcommon}/rollDialWhite.svg (100%) rename src/ui/{flightdisplay/components => qmlcommon}/rollPointer.svg (100%) rename src/ui/{flightdisplay/components => qmlcommon}/rollPointerWhite.svg (100%) rename src/ui/{flightdisplay/components => qmlcommon}/scale.png (100%) rename src/ui/{flightdisplay/components => qmlcommon}/scale_end.png (100%) diff --git a/QGCApplication.pro b/QGCApplication.pro index 0732ea762..abe4dac9c 100644 --- a/QGCApplication.pro +++ b/QGCApplication.pro @@ -156,6 +156,7 @@ INCLUDEPATH += \ src/ui/main \ src/ui/toolbar \ src/ui/flightdisplay \ + src/ui/mapdisplay \ src/VehicleSetup \ src/AutoPilotPlugins \ src/QmlControls @@ -379,7 +380,8 @@ HEADERS += \ src/ui/toolbar/MainToolBar.h \ src/QmlControls/ScreenTools.h \ src/QGCLoggingCategory.h \ - src/ui/flightdisplay/QGCFlightDisplay.h + src/ui/flightdisplay/QGCFlightDisplay.h \ + src/ui/mapdisplay/QGCMapDisplay.h SOURCES += \ src/main.cc \ @@ -519,7 +521,8 @@ SOURCES += \ src/ui/toolbar/MainToolBar.cc \ src/QmlControls/ScreenTools.cc \ src/QGCLoggingCategory.cc \ - src/ui/flightdisplay/QGCFlightDisplay.cc + src/ui/flightdisplay/QGCFlightDisplay.cc \ + src/ui/mapdisplay/QGCMapDisplay.cc # # Unit Test specific configuration goes here diff --git a/qgroundcontrol.qrc b/qgroundcontrol.qrc index 6e41c9125..31bae3fc2 100644 --- a/qgroundcontrol.qrc +++ b/qgroundcontrol.qrc @@ -87,28 +87,36 @@ src/AutoPilotPlugins/PX4/Images/PowerComponentBattery_04cell.svg src/AutoPilotPlugins/PX4/Images/PowerComponentBattery_05cell.svg src/AutoPilotPlugins/PX4/Images/PowerComponentBattery_06cell.svg - + src/ui/toolbar/MainToolBar.qml src/ui/flightdisplay/FlightDisplay.qml - src/ui/flightdisplay/components/qmldir - src/ui/flightdisplay/components/QGCAltitudeWidget.qml - src/ui/flightdisplay/components/QGCAttitudeWidget.qml - src/ui/flightdisplay/components/QGCCompass.qml - src/ui/flightdisplay/components/QGCCurrentAltitude.qml - src/ui/flightdisplay/components/QGCCurrentSpeed.qml - src/ui/flightdisplay/components/QGCMapBackground.qml - src/ui/flightdisplay/components/QGCPitchWidget.qml - src/ui/flightdisplay/components/QGCSpeedWidget.qml - src/ui/flightdisplay/components/QGCSlider.qml - src/ui/flightdisplay/components/compass.svg - src/ui/flightdisplay/components/compassNeedle.svg - src/ui/flightdisplay/components/crossHair.svg - src/ui/flightdisplay/components/rollDial.svg - src/ui/flightdisplay/components/rollDialWhite.svg - src/ui/flightdisplay/components/rollPointer.svg - src/ui/flightdisplay/components/rollPointerWhite.svg - src/ui/flightdisplay/components/scale.png - src/ui/flightdisplay/components/scale_end.png + src/ui/mapdisplay/MapDisplay.qml + + src/ui/qmlcommon/qmldir + src/ui/qmlcommon/QGCAltitudeWidget.qml + src/ui/qmlcommon/QGCAttitudeWidget.qml + src/ui/qmlcommon/QGCCompass.qml + src/ui/qmlcommon/QGCCurrentAltitude.qml + src/ui/qmlcommon/QGCCurrentSpeed.qml + src/ui/qmlcommon/QGCMapBackground.qml + src/ui/qmlcommon/QGCPitchWidget.qml + src/ui/qmlcommon/QGCSpeedWidget.qml + src/ui/qmlcommon/QGCSlider.qml + src/ui/qmlcommon/QGCWaypointEditor.qml + src/ui/qmlcommon/QGCMapToolButton.qml + + src/ui/qmlcommon/compass.svg + src/ui/qmlcommon/compassNeedle.svg + src/ui/qmlcommon/crossHair.svg + src/ui/qmlcommon/rollDial.svg + src/ui/qmlcommon/rollDialWhite.svg + src/ui/qmlcommon/rollPointer.svg + src/ui/qmlcommon/rollPointerWhite.svg + src/ui/qmlcommon/scale.png + src/ui/qmlcommon/scale_end.png + src/ui/qmlcommon/buttonLeft.svg + src/ui/qmlcommon/buttonRight.svg + src/ui/qmlcommon/buttonHome.svg diff --git a/src/QmlControls/QGCColoredImage.qml b/src/QmlControls/QGCColoredImage.qml index c6d7a4327..716ccf718 100644 --- a/src/QmlControls/QGCColoredImage.qml +++ b/src/QmlControls/QGCColoredImage.qml @@ -23,20 +23,21 @@ Item { property alias status: image.status property alias verticalAlignment: image.verticalAlignment - width: image.width + width: image.width height: image.height Image { - id: image - smooth: true - mipmap: true - visible: false - anchors.fill: parent + id: image + smooth: true + mipmap: true + antialiasing: true + visible: false + anchors.fill: parent } ColorOverlay { - anchors.fill: image - source: image - color: parent.color + anchors.fill: image + source: image + color: parent.color } } diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index 6c7e1073a..32201d114 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -51,6 +51,7 @@ This file is part of the QGROUNDCONTROL project #include "QGCMAVLinkLogPlayer.h" #include "SettingsDialog.h" #include "QGCMapTool.h" +#include "QGCMapDisplay.h" #include "MAVLinkDecoder.h" #include "QGCMAVLinkMessageSender.h" #include "QGCRGBDView.h" @@ -151,6 +152,7 @@ MainWindow::MainWindow(QSplashScreen* splashScreen) // Setup central widget with a layout to hold the views _centralLayout = new QVBoxLayout(); + _centralLayout->setContentsMargins(0,0,0,0); centralWidget()->setLayout(_centralLayout); // Set dock options setDockOptions(AnimatedDocks | AllowTabbedDocks | AllowNestedDocks); @@ -263,9 +265,9 @@ MainWindow::MainWindow(QSplashScreen* splashScreen) // Set OS dependent keyboard shortcuts for the main window, non OS dependent shortcuts are set in MainWindow.ui #ifdef Q_OS_MACX _ui.actionSetup->setShortcut(QApplication::translate("MainWindow", "Meta+1", 0)); - _ui.actionMissionView->setShortcut(QApplication::translate("MainWindow", "Meta+2", 0)); - _ui.actionFlightView->setShortcut(QApplication::translate("MainWindow", "Meta+3", 0)); - _ui.actionEngineersView->setShortcut(QApplication::translate("MainWindow", "Meta+4", 0)); + _ui.actionPlan->setShortcut(QApplication::translate("MainWindow", "Meta+2", 0)); + _ui.actionFlight->setShortcut(QApplication::translate("MainWindow", "Meta+3", 0)); + _ui.actionAnalyze->setShortcut(QApplication::translate("MainWindow", "Meta+4", 0)); _ui.actionLocal3DView->setShortcut(QApplication::translate("MainWindow", "Meta+5", 0)); _ui.actionTerminalView->setShortcut(QApplication::translate("MainWindow", "Meta+6", 0)); _ui.actionSimulationView->setShortcut(QApplication::translate("MainWindow", "Meta+7", 0)); @@ -273,7 +275,7 @@ MainWindow::MainWindow(QSplashScreen* splashScreen) #else _ui.actionSetup->setShortcut(QApplication::translate("MainWindow", "Ctrl+1", 0)); _ui.actionMissionView->setShortcut(QApplication::translate("MainWindow", "Ctrl+2", 0)); - _ui.actionFlightView->setShortcut(QApplication::translate("MainWindow", "Ctrl+3", 0)); + _ui.actionFlight->setShortcut(QApplication::translate("MainWindow", "Ctrl+3", 0)); _ui.actionEngineersView->setShortcut(QApplication::translate("MainWindow", "Ctrl+4", 0)); _ui.actionLocal3DView->setShortcut(QApplication::translate("MainWindow", "Ctrl+5", 0)); _ui.actionTerminalView->setShortcut(QApplication::translate("MainWindow", "Ctrl+6", 0)); @@ -441,20 +443,28 @@ void MainWindow::_buildCommonWidgets(void) _buildCustomWidgets(); } -void MainWindow::_buildPlannerView(void) +void MainWindow::_buildPlanView(void) { - if (!_plannerView) { - _plannerView = new QGCMapTool(this); - _plannerView->setVisible(false); + if (!_planView) { + _planView = new QGCMapTool(this); + _planView->setVisible(false); } } -void MainWindow::_buildPilotView(void) +void MainWindow::_buildExperimentalPlanView(void) { - if (!_pilotView) { + if (!_experimentalPlanView) { + _experimentalPlanView = new QGCMapDisplay(this); + _experimentalPlanView->setVisible(false); + } +} + +void MainWindow::_buildFlightView(void) +{ + if (!_flightView) { //_pilotView = new PrimaryFlightDisplay(this); - _pilotView = new QGCFlightDisplay(this); - _pilotView->setVisible(false); + _flightView = new QGCFlightDisplay(this); + _flightView->setVisible(false); } } @@ -466,11 +476,11 @@ void MainWindow::_buildSetupView(void) } } -void MainWindow::_buildEngineeringView(void) +void MainWindow::_buildAnalyzeView(void) { - if (!_engineeringView) { - _engineeringView = new QGCDataPlot2D(this); - _engineeringView->setVisible(false); + if (!_analyzeView) { + _analyzeView = new QGCDataPlot2D(this); + _analyzeView->setVisible(false); } } @@ -726,8 +736,9 @@ void MainWindow::loadSettings() // Select the proper view. Default to the flight view or load the last one used if it's supported. VIEW_SECTIONS currentViewCandidate = (VIEW_SECTIONS) settings.value("CURRENT_VIEW", _currentView).toInt(); switch (currentViewCandidate) { - case VIEW_ENGINEER: - case VIEW_MISSION: + case VIEW_ANALYZE: + case VIEW_PLAN: + case VIEW_EXPERIMENTAL_PLAN: case VIEW_FLIGHT: case VIEW_SIMULATION: case VIEW_SETUP: @@ -797,13 +808,14 @@ void MainWindow::connectCommonActions() { // Bind together the perspective actions QActionGroup* perspectives = new QActionGroup(_ui.menuPerspectives); - perspectives->addAction(_ui.actionEngineersView); - perspectives->addAction(_ui.actionFlightView); + perspectives->addAction(_ui.actionAnalyze); + perspectives->addAction(_ui.actionFlight); perspectives->addAction(_ui.actionSimulationView); - perspectives->addAction(_ui.actionMissionView); + perspectives->addAction(_ui.actionPlan); perspectives->addAction(_ui.actionSetup); perspectives->addAction(_ui.actionTerminalView); perspectives->addAction(_ui.actionLocal3DView); + perspectives->addAction(_ui.actionExperimentalPlanView); perspectives->setExclusive(true); /* Hide the actions that are not relevant */ @@ -812,25 +824,30 @@ void MainWindow::connectCommonActions() #endif // Mark the right one as selected - if (_currentView == VIEW_ENGINEER) + if (_currentView == VIEW_ANALYZE) { - _ui.actionEngineersView->setChecked(true); - _ui.actionEngineersView->activate(QAction::Trigger); + _ui.actionAnalyze->setChecked(true); + _ui.actionAnalyze->activate(QAction::Trigger); } if (_currentView == VIEW_FLIGHT) { - _ui.actionFlightView->setChecked(true); - _ui.actionFlightView->activate(QAction::Trigger); + _ui.actionFlight->setChecked(true); + _ui.actionFlight->activate(QAction::Trigger); } if (_currentView == VIEW_SIMULATION) { _ui.actionSimulationView->setChecked(true); _ui.actionSimulationView->activate(QAction::Trigger); } - if (_currentView == VIEW_MISSION) + if (_currentView == VIEW_PLAN) { - _ui.actionMissionView->setChecked(true); - _ui.actionMissionView->activate(QAction::Trigger); + _ui.actionPlan->setChecked(true); + _ui.actionPlan->activate(QAction::Trigger); + } + if (_currentView == VIEW_EXPERIMENTAL_PLAN) + { + _ui.actionExperimentalPlanView->setChecked(true); + _ui.actionExperimentalPlanView->activate(QAction::Trigger); } if (_currentView == VIEW_SETUP) { @@ -870,10 +887,11 @@ void MainWindow::connectCommonActions() connect(_ui.actionShutdownMAV, SIGNAL(triggered()), UASManager::instance(), SLOT(shutdownActiveUAS())); // Views actions - connect(_ui.actionFlightView, SIGNAL(triggered()), this, SLOT(loadPilotView())); + connect(_ui.actionFlight, SIGNAL(triggered()), this, SLOT(loadFlightView())); 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.actionAnalyze, SIGNAL(triggered()), this, SLOT(loadAnalyzeView())); + connect(_ui.actionPlan, SIGNAL(triggered()), this, SLOT(loadPlanView())); + connect(_ui.actionExperimentalPlanView, SIGNAL(triggered()), this, SLOT(loadOldPlanView())); connect(_ui.actionLocal3DView, SIGNAL(triggered()), this, SLOT(loadLocal3DView())); connect(_ui.actionTerminalView,SIGNAL(triggered()),this,SLOT(loadTerminalView())); @@ -998,9 +1016,9 @@ void MainWindow::UASCreated(UASInterface* uas) } linechartWidget->addSource(mavlinkDecoder); - if (_engineeringView != linechartWidget) + if (_analyzeView != linechartWidget) { - _engineeringView = linechartWidget; + _analyzeView = linechartWidget; } // Reload view state in case new widgets were added @@ -1047,24 +1065,31 @@ void MainWindow::_loadCurrentViewState(void) centerView = _setupView; break; - case VIEW_ENGINEER: - _buildEngineeringView(); - centerView = _engineeringView; + case VIEW_ANALYZE: + _buildAnalyzeView(); + centerView = _analyzeView; defaultWidgets = "MAVLINK_INSPECTOR_DOCKWIDGET,PARAMETER_INTERFACE_DOCKWIDGET,FILE_VIEW_DOCKWIDGET,HEAD_UP_DISPLAY_DOCKWIDGET"; break; case VIEW_FLIGHT: - _buildPilotView(); - centerView = _pilotView; - defaultWidgets = "COMMUNICATION_CONSOLE_DOCKWIDGET,UAS_INFO_INFOVIEW_DOCKWIDGET"; + _buildFlightView(); + centerView = _flightView; + //defaultWidgets = "COMMUNICATION_CONSOLE_DOCKWIDGET,UAS_INFO_INFOVIEW_DOCKWIDGET"; + defaultWidgets.clear(); break; - case VIEW_MISSION: - _buildPlannerView(); - centerView = _plannerView; + case VIEW_PLAN: + _buildPlanView(); + centerView = _planView; defaultWidgets = "UNMANNED_SYSTEM_LIST_DOCKWIDGET,WAYPOINT_LIST_DOCKWIDGET"; break; + case VIEW_EXPERIMENTAL_PLAN: + _buildExperimentalPlanView(); + centerView = _experimentalPlanView; + defaultWidgets.clear(); + break; + case VIEW_SIMULATION: _buildSimView(); centerView = _simView; @@ -1096,6 +1121,7 @@ void MainWindow::_loadCurrentViewState(void) Q_ASSERT(_centralLayout->count() == 0); _currentViewWidget = centerView; _centralLayout->addWidget(_currentViewWidget); + _centralLayout->setContentsMargins(0, 0, 0, 0); _currentViewWidget->setVisible(true); // Hide all widgets from previous view @@ -1174,27 +1200,39 @@ void MainWindow::handleMisconfiguration(UASInterface* uas) } } -void MainWindow::loadEngineerView() +void MainWindow::loadAnalyzeView() { - if (_currentView != VIEW_ENGINEER) + if (_currentView != VIEW_ANALYZE) { _storeCurrentViewState(); - _currentView = VIEW_ENGINEER; - _ui.actionEngineersView->setChecked(true); + _currentView = VIEW_ANALYZE; + _ui.actionAnalyze->setChecked(true); _loadCurrentViewState(); } } -void MainWindow::loadOperatorView() +void MainWindow::loadPlanView() { - if (_currentView != VIEW_MISSION) + if (_currentView != VIEW_PLAN) { _storeCurrentViewState(); - _currentView = VIEW_MISSION; - _ui.actionMissionView->setChecked(true); + _currentView = VIEW_PLAN; + _ui.actionPlan->setChecked(true); _loadCurrentViewState(); } } + +void MainWindow::loadOldPlanView() +{ + if (_currentView != VIEW_EXPERIMENTAL_PLAN) + { + _storeCurrentViewState(); + _currentView = VIEW_EXPERIMENTAL_PLAN; + _ui.actionExperimentalPlanView->setChecked(true); + _loadCurrentViewState(); + } +} + void MainWindow::loadSetupView() { if (_currentView != VIEW_SETUP) @@ -1228,13 +1266,13 @@ void MainWindow::loadLocal3DView() } } -void MainWindow::loadPilotView() +void MainWindow::loadFlightView() { if (_currentView != VIEW_FLIGHT) { _storeCurrentViewState(); _currentView = VIEW_FLIGHT; - _ui.actionFlightView->setChecked(true); + _ui.actionFlight->setChecked(true); _loadCurrentViewState(); } } diff --git a/src/ui/MainWindow.h b/src/ui/MainWindow.h index 95e449c08..90af8c0e1 100644 --- a/src/ui/MainWindow.h +++ b/src/ui/MainWindow.h @@ -146,13 +146,15 @@ public slots: /** @brief Load configuration views */ void loadSetupView(); /** @brief Load view for pilot */ - void loadPilotView(); + void loadFlightView(); /** @brief Load view for simulation */ void loadSimulationView(); /** @brief Load view for engineer */ - void loadEngineerView(); - /** @brief Load view for operator */ - void loadOperatorView(); + void loadAnalyzeView(); + /** @brief Load New (QtQuick) Map View (Mission) */ + void loadPlanView(); + /** @brief Load Old (Qt Widget) Map View (Mission) */ + void loadOldPlanView(); /** @brief Load Terminal Console views */ void loadTerminalView(); /** @brief Load local 3D view */ @@ -220,13 +222,14 @@ protected: typedef enum _VIEW_SECTIONS { - VIEW_ENGINEER, // Engineering/Analyze view mode. Used for analyzing data and modifying onboard parameters - VIEW_MISSION, // Mission/Map/Plan view mode. Used for setting mission waypoints and high-level system commands. + VIEW_ANALYZE, // Engineering/Analyze view mode. Used for analyzing data and modifying onboard parameters + VIEW_PLAN, // New (QtQuick) Mission/Map/Plan view mode. Used for setting mission waypoints and high-level system commands. VIEW_FLIGHT, // Flight/Fly/Operate view mode. Used for 1st-person observation of the vehicle. VIEW_SIMULATION, // HIL Simulation view. Useful overview of the entire system when doing hardware-in-the-loop simulations. VIEW_SETUP, // Setup view. Used for initializing the system for operation. Includes UI for calibration, firmware updating/checking, and parameter modifcation. VIEW_TERMINAL, // Terminal interface. Used for communicating with the remote system, usually in a special configuration input mode. VIEW_LOCAL3D, // A local 3D view. Provides a local 3D view that makes visualizing 3D attitude/orientation/pose easy while in operation. + VIEW_EXPERIMENTAL_PLAN, // Original (Qt Widget) Mission/Map/Plan view mode. Used for setting mission waypoints and high-level system commands. } VIEW_SECTIONS; /** @brief Catch window resize events */ @@ -300,10 +303,11 @@ private: void _openUrl(const QString& url, const QString& errorMessage); // Center widgets - QPointer _plannerView; - QPointer _pilotView; + QPointer _planView; + QPointer _experimentalPlanView; + QPointer _flightView; QPointer _setupView; - QPointer _engineeringView; + QPointer _analyzeView; QPointer _simView; QPointer _terminalView; QPointer _local3DView; @@ -329,10 +333,11 @@ private: QMap _mapUasId2HilDockWidget; QMap _mapDockWidget2Action; - void _buildPlannerView(void); - void _buildPilotView(void); + void _buildPlanView(void); + void _buildExperimentalPlanView(void); + void _buildFlightView(void); void _buildSetupView(void); - void _buildEngineeringView(void); + void _buildAnalyzeView(void); void _buildSimView(void); void _buildTerminalView(void); void _buildLocal3DView(void); diff --git a/src/ui/MainWindow.ui b/src/ui/MainWindow.ui index fc97ec607..dfba29400 100644 --- a/src/ui/MainWindow.ui +++ b/src/ui/MainWindow.ui @@ -78,9 +78,9 @@ View - - - + + + @@ -99,6 +99,7 @@ + @@ -198,7 +199,7 @@ Developer Credits - + true @@ -206,7 +207,7 @@ Plan - + true @@ -214,7 +215,7 @@ Analyze - + true @@ -345,6 +346,11 @@ Status Bar + + + Experimental Plan View + + diff --git a/src/ui/flightdisplay/FlightDisplay.qml b/src/ui/flightdisplay/FlightDisplay.qml index b1dc01379..4bbc1be1b 100644 --- a/src/ui/flightdisplay/FlightDisplay.qml +++ b/src/ui/flightdisplay/FlightDisplay.qml @@ -23,7 +23,7 @@ This file is part of the QGROUNDCONTROL project /** * @file - * @brief QGC Main Tool Bar + * @brief QGC Main Flight Display * @author Gus Grubba */ @@ -31,7 +31,7 @@ import QtQuick 2.3 import QtQuick.Controls 1.2 import QtQuick.Controls.Styles 1.2 -import QGroundControl.HUDControls 1.0 +import QGroundControl.FlightControls 1.0 Rectangle { id: root @@ -285,17 +285,17 @@ Rectangle { } QGCMapBackground { - id: mapBackground - anchors.centerIn: parent - visible: false - heading: isNaN(flightDisplay.heading) ? 0 : flightDisplay.heading - latitude: flightDisplay.latitude - longitude: flightDisplay.longitude - z: 5 + id: mapBackground + anchors.fill: parent + visible: false + heading: isNaN(flightDisplay.heading) ? 0 : flightDisplay.heading + latitude: flightDisplay.latitude + longitude: flightDisplay.longitude + z: 5 } QGCAttitudeWidget { - id: attitudeWidget + id: attitudeWidget anchors.centerIn: parent rollAngle: roll pitchAngle: pitch @@ -305,7 +305,7 @@ Rectangle { } QGCPitchWidget { - id: pitchWidget + id: pitchWidget anchors.verticalCenter: parent.verticalCenter pitchAngle: pitch rollAngle: roll diff --git a/src/ui/mapdisplay/MapDisplay.qml b/src/ui/mapdisplay/MapDisplay.qml new file mode 100644 index 000000000..2dae4400f --- /dev/null +++ b/src/ui/mapdisplay/MapDisplay.qml @@ -0,0 +1,216 @@ +/*===================================================================== + +QGroundControl Open Source Ground Control Station + +(c) 2009, 2015 QGROUNDCONTROL PROJECT + +This file is part of the QGROUNDCONTROL project + + QGROUNDCONTROL is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + QGROUNDCONTROL is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with QGROUNDCONTROL. If not, see . + +======================================================================*/ + +/** + * @file + * @brief QGC Main Map Display + * @author Gus Grubba + */ + +import QtQuick 2.3 +import QtQuick.Controls 1.2 +import QtQuick.Controls.Styles 1.2 +import QtQuick.Layouts 1.1 + +import QGroundControl.Palette 1.0 +import QGroundControl.FlightControls 1.0 + +Rectangle { + QGCPalette { id: __palette; colorGroupEnabled: true } + id: root + color: Qt.rgba(0,0,0,0); + + property real roll: isNaN(mapEngine.roll) ? 0 : mapEngine.roll + property real pitch: isNaN(mapEngine.pitch) ? 0 : mapEngine.pitch + property bool showWaypointEditor: true + + function getBool(value) { + return value === '0' ? false : true; + } + + function setBool(value) { + return value ? "1" : "0"; + } + + Component.onCompleted: + { + mapTypeMenu.update(); + } + + Menu { + id: mapTypeMenu + title: "Map Type..." + ExclusiveGroup { id: currentMapType } + function setCurrentMap(map) { + for (var i = 0; i < mapBackground.mapItem.supportedMapTypes.length; i++) { + if (map === mapBackground.mapItem.supportedMapTypes[i].name) { + mapBackground.mapItem.activeMapType = mapBackground.mapItem.supportedMapTypes[i] + mapEngine.saveSetting("currentMapType", map); + return; + } + } + } + function addMap(map, checked) { + var mItem = mapTypeMenu.addItem(map); + mItem.checkable = true + mItem.checked = checked + mItem.exclusiveGroup = currentMapType + var menuSlot = function() {setCurrentMap(map);}; + mItem.triggered.connect(menuSlot); + } + function update() { + clear() + var map = '' + if (mapBackground.mapItem.supportedMapTypes.length > 0) + map = mapBackground.mapItem.activeMapType.name; + map = mapEngine.loadSetting("currentMapType", map); + for (var i = 0; i < mapBackground.mapItem.supportedMapTypes.length; i++) { + var name = mapBackground.mapItem.supportedMapTypes[i].name; + addMap(name, map === name); + } + if(map != '') + setCurrentMap(map); + } + + } + + SplitView { + id: splitView + anchors.fill: parent + orientation: Qt.Horizontal + z: 10 + + // This sets the color of the splitter line + handleDelegate: Rectangle { + width: 1 + height: 1 + color: __palette.window + } + + //---------------------------------------------------------------------------------------- + // Map View + QGCMapBackground { + id: mapBackground + Layout.fillWidth: true + Layout.minimumWidth: 300 + heading: isNaN(mapEngine.heading) ? 0 : mapEngine.heading + latitude: 37.803784 // mapEngine.latitude + longitude: -122.462276 // mapEngine.longitude + // Chevron button at upper right corner of Map Display + Item { + id: openWaypoints + anchors.top: mapBackground.top + anchors.right: mapBackground.right + width: 30 + height: 30 + opacity: 0.85 + z: splitView.z + 10 + Image { + id: buttomImg + anchors.fill: parent + source: showWaypointEditor ? "/qml/buttonRight.svg" : "/qml/buttonLeft.svg" + mipmap: true + smooth: true + antialiasing: true + fillMode: Image.PreserveAspectFit + } + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.LeftButton + onClicked: { + if (mouse.button == Qt.LeftButton) + { + showWaypointEditor = !showWaypointEditor + } + } + } + } + } + //---------------------------------------------------------------------------------------- + // Waypoint Editor + QGCWaypointEditor { + id: waypointEditor + Layout.minimumWidth: 200 + visible: showWaypointEditor + } + } + + //-------------------------------------------------------------------------------------------- + // Right click anywhere on the map for a context menu + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.RightButton + onClicked: { + if (mouse.button == Qt.RightButton) + { + mapTypeMenu.popup() + } + } + z: splitView.z + 5 + } + + //-------------------------------------------------------------------------------------------- + // Tool Bar + Rectangle { + id: toolBar + color: Qt.rgba(0,0,0,0) + height: buttonColumn.height + visible: showWaypointEditor + anchors.top: parent.top + anchors.left: parent.left + anchors.topMargin: 40 + anchors.leftMargin: 4 + z: splitView.z + 10 + + ExclusiveGroup { id: mainActionGroup } + + Column { + id: buttonColumn + spacing: 4 + QGCMapToolButton { + width: 50 + height: 50 + imageSource: "/qml/buttonHome.svg" + exclusiveGroup: mainActionGroup + } + QGCMapToolButton { + width: 50 + height: 50 + imageSource: "/qml/buttonHome.svg" + exclusiveGroup: mainActionGroup + } + QGCMapToolButton { + width: 50 + height: 50 + imageSource: "/qml/buttonHome.svg" + exclusiveGroup: mainActionGroup + } + QGCMapToolButton { + width: 50 + height: 50 + imageSource: "/qml/buttonHome.svg" + exclusiveGroup: mainActionGroup + } + } + } +} diff --git a/src/ui/mapdisplay/QGCMapDisplay.cc b/src/ui/mapdisplay/QGCMapDisplay.cc new file mode 100644 index 000000000..62eef3df7 --- /dev/null +++ b/src/ui/mapdisplay/QGCMapDisplay.cc @@ -0,0 +1,91 @@ +/*===================================================================== + +QGroundControl Open Source Ground Control Station + +(c) 2009, 2015 QGROUNDCONTROL PROJECT + +This file is part of the QGROUNDCONTROL project + + QGROUNDCONTROL is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + QGROUNDCONTROL is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with QGROUNDCONTROL. If not, see . + +======================================================================*/ + +/** + * @file + * @brief QGC Main Map Display + * @author Gus Grubba + */ + +#include +#include +#include + +#include "QGCMapDisplay.h" +#include "UASManager.h" + +const char* kMainMapDisplayGroup = "MainMapDisplay"; + +QGCMapDisplay::QGCMapDisplay(QWidget *parent) + : QGCQmlWidgetHolder(parent) +{ + setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + setObjectName("MainMapDisplay"); + // Get rid of layout default margins + QLayout* pl = layout(); + if(pl) { + pl->setContentsMargins(0,0,0,0); + } + setMinimumWidth(270); + setMinimumHeight(300); + setContextPropertyObject("mapEngine", this); + setSource(QUrl::fromUserInput("qrc:/qml/MapDisplay.qml")); + setVisible(true); +} + +QGCMapDisplay::~QGCMapDisplay() +{ + +} + +void QGCMapDisplay::saveSetting(const QString &name, const QString& value) +{ + QSettings settings; + QString key(kMainMapDisplayGroup); + key += "/" + name; + settings.setValue(key, value); +} + +QString QGCMapDisplay::loadSetting(const QString &name, const QString& defaultValue) +{ + QSettings settings; + QString key(kMainMapDisplayGroup); + key += "/" + name; + return settings.value(key, defaultValue).toString(); +} + +/* + * Internal + */ + +void QGCMapDisplay::showEvent(QShowEvent* event) +{ + // React only to internal (pre-display) events + QWidget::showEvent(event); +} + +void QGCMapDisplay::hideEvent(QHideEvent* event) +{ + // React only to internal (pre-display) events + QWidget::hideEvent(event); +} diff --git a/src/ui/mapdisplay/QGCMapDisplay.h b/src/ui/mapdisplay/QGCMapDisplay.h new file mode 100644 index 000000000..86aca81b7 --- /dev/null +++ b/src/ui/mapdisplay/QGCMapDisplay.h @@ -0,0 +1,65 @@ +/*===================================================================== + +QGroundControl Open Source Ground Control Station + +(c) 2009, 2015 QGROUNDCONTROL PROJECT + +This file is part of the QGROUNDCONTROL project + + QGROUNDCONTROL is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + QGROUNDCONTROL is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with QGROUNDCONTROL. If not, see . + +======================================================================*/ + +/** + * @file + * @brief QGC Main Map Display + * @author Gus Grubba + */ + +#ifndef QGCMAPDISPLAY_H +#define QGCMAPDISPLAY_H + +#include "QGCQmlWidgetHolder.h" + +class UASInterface; +class UASWaypointManager; + +class QGCMapDisplay : public QGCQmlWidgetHolder +{ + Q_OBJECT +public: + QGCMapDisplay(QWidget* parent = NULL); + ~QGCMapDisplay(); + + Q_INVOKABLE void saveSetting (const QString &key, const QString& value); + Q_INVOKABLE QString loadSetting (const QString &key, const QString& defaultValue); + + /** @brief Start updating widget */ + void showEvent(QShowEvent* event); + /** @brief Stop updating widget */ + void hideEvent(QHideEvent* event); + +signals: + +private slots: + +private: + +private: + UASWaypointManager* WPM; + +}; + + +#endif // QGCFLIGHTDISPLAY_H diff --git a/src/ui/flightdisplay/components/QGCAltitudeWidget.qml b/src/ui/qmlcommon/QGCAltitudeWidget.qml similarity index 100% rename from src/ui/flightdisplay/components/QGCAltitudeWidget.qml rename to src/ui/qmlcommon/QGCAltitudeWidget.qml diff --git a/src/ui/flightdisplay/components/QGCAttitudeWidget.qml b/src/ui/qmlcommon/QGCAttitudeWidget.qml similarity index 100% rename from src/ui/flightdisplay/components/QGCAttitudeWidget.qml rename to src/ui/qmlcommon/QGCAttitudeWidget.qml diff --git a/src/ui/flightdisplay/components/QGCCompass.qml b/src/ui/qmlcommon/QGCCompass.qml similarity index 100% rename from src/ui/flightdisplay/components/QGCCompass.qml rename to src/ui/qmlcommon/QGCCompass.qml diff --git a/src/ui/flightdisplay/components/QGCCurrentAltitude.qml b/src/ui/qmlcommon/QGCCurrentAltitude.qml similarity index 100% rename from src/ui/flightdisplay/components/QGCCurrentAltitude.qml rename to src/ui/qmlcommon/QGCCurrentAltitude.qml diff --git a/src/ui/flightdisplay/components/QGCCurrentSpeed.qml b/src/ui/qmlcommon/QGCCurrentSpeed.qml similarity index 100% rename from src/ui/flightdisplay/components/QGCCurrentSpeed.qml rename to src/ui/qmlcommon/QGCCurrentSpeed.qml diff --git a/src/ui/flightdisplay/components/QGCMapBackground.qml b/src/ui/qmlcommon/QGCMapBackground.qml similarity index 97% rename from src/ui/flightdisplay/components/QGCMapBackground.qml rename to src/ui/qmlcommon/QGCMapBackground.qml index 20132ad30..c4c9c0d3b 100644 --- a/src/ui/flightdisplay/components/QGCMapBackground.qml +++ b/src/ui/qmlcommon/QGCMapBackground.qml @@ -31,18 +31,17 @@ import QtQuick 2.4 import QtPositioning 5.3 import QtLocation 5.3 -import QGroundControl.HUDControls 1.0 +import QGroundControl.FlightControls 1.0 Rectangle { id: root property real latitude: 37.803784 property real longitude : -122.462276 - property real zoomLevel: (map.maximumZoomLevel - map.minimumZoomLevel) / 2 + property real zoomLevel: 15 property real heading: 0 property bool alwaysNorth: true property alias mapItem: map - anchors.fill: parent color: Qt.rgba(0,0,0,0) clip: true diff --git a/src/ui/qmlcommon/QGCMapToolButton.qml b/src/ui/qmlcommon/QGCMapToolButton.qml new file mode 100644 index 000000000..2ae9b88d7 --- /dev/null +++ b/src/ui/qmlcommon/QGCMapToolButton.qml @@ -0,0 +1,71 @@ +import QtQuick 2.2 +import QtQuick.Controls 1.2 +import QtQuick.Controls.Styles 1.2 +import QtQuick.Controls.Private 1.0 + +import QGroundControl.Controls 1.0 +import QGroundControl.Palette 1.0 +import QGroundControl.ScreenTools 1.0 + +Button { + property var imageSource: undefined + property var __qgcPal: QGCPalette { colorGroupEnabled: enabled } + property bool __showHighlight: (pressed | hovered | checked) && !__forceHoverOff + property ScreenTools __screenTools: ScreenTools { } + + // This fixes the issue with button hover where if a Button is near the edge oa QQuickWidget you can + // move the mouse fast enough such that the MouseArea does not trigger an onExited. This is turn + // cause the hover property to not be cleared correctly. + + property bool __forceHoverOff: false + property int __lastGlobalMouseX: 0 + property int __lastGlobalMouseY: 0 + + Connections { + target: __behavior + onMouseXChanged: { + __lastGlobalMouseX = __screenTools.mouseX + __lastGlobalMouseY = __screenTools.mouseY + } + onMouseYChanged: { + __lastGlobalMouseX = __screenTools.mouseX + __lastGlobalMouseY = __screenTools.mouseY + } + onEntered: { __forceHoverOff; false; hoverTimer.start() } + onExited: { __forceHoverOff; false; hoverTimer.stop() } + } + + Timer { + id: hoverTimer + interval: 250 + repeat: true + onTriggered: { + if (__lastGlobalMouseX != __screenTools.mouseX || __lastGlobalMouseY != __screenTools.mouseY) { + __forceHoverOff = true + } else { + __forceHoverOff = false + } + } + } + + style: ButtonStyle { + /*! This defines the background of the button. */ + background: Item { + property bool __checked: (control.checkable && control.checked) + + Rectangle { + id: backgroundRectangle + anchors.fill: parent + color: __showHighlight ? __qgcPal.buttonHighlight : (__checked ? __qgcPal.buttonHighlight : __qgcPal.window); + } + + QGCColoredImage { + id: image + anchors.fill: parent + opacity: control.enabled ? 0.6 : 0.5 + source: imageSource + color: __showHighlight ? __qgcPal.buttonHighlightText : (__checked ? __qgcPal.primaryButtonText : __qgcPal.buttonText) + } + } + } +} diff --git a/src/ui/flightdisplay/components/QGCPitchWidget.qml b/src/ui/qmlcommon/QGCPitchWidget.qml similarity index 100% rename from src/ui/flightdisplay/components/QGCPitchWidget.qml rename to src/ui/qmlcommon/QGCPitchWidget.qml diff --git a/src/ui/flightdisplay/components/QGCSlider.qml b/src/ui/qmlcommon/QGCSlider.qml similarity index 100% rename from src/ui/flightdisplay/components/QGCSlider.qml rename to src/ui/qmlcommon/QGCSlider.qml diff --git a/src/ui/flightdisplay/components/QGCSpeedWidget.qml b/src/ui/qmlcommon/QGCSpeedWidget.qml similarity index 100% rename from src/ui/flightdisplay/components/QGCSpeedWidget.qml rename to src/ui/qmlcommon/QGCSpeedWidget.qml diff --git a/src/ui/qmlcommon/QGCWaypointEditor.qml b/src/ui/qmlcommon/QGCWaypointEditor.qml new file mode 100644 index 000000000..317a5bb09 --- /dev/null +++ b/src/ui/qmlcommon/QGCWaypointEditor.qml @@ -0,0 +1,39 @@ +/*===================================================================== + +QGroundControl Open Source Ground Control Station + +(c) 2009, 2015 QGROUNDCONTROL PROJECT + +This file is part of the QGROUNDCONTROL project + + QGROUNDCONTROL is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + QGROUNDCONTROL is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with QGROUNDCONTROL. If not, see . + +======================================================================*/ + +/** + * @file + * @brief QGC Waypoint Editor + * @author Gus Grubba + */ + +import QtQuick 2.4 + +import QGroundControl.Palette 1.0 + +Rectangle { + QGCPalette { id: palette; colorGroupEnabled: true } + id: root + color: palette.window + +} diff --git a/src/ui/qmlcommon/buttonHome.svg b/src/ui/qmlcommon/buttonHome.svg new file mode 100644 index 000000000..22012e566 --- /dev/null +++ b/src/ui/qmlcommon/buttonHome.svg @@ -0,0 +1,11 @@ + + + + + + + diff --git a/src/ui/qmlcommon/buttonLeft.svg b/src/ui/qmlcommon/buttonLeft.svg new file mode 100644 index 000000000..8219d4ffe --- /dev/null +++ b/src/ui/qmlcommon/buttonLeft.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + diff --git a/src/ui/qmlcommon/buttonRight.svg b/src/ui/qmlcommon/buttonRight.svg new file mode 100644 index 000000000..a8d7e8498 --- /dev/null +++ b/src/ui/qmlcommon/buttonRight.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + diff --git a/src/ui/flightdisplay/components/compass.svg b/src/ui/qmlcommon/compass.svg similarity index 100% rename from src/ui/flightdisplay/components/compass.svg rename to src/ui/qmlcommon/compass.svg diff --git a/src/ui/flightdisplay/components/compassNeedle.svg b/src/ui/qmlcommon/compassNeedle.svg similarity index 100% rename from src/ui/flightdisplay/components/compassNeedle.svg rename to src/ui/qmlcommon/compassNeedle.svg diff --git a/src/ui/flightdisplay/components/crossHair.svg b/src/ui/qmlcommon/crossHair.svg similarity index 100% rename from src/ui/flightdisplay/components/crossHair.svg rename to src/ui/qmlcommon/crossHair.svg diff --git a/src/ui/flightdisplay/components/qmldir b/src/ui/qmlcommon/qmldir similarity index 68% rename from src/ui/flightdisplay/components/qmldir rename to src/ui/qmlcommon/qmldir index 647204bec..02d05968e 100644 --- a/src/ui/flightdisplay/components/qmldir +++ b/src/ui/qmlcommon/qmldir @@ -1,4 +1,4 @@ -Module QGroundControl.HUDControls +Module QGroundControl.FlightControls QGCAltitudeWidget 1.0 QGCAltitudeWidget.qml QGCAttitudeWidget 1.0 QGCAttitudeWidget.qml @@ -8,4 +8,6 @@ QGCCurrentSpeed 1.0 QGCCurrentSpeed.qml QGCMapBackground 1.0 QGCMapBackground.qml QGCPitchWidget 1.0 QGCPitchWidget.qml QGCSpeedWidget 1.0 QGCSpeedWidget.qml -QGCSlider 1.0 QGCSlider.qml \ No newline at end of file +QGCSlider 1.0 QGCSlider.qml +QGCWaypointEditor 1.0 QGCWaypointEditor.qml +QGCMapToolButton 1.0 QGCMapToolButton.qml \ No newline at end of file diff --git a/src/ui/flightdisplay/components/rollDial.svg b/src/ui/qmlcommon/rollDial.svg similarity index 100% rename from src/ui/flightdisplay/components/rollDial.svg rename to src/ui/qmlcommon/rollDial.svg diff --git a/src/ui/flightdisplay/components/rollDialWhite.svg b/src/ui/qmlcommon/rollDialWhite.svg similarity index 100% rename from src/ui/flightdisplay/components/rollDialWhite.svg rename to src/ui/qmlcommon/rollDialWhite.svg diff --git a/src/ui/flightdisplay/components/rollPointer.svg b/src/ui/qmlcommon/rollPointer.svg similarity index 100% rename from src/ui/flightdisplay/components/rollPointer.svg rename to src/ui/qmlcommon/rollPointer.svg diff --git a/src/ui/flightdisplay/components/rollPointerWhite.svg b/src/ui/qmlcommon/rollPointerWhite.svg similarity index 100% rename from src/ui/flightdisplay/components/rollPointerWhite.svg rename to src/ui/qmlcommon/rollPointerWhite.svg diff --git a/src/ui/flightdisplay/components/scale.png b/src/ui/qmlcommon/scale.png similarity index 100% rename from src/ui/flightdisplay/components/scale.png rename to src/ui/qmlcommon/scale.png diff --git a/src/ui/flightdisplay/components/scale_end.png b/src/ui/qmlcommon/scale_end.png similarity index 100% rename from src/ui/flightdisplay/components/scale_end.png rename to src/ui/qmlcommon/scale_end.png diff --git a/src/ui/toolbar/MainToolBar.cc b/src/ui/toolbar/MainToolBar.cc index f5409e93e..451c98d48 100644 --- a/src/ui/toolbar/MainToolBar.cc +++ b/src/ui/toolbar/MainToolBar.cc @@ -73,7 +73,6 @@ MainToolBar::MainToolBar(QWidget* parent) if(pl) { pl->setContentsMargins(0,0,0,0); } - // Tool Bar Preferences QSettings settings; settings.beginGroup(TOOL_BAR_SETTINGS_GROUP); @@ -137,20 +136,20 @@ void MainToolBar::onSetupView() void MainToolBar::onPlanView() { - setCurrentView(MainWindow::VIEW_MISSION); - MainWindow::instance()->loadOperatorView(); + setCurrentView(MainWindow::VIEW_PLAN); + MainWindow::instance()->loadPlanView(); } void MainToolBar::onFlyView() { setCurrentView(MainWindow::VIEW_FLIGHT); - MainWindow::instance()->loadPilotView(); + MainWindow::instance()->loadFlightView(); } void MainToolBar::onAnalyzeView() { - setCurrentView(MainWindow::VIEW_ENGINEER); - MainWindow::instance()->loadEngineerView(); + setCurrentView(MainWindow::VIEW_ANALYZE); + MainWindow::instance()->loadAnalyzeView(); } void MainToolBar::onConnect(QString conf) @@ -264,10 +263,10 @@ void MainToolBar::setCurrentView(int currentView) { ViewType_t view = ViewNone; switch((MainWindow::VIEW_SECTIONS)currentView) { - case MainWindow::VIEW_ENGINEER: + case MainWindow::VIEW_ANALYZE: view = ViewAnalyze; break; - case MainWindow::VIEW_MISSION: + case MainWindow::VIEW_PLAN: view = ViewPlan; break; case MainWindow::VIEW_FLIGHT: diff --git a/src/ui/toolbar/MainToolBar.qml b/src/ui/toolbar/MainToolBar.qml index 003eeabb7..207373e98 100644 --- a/src/ui/toolbar/MainToolBar.qml +++ b/src/ui/toolbar/MainToolBar.qml @@ -57,8 +57,8 @@ Rectangle { property var colorGreenText: (qgcPal.globalTheme === QGCPalette.Light) ? "#046b1b" : "#00d930" property var colorWhiteText: (qgcPal.globalTheme === QGCPalette.Light) ? "#343333" : "#f0f0f0" - id: toolBarHolder - color: qgcPal.windowShade + id: toolBarHolder + color: qgcPal.windowShade function getMessageColor() { if(mainToolBar.messageType === MainToolBar.MessageNone) -- 2.22.0