Commit 4d13d78e authored by dogmaphobic's avatar dogmaphobic

Experimental mapping/planning tool.

parent f6c0565b
...@@ -156,6 +156,7 @@ INCLUDEPATH += \ ...@@ -156,6 +156,7 @@ INCLUDEPATH += \
src/ui/main \ src/ui/main \
src/ui/toolbar \ src/ui/toolbar \
src/ui/flightdisplay \ src/ui/flightdisplay \
src/ui/mapdisplay \
src/VehicleSetup \ src/VehicleSetup \
src/AutoPilotPlugins \ src/AutoPilotPlugins \
src/QmlControls src/QmlControls
...@@ -379,7 +380,8 @@ HEADERS += \ ...@@ -379,7 +380,8 @@ HEADERS += \
src/ui/toolbar/MainToolBar.h \ src/ui/toolbar/MainToolBar.h \
src/QmlControls/ScreenTools.h \ src/QmlControls/ScreenTools.h \
src/QGCLoggingCategory.h \ src/QGCLoggingCategory.h \
src/ui/flightdisplay/QGCFlightDisplay.h src/ui/flightdisplay/QGCFlightDisplay.h \
src/ui/mapdisplay/QGCMapDisplay.h
SOURCES += \ SOURCES += \
src/main.cc \ src/main.cc \
...@@ -519,7 +521,8 @@ SOURCES += \ ...@@ -519,7 +521,8 @@ SOURCES += \
src/ui/toolbar/MainToolBar.cc \ src/ui/toolbar/MainToolBar.cc \
src/QmlControls/ScreenTools.cc \ src/QmlControls/ScreenTools.cc \
src/QGCLoggingCategory.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 # Unit Test specific configuration goes here
......
...@@ -87,28 +87,36 @@ ...@@ -87,28 +87,36 @@
<file alias="PowerComponentBattery_04cell.svg">src/AutoPilotPlugins/PX4/Images/PowerComponentBattery_04cell.svg</file> <file alias="PowerComponentBattery_04cell.svg">src/AutoPilotPlugins/PX4/Images/PowerComponentBattery_04cell.svg</file>
<file alias="PowerComponentBattery_05cell.svg">src/AutoPilotPlugins/PX4/Images/PowerComponentBattery_05cell.svg</file> <file alias="PowerComponentBattery_05cell.svg">src/AutoPilotPlugins/PX4/Images/PowerComponentBattery_05cell.svg</file>
<file alias="PowerComponentBattery_06cell.svg">src/AutoPilotPlugins/PX4/Images/PowerComponentBattery_06cell.svg</file> <file alias="PowerComponentBattery_06cell.svg">src/AutoPilotPlugins/PX4/Images/PowerComponentBattery_06cell.svg</file>
<!-- QML Main UI -->
<file alias="MainToolBar.qml">src/ui/toolbar/MainToolBar.qml</file> <file alias="MainToolBar.qml">src/ui/toolbar/MainToolBar.qml</file>
<file alias="FlightDisplay.qml">src/ui/flightdisplay/FlightDisplay.qml</file> <file alias="FlightDisplay.qml">src/ui/flightdisplay/FlightDisplay.qml</file>
<file alias="QGroundControl/HUDControls/qmldir">src/ui/flightdisplay/components/qmldir</file> <file alias="MapDisplay.qml">src/ui/mapdisplay/MapDisplay.qml</file>
<file alias="QGroundControl/HUDControls/QGCAltitudeWidget.qml">src/ui/flightdisplay/components/QGCAltitudeWidget.qml</file> <!-- QML Main UI Components -->
<file alias="QGroundControl/HUDControls/QGCAttitudeWidget.qml">src/ui/flightdisplay/components/QGCAttitudeWidget.qml</file> <file alias="QGroundControl/FlightControls/qmldir">src/ui/qmlcommon/qmldir</file>
<file alias="QGroundControl/HUDControls/QGCCompass.qml">src/ui/flightdisplay/components/QGCCompass.qml</file> <file alias="QGroundControl/FlightControls/QGCAltitudeWidget.qml">src/ui/qmlcommon/QGCAltitudeWidget.qml</file>
<file alias="QGroundControl/HUDControls/QGCCurrentAltitude.qml">src/ui/flightdisplay/components/QGCCurrentAltitude.qml</file> <file alias="QGroundControl/FlightControls/QGCAttitudeWidget.qml">src/ui/qmlcommon/QGCAttitudeWidget.qml</file>
<file alias="QGroundControl/HUDControls/QGCCurrentSpeed.qml">src/ui/flightdisplay/components/QGCCurrentSpeed.qml</file> <file alias="QGroundControl/FlightControls/QGCCompass.qml">src/ui/qmlcommon/QGCCompass.qml</file>
<file alias="QGroundControl/HUDControls/QGCMapBackground.qml">src/ui/flightdisplay/components/QGCMapBackground.qml</file> <file alias="QGroundControl/FlightControls/QGCCurrentAltitude.qml">src/ui/qmlcommon/QGCCurrentAltitude.qml</file>
<file alias="QGroundControl/HUDControls/QGCPitchWidget.qml">src/ui/flightdisplay/components/QGCPitchWidget.qml</file> <file alias="QGroundControl/FlightControls/QGCCurrentSpeed.qml">src/ui/qmlcommon/QGCCurrentSpeed.qml</file>
<file alias="QGroundControl/HUDControls/QGCSpeedWidget.qml">src/ui/flightdisplay/components/QGCSpeedWidget.qml</file> <file alias="QGroundControl/FlightControls/QGCMapBackground.qml">src/ui/qmlcommon/QGCMapBackground.qml</file>
<file alias="QGroundControl/HUDControls/QGCSlider.qml">src/ui/flightdisplay/components/QGCSlider.qml</file> <file alias="QGroundControl/FlightControls/QGCPitchWidget.qml">src/ui/qmlcommon/QGCPitchWidget.qml</file>
<file alias="compass.svg">src/ui/flightdisplay/components/compass.svg</file> <file alias="QGroundControl/FlightControls/QGCSpeedWidget.qml">src/ui/qmlcommon/QGCSpeedWidget.qml</file>
<file alias="compassNeedle.svg">src/ui/flightdisplay/components/compassNeedle.svg</file> <file alias="QGroundControl/FlightControls/QGCSlider.qml">src/ui/qmlcommon/QGCSlider.qml</file>
<file alias="crossHair.svg">src/ui/flightdisplay/components/crossHair.svg</file> <file alias="QGroundControl/FlightControls/QGCWaypointEditor.qml">src/ui/qmlcommon/QGCWaypointEditor.qml</file>
<file alias="rollDial.svg">src/ui/flightdisplay/components/rollDial.svg</file> <file alias="QGroundControl/FlightControls/QGCMapToolButton.qml">src/ui/qmlcommon/QGCMapToolButton.qml</file>
<file alias="rollDialWhite.svg">src/ui/flightdisplay/components/rollDialWhite.svg</file> <!-- QML Main UI Resources -->
<file alias="rollPointer.svg">src/ui/flightdisplay/components/rollPointer.svg</file> <file alias="compass.svg">src/ui/qmlcommon/compass.svg</file>
<file alias="rollPointerWhite.svg">src/ui/flightdisplay/components/rollPointerWhite.svg</file> <file alias="compassNeedle.svg">src/ui/qmlcommon/compassNeedle.svg</file>
<file alias="scale.png">src/ui/flightdisplay/components/scale.png</file> <file alias="crossHair.svg">src/ui/qmlcommon/crossHair.svg</file>
<file alias="scale_end.png">src/ui/flightdisplay/components/scale_end.png</file> <file alias="rollDial.svg">src/ui/qmlcommon/rollDial.svg</file>
<file alias="rollDialWhite.svg">src/ui/qmlcommon/rollDialWhite.svg</file>
<file alias="rollPointer.svg">src/ui/qmlcommon/rollPointer.svg</file>
<file alias="rollPointerWhite.svg">src/ui/qmlcommon/rollPointerWhite.svg</file>
<file alias="scale.png">src/ui/qmlcommon/scale.png</file>
<file alias="scale_end.png">src/ui/qmlcommon/scale_end.png</file>
<file alias="buttonLeft.svg">src/ui/qmlcommon/buttonLeft.svg</file>
<file alias="buttonRight.svg">src/ui/qmlcommon/buttonRight.svg</file>
<file alias="buttonHome.svg">src/ui/qmlcommon/buttonHome.svg</file>
</qresource> </qresource>
<qresource prefix="/AutoPilotPlugins/PX4"> <qresource prefix="/AutoPilotPlugins/PX4">
......
...@@ -23,20 +23,21 @@ Item { ...@@ -23,20 +23,21 @@ Item {
property alias status: image.status property alias status: image.status
property alias verticalAlignment: image.verticalAlignment property alias verticalAlignment: image.verticalAlignment
width: image.width width: image.width
height: image.height height: image.height
Image { Image {
id: image id: image
smooth: true smooth: true
mipmap: true mipmap: true
visible: false antialiasing: true
anchors.fill: parent visible: false
anchors.fill: parent
} }
ColorOverlay { ColorOverlay {
anchors.fill: image anchors.fill: image
source: image source: image
color: parent.color color: parent.color
} }
} }
...@@ -51,6 +51,7 @@ This file is part of the QGROUNDCONTROL project ...@@ -51,6 +51,7 @@ This file is part of the QGROUNDCONTROL project
#include "QGCMAVLinkLogPlayer.h" #include "QGCMAVLinkLogPlayer.h"
#include "SettingsDialog.h" #include "SettingsDialog.h"
#include "QGCMapTool.h" #include "QGCMapTool.h"
#include "QGCMapDisplay.h"
#include "MAVLinkDecoder.h" #include "MAVLinkDecoder.h"
#include "QGCMAVLinkMessageSender.h" #include "QGCMAVLinkMessageSender.h"
#include "QGCRGBDView.h" #include "QGCRGBDView.h"
...@@ -151,6 +152,7 @@ MainWindow::MainWindow(QSplashScreen* splashScreen) ...@@ -151,6 +152,7 @@ MainWindow::MainWindow(QSplashScreen* splashScreen)
// Setup central widget with a layout to hold the views // Setup central widget with a layout to hold the views
_centralLayout = new QVBoxLayout(); _centralLayout = new QVBoxLayout();
_centralLayout->setContentsMargins(0,0,0,0);
centralWidget()->setLayout(_centralLayout); centralWidget()->setLayout(_centralLayout);
// Set dock options // Set dock options
setDockOptions(AnimatedDocks | AllowTabbedDocks | AllowNestedDocks); setDockOptions(AnimatedDocks | AllowTabbedDocks | AllowNestedDocks);
...@@ -263,9 +265,9 @@ MainWindow::MainWindow(QSplashScreen* splashScreen) ...@@ -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 // Set OS dependent keyboard shortcuts for the main window, non OS dependent shortcuts are set in MainWindow.ui
#ifdef Q_OS_MACX #ifdef Q_OS_MACX
_ui.actionSetup->setShortcut(QApplication::translate("MainWindow", "Meta+1", 0)); _ui.actionSetup->setShortcut(QApplication::translate("MainWindow", "Meta+1", 0));
_ui.actionMissionView->setShortcut(QApplication::translate("MainWindow", "Meta+2", 0)); _ui.actionPlan->setShortcut(QApplication::translate("MainWindow", "Meta+2", 0));
_ui.actionFlightView->setShortcut(QApplication::translate("MainWindow", "Meta+3", 0)); _ui.actionFlight->setShortcut(QApplication::translate("MainWindow", "Meta+3", 0));
_ui.actionEngineersView->setShortcut(QApplication::translate("MainWindow", "Meta+4", 0)); _ui.actionAnalyze->setShortcut(QApplication::translate("MainWindow", "Meta+4", 0));
_ui.actionLocal3DView->setShortcut(QApplication::translate("MainWindow", "Meta+5", 0)); _ui.actionLocal3DView->setShortcut(QApplication::translate("MainWindow", "Meta+5", 0));
_ui.actionTerminalView->setShortcut(QApplication::translate("MainWindow", "Meta+6", 0)); _ui.actionTerminalView->setShortcut(QApplication::translate("MainWindow", "Meta+6", 0));
_ui.actionSimulationView->setShortcut(QApplication::translate("MainWindow", "Meta+7", 0)); _ui.actionSimulationView->setShortcut(QApplication::translate("MainWindow", "Meta+7", 0));
...@@ -273,7 +275,7 @@ MainWindow::MainWindow(QSplashScreen* splashScreen) ...@@ -273,7 +275,7 @@ MainWindow::MainWindow(QSplashScreen* splashScreen)
#else #else
_ui.actionSetup->setShortcut(QApplication::translate("MainWindow", "Ctrl+1", 0)); _ui.actionSetup->setShortcut(QApplication::translate("MainWindow", "Ctrl+1", 0));
_ui.actionMissionView->setShortcut(QApplication::translate("MainWindow", "Ctrl+2", 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.actionEngineersView->setShortcut(QApplication::translate("MainWindow", "Ctrl+4", 0));
_ui.actionLocal3DView->setShortcut(QApplication::translate("MainWindow", "Ctrl+5", 0)); _ui.actionLocal3DView->setShortcut(QApplication::translate("MainWindow", "Ctrl+5", 0));
_ui.actionTerminalView->setShortcut(QApplication::translate("MainWindow", "Ctrl+6", 0)); _ui.actionTerminalView->setShortcut(QApplication::translate("MainWindow", "Ctrl+6", 0));
...@@ -441,20 +443,28 @@ void MainWindow::_buildCommonWidgets(void) ...@@ -441,20 +443,28 @@ void MainWindow::_buildCommonWidgets(void)
_buildCustomWidgets(); _buildCustomWidgets();
} }
void MainWindow::_buildPlannerView(void) void MainWindow::_buildPlanView(void)
{ {
if (!_plannerView) { if (!_planView) {
_plannerView = new QGCMapTool(this); _planView = new QGCMapTool(this);
_plannerView->setVisible(false); _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 PrimaryFlightDisplay(this);
_pilotView = new QGCFlightDisplay(this); _flightView = new QGCFlightDisplay(this);
_pilotView->setVisible(false); _flightView->setVisible(false);
} }
} }
...@@ -466,11 +476,11 @@ void MainWindow::_buildSetupView(void) ...@@ -466,11 +476,11 @@ void MainWindow::_buildSetupView(void)
} }
} }
void MainWindow::_buildEngineeringView(void) void MainWindow::_buildAnalyzeView(void)
{ {
if (!_engineeringView) { if (!_analyzeView) {
_engineeringView = new QGCDataPlot2D(this); _analyzeView = new QGCDataPlot2D(this);
_engineeringView->setVisible(false); _analyzeView->setVisible(false);
} }
} }
...@@ -726,8 +736,9 @@ void MainWindow::loadSettings() ...@@ -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. // 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(); VIEW_SECTIONS currentViewCandidate = (VIEW_SECTIONS) settings.value("CURRENT_VIEW", _currentView).toInt();
switch (currentViewCandidate) { switch (currentViewCandidate) {
case VIEW_ENGINEER: case VIEW_ANALYZE:
case VIEW_MISSION: case VIEW_PLAN:
case VIEW_EXPERIMENTAL_PLAN:
case VIEW_FLIGHT: case VIEW_FLIGHT:
case VIEW_SIMULATION: case VIEW_SIMULATION:
case VIEW_SETUP: case VIEW_SETUP:
...@@ -797,13 +808,14 @@ void MainWindow::connectCommonActions() ...@@ -797,13 +808,14 @@ void MainWindow::connectCommonActions()
{ {
// Bind together the perspective actions // Bind together the perspective actions
QActionGroup* perspectives = new QActionGroup(_ui.menuPerspectives); QActionGroup* perspectives = new QActionGroup(_ui.menuPerspectives);
perspectives->addAction(_ui.actionEngineersView); perspectives->addAction(_ui.actionAnalyze);
perspectives->addAction(_ui.actionFlightView); perspectives->addAction(_ui.actionFlight);
perspectives->addAction(_ui.actionSimulationView); perspectives->addAction(_ui.actionSimulationView);
perspectives->addAction(_ui.actionMissionView); perspectives->addAction(_ui.actionPlan);
perspectives->addAction(_ui.actionSetup); perspectives->addAction(_ui.actionSetup);
perspectives->addAction(_ui.actionTerminalView); perspectives->addAction(_ui.actionTerminalView);
perspectives->addAction(_ui.actionLocal3DView); perspectives->addAction(_ui.actionLocal3DView);
perspectives->addAction(_ui.actionExperimentalPlanView);
perspectives->setExclusive(true); perspectives->setExclusive(true);
/* Hide the actions that are not relevant */ /* Hide the actions that are not relevant */
...@@ -812,25 +824,30 @@ void MainWindow::connectCommonActions() ...@@ -812,25 +824,30 @@ void MainWindow::connectCommonActions()
#endif #endif
// Mark the right one as selected // Mark the right one as selected
if (_currentView == VIEW_ENGINEER) if (_currentView == VIEW_ANALYZE)
{ {
_ui.actionEngineersView->setChecked(true); _ui.actionAnalyze->setChecked(true);
_ui.actionEngineersView->activate(QAction::Trigger); _ui.actionAnalyze->activate(QAction::Trigger);
} }
if (_currentView == VIEW_FLIGHT) if (_currentView == VIEW_FLIGHT)
{ {
_ui.actionFlightView->setChecked(true); _ui.actionFlight->setChecked(true);
_ui.actionFlightView->activate(QAction::Trigger); _ui.actionFlight->activate(QAction::Trigger);
} }
if (_currentView == VIEW_SIMULATION) if (_currentView == VIEW_SIMULATION)
{ {
_ui.actionSimulationView->setChecked(true); _ui.actionSimulationView->setChecked(true);
_ui.actionSimulationView->activate(QAction::Trigger); _ui.actionSimulationView->activate(QAction::Trigger);
} }
if (_currentView == VIEW_MISSION) if (_currentView == VIEW_PLAN)
{ {
_ui.actionMissionView->setChecked(true); _ui.actionPlan->setChecked(true);
_ui.actionMissionView->activate(QAction::Trigger); _ui.actionPlan->activate(QAction::Trigger);
}
if (_currentView == VIEW_EXPERIMENTAL_PLAN)
{
_ui.actionExperimentalPlanView->setChecked(true);
_ui.actionExperimentalPlanView->activate(QAction::Trigger);
} }
if (_currentView == VIEW_SETUP) if (_currentView == VIEW_SETUP)
{ {
...@@ -870,10 +887,11 @@ void MainWindow::connectCommonActions() ...@@ -870,10 +887,11 @@ void MainWindow::connectCommonActions()
connect(_ui.actionShutdownMAV, SIGNAL(triggered()), UASManager::instance(), SLOT(shutdownActiveUAS())); connect(_ui.actionShutdownMAV, SIGNAL(triggered()), UASManager::instance(), SLOT(shutdownActiveUAS()));
// Views actions // 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.actionSimulationView, SIGNAL(triggered()), this, SLOT(loadSimulationView()));
connect(_ui.actionEngineersView, SIGNAL(triggered()), this, SLOT(loadEngineerView())); connect(_ui.actionAnalyze, SIGNAL(triggered()), this, SLOT(loadAnalyzeView()));
connect(_ui.actionMissionView, SIGNAL(triggered()), this, SLOT(loadOperatorView())); 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.actionLocal3DView, SIGNAL(triggered()), this, SLOT(loadLocal3DView()));
connect(_ui.actionTerminalView,SIGNAL(triggered()),this,SLOT(loadTerminalView())); connect(_ui.actionTerminalView,SIGNAL(triggered()),this,SLOT(loadTerminalView()));
...@@ -998,9 +1016,9 @@ void MainWindow::UASCreated(UASInterface* uas) ...@@ -998,9 +1016,9 @@ void MainWindow::UASCreated(UASInterface* uas)
} }
linechartWidget->addSource(mavlinkDecoder); linechartWidget->addSource(mavlinkDecoder);
if (_engineeringView != linechartWidget) if (_analyzeView != linechartWidget)
{ {
_engineeringView = linechartWidget; _analyzeView = linechartWidget;
} }
// Reload view state in case new widgets were added // Reload view state in case new widgets were added
...@@ -1047,24 +1065,31 @@ void MainWindow::_loadCurrentViewState(void) ...@@ -1047,24 +1065,31 @@ void MainWindow::_loadCurrentViewState(void)
centerView = _setupView; centerView = _setupView;
break; break;
case VIEW_ENGINEER: case VIEW_ANALYZE:
_buildEngineeringView(); _buildAnalyzeView();
centerView = _engineeringView; centerView = _analyzeView;
defaultWidgets = "MAVLINK_INSPECTOR_DOCKWIDGET,PARAMETER_INTERFACE_DOCKWIDGET,FILE_VIEW_DOCKWIDGET,HEAD_UP_DISPLAY_DOCKWIDGET"; defaultWidgets = "MAVLINK_INSPECTOR_DOCKWIDGET,PARAMETER_INTERFACE_DOCKWIDGET,FILE_VIEW_DOCKWIDGET,HEAD_UP_DISPLAY_DOCKWIDGET";
break; break;
case VIEW_FLIGHT: case VIEW_FLIGHT:
_buildPilotView(); _buildFlightView();
centerView = _pilotView; centerView = _flightView;
defaultWidgets = "COMMUNICATION_CONSOLE_DOCKWIDGET,UAS_INFO_INFOVIEW_DOCKWIDGET"; //defaultWidgets = "COMMUNICATION_CONSOLE_DOCKWIDGET,UAS_INFO_INFOVIEW_DOCKWIDGET";
defaultWidgets.clear();
break; break;
case VIEW_MISSION: case VIEW_PLAN:
_buildPlannerView(); _buildPlanView();
centerView = _plannerView; centerView = _planView;
defaultWidgets = "UNMANNED_SYSTEM_LIST_DOCKWIDGET,WAYPOINT_LIST_DOCKWIDGET"; defaultWidgets = "UNMANNED_SYSTEM_LIST_DOCKWIDGET,WAYPOINT_LIST_DOCKWIDGET";
break; break;
case VIEW_EXPERIMENTAL_PLAN:
_buildExperimentalPlanView();
centerView = _experimentalPlanView;
defaultWidgets.clear();
break;
case VIEW_SIMULATION: case VIEW_SIMULATION:
_buildSimView(); _buildSimView();
centerView = _simView; centerView = _simView;
...@@ -1096,6 +1121,7 @@ void MainWindow::_loadCurrentViewState(void) ...@@ -1096,6 +1121,7 @@ void MainWindow::_loadCurrentViewState(void)
Q_ASSERT(_centralLayout->count() == 0); Q_ASSERT(_centralLayout->count() == 0);
_currentViewWidget = centerView; _currentViewWidget = centerView;
_centralLayout->addWidget(_currentViewWidget); _centralLayout->addWidget(_currentViewWidget);
_centralLayout->setContentsMargins(0, 0, 0, 0);
_currentViewWidget->setVisible(true); _currentViewWidget->setVisible(true);
// Hide all widgets from previous view // Hide all widgets from previous view
...@@ -1174,27 +1200,39 @@ void MainWindow::handleMisconfiguration(UASInterface* uas) ...@@ -1174,27 +1200,39 @@ void MainWindow::handleMisconfiguration(UASInterface* uas)
} }
} }
void MainWindow::loadEngineerView() void MainWindow::loadAnalyzeView()
{ {
if (_currentView != VIEW_ENGINEER) if (_currentView != VIEW_ANALYZE)
{ {
_storeCurrentViewState(); _storeCurrentViewState();
_currentView = VIEW_ENGINEER; _currentView = VIEW_ANALYZE;
_ui.actionEngineersView->setChecked(true); _ui.actionAnalyze->setChecked(true);
_loadCurrentViewState(); _loadCurrentViewState();
} }
} }
void MainWindow::loadOperatorView() void MainWindow::loadPlanView()
{ {
if (_currentView != VIEW_MISSION) if (_currentView != VIEW_PLAN)
{ {
_storeCurrentViewState(); _storeCurrentViewState();
_currentView = VIEW_MISSION; _currentView = VIEW_PLAN;
_ui.actionMissionView->setChecked(true); _ui.actionPlan->setChecked(true);
_loadCurrentViewState(); _loadCurrentViewState();
} }
} }
void MainWindow::loadOldPlanView()
{
if (_currentView != VIEW_EXPERIMENTAL_PLAN)
{
_storeCurrentViewState();
_currentView = VIEW_EXPERIMENTAL_PLAN;
_ui.actionExperimentalPlanView->setChecked(true);
_loadCurrentViewState();
}
}
void MainWindow::loadSetupView() void MainWindow::loadSetupView()
{ {
if (_currentView != VIEW_SETUP) if (_currentView != VIEW_SETUP)
...@@ -1228,13 +1266,13 @@ void MainWindow::loadLocal3DView() ...@@ -1228,13 +1266,13 @@ void MainWindow::loadLocal3DView()
} }
} }
void MainWindow::loadPilotView() void MainWindow::loadFlightView()
{ {
if (_currentView != VIEW_FLIGHT) if (_currentView != VIEW_FLIGHT)
{ {
_storeCurrentViewState(); _storeCurrentViewState();
_currentView = VIEW_FLIGHT; _currentView = VIEW_FLIGHT;
_ui.actionFlightView->setChecked(true); _ui.actionFlight->setChecked(true);
_loadCurrentViewState(); _loadCurrentViewState();
} }
} }
......
...@@ -146,13 +146,15 @@ public slots: ...@@ -146,13 +146,15 @@ public slots:
/** @brief Load configuration views */ /** @brief Load configuration views */
void loadSetupView(); void loadSetupView();
/** @brief Load view for pilot */ /** @brief Load view for pilot */
void loadPilotView(); void loadFlightView();
/** @brief Load view for simulation */ /** @brief Load view for simulation */
void loadSimulationView(); void loadSimulationView();
/** @brief Load view for engineer */ /** @brief Load view for engineer */
void loadEngineerView(); void loadAnalyzeView();
/** @brief Load view for operator */ /** @brief Load New (QtQuick) Map View (Mission) */
void loadOperatorView(); void loadPlanView();
/** @brief Load Old (Qt Widget) Map View (Mission) */
void loadOldPlanView();
/** @brief Load Terminal Console views */ /** @brief Load Terminal Console views */
void loadTerminalView(); void loadTerminalView();
/** @brief Load local 3D view */ /** @brief Load local 3D view */
...@@ -220,13 +222,14 @@ protected: ...@@ -220,13 +222,14 @@ protected:
typedef enum _VIEW_SECTIONS typedef enum _VIEW_SECTIONS
{ {
VIEW_ENGINEER, // Engineering/Analyze view mode. Used for analyzing data and modifying onboard parameters VIEW_ANALYZE, // 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_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_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_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_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_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_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; } VIEW_SECTIONS;
/** @brief Catch window resize events */ /** @brief Catch window resize events */
...@@ -300,10 +303,11 @@ private: ...@@ -300,10 +303,11 @@ private:
void _openUrl(const QString& url, const QString& errorMessage); void _openUrl(const QString& url, const QString& errorMessage);
// Center widgets // Center widgets
QPointer<QWidget> _plannerView; QPointer<QWidget> _planView;
QPointer<QWidget> _pilotView; QPointer<QWidget> _experimentalPlanView;
QPointer<QWidget> _flightView;
QPointer<QWidget> _setupView; QPointer<QWidget> _setupView;
QPointer<QWidget> _engineeringView; QPointer<QWidget> _analyzeView;
QPointer<QWidget> _simView; QPointer<QWidget> _simView;
QPointer<QWidget> _terminalView; QPointer<QWidget> _terminalView;
QPointer<QWidget> _local3DView; QPointer<QWidget> _local3DView;
...@@ -329,10 +333,11 @@ private: ...@@ -329,10 +333,11 @@ private:
QMap<int, QDockWidget*> _mapUasId2HilDockWidget; QMap<int, QDockWidget*> _mapUasId2HilDockWidget;
QMap<QDockWidget*, QAction*> _mapDockWidget2Action; QMap<QDockWidget*, QAction*> _mapDockWidget2Action;
void _buildPlannerView(void); void _buildPlanView(void);
void _buildPilotView(void); void _buildExperimentalPlanView(void);
void _buildFlightView(void);
void _buildSetupView(void); void _buildSetupView(void);
void _buildEngineeringView(void); void _buildAnalyzeView(void);
void _buildSimView(void); void _buildSimView(void);
void _buildTerminalView(void); void _buildTerminalView(void);
void _buildLocal3DView(void); void _buildLocal3DView(void);
......
...@@ -78,9 +78,9 @@ ...@@ -78,9 +78,9 @@
<string>View</string> <string>View</string>
</property> </property>
<addaction name="actionSetup"/> <addaction name="actionSetup"/>
<addaction name="actionMissionView"/> <addaction name="actionPlan"/>
<addaction name="actionFlightView"/> <addaction name="actionFlight"/>
<addaction name="actionEngineersView"/> <addaction name="actionAnalyze"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionFullscreen"/> <addaction name="actionFullscreen"/>
<addaction name="actionNormal"/> <addaction name="actionNormal"/>
...@@ -99,6 +99,7 @@ ...@@ -99,6 +99,7 @@
<addaction name="actionLoadCustomWidgetFile"/> <addaction name="actionLoadCustomWidgetFile"/>
<addaction name="separator"/> <addaction name="separator"/>
</widget> </widget>
<addaction name="actionExperimentalPlanView"/>
<addaction name="actionLocal3DView"/> <addaction name="actionLocal3DView"/>
<addaction name="actionTerminalView"/> <addaction name="actionTerminalView"/>
<addaction name="actionSimulationView"/> <addaction name="actionSimulationView"/>
...@@ -198,7 +199,7 @@ ...@@ -198,7 +199,7 @@
<string>Developer Credits</string> <string>Developer Credits</string>
</property> </property>
</action> </action>
<action name="actionMissionView"> <action name="actionPlan">
<property name="checkable"> <property name="checkable">
<bool>true</bool> <bool>true</bool>
</property> </property>
...@@ -206,7 +207,7 @@ ...@@ -206,7 +207,7 @@
<string>Plan</string> <string>Plan</string>
</property> </property>
</action> </action>
<action name="actionEngineersView"> <action name="actionAnalyze">
<property name="checkable"> <property name="checkable">
<bool>true</bool> <bool>true</bool>
</property> </property>
...@@ -214,7 +215,7 @@ ...@@ -214,7 +215,7 @@
<string>Analyze</string> <string>Analyze</string>
</property> </property>
</action> </action>
<action name="actionFlightView"> <action name="actionFlight">
<property name="checkable"> <property name="checkable">
<bool>true</bool> <bool>true</bool>
</property> </property>
...@@ -345,6 +346,11 @@ ...@@ -345,6 +346,11 @@
<string>Status Bar</string> <string>Status Bar</string>
</property> </property>
</action> </action>
<action name="actionExperimentalPlanView">
<property name="text">
<string>Experimental Plan View</string>
</property>
</action>
</widget> </widget>
<layoutdefault spacing="6" margin="11"/> <layoutdefault spacing="6" margin="11"/>
<resources> <resources>
......
...@@ -23,7 +23,7 @@ This file is part of the QGROUNDCONTROL project ...@@ -23,7 +23,7 @@ This file is part of the QGROUNDCONTROL project
/** /**
* @file * @file
* @brief QGC Main Tool Bar * @brief QGC Main Flight Display
* @author Gus Grubba <mavlink@grubba.com> * @author Gus Grubba <mavlink@grubba.com>
*/ */
...@@ -31,7 +31,7 @@ import QtQuick 2.3 ...@@ -31,7 +31,7 @@ import QtQuick 2.3
import QtQuick.Controls 1.2 import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2 import QtQuick.Controls.Styles 1.2
import QGroundControl.HUDControls 1.0 import QGroundControl.FlightControls 1.0
Rectangle { Rectangle {
id: root id: root
...@@ -285,17 +285,17 @@ Rectangle { ...@@ -285,17 +285,17 @@ Rectangle {
} }
QGCMapBackground { QGCMapBackground {
id: mapBackground id: mapBackground
anchors.centerIn: parent anchors.fill: parent
visible: false visible: false
heading: isNaN(flightDisplay.heading) ? 0 : flightDisplay.heading heading: isNaN(flightDisplay.heading) ? 0 : flightDisplay.heading
latitude: flightDisplay.latitude latitude: flightDisplay.latitude
longitude: flightDisplay.longitude longitude: flightDisplay.longitude
z: 5 z: 5
} }
QGCAttitudeWidget { QGCAttitudeWidget {
id: attitudeWidget id: attitudeWidget
anchors.centerIn: parent anchors.centerIn: parent
rollAngle: roll rollAngle: roll
pitchAngle: pitch pitchAngle: pitch
...@@ -305,7 +305,7 @@ Rectangle { ...@@ -305,7 +305,7 @@ Rectangle {
} }
QGCPitchWidget { QGCPitchWidget {
id: pitchWidget id: pitchWidget
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
pitchAngle: pitch pitchAngle: pitch
rollAngle: roll rollAngle: roll
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
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 <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief QGC Main Map Display
* @author Gus Grubba <mavlink@grubba.com>
*/
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
}
}
}
}
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
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 <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief QGC Main Map Display
* @author Gus Grubba <mavlink@grubba.com>
*/
#include <QQmlContext>
#include <QQmlEngine>
#include <QSettings>
#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);
}
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
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 <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief QGC Main Map Display
* @author Gus Grubba <mavlink@grubba.com>
*/
#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
...@@ -31,18 +31,17 @@ import QtQuick 2.4 ...@@ -31,18 +31,17 @@ import QtQuick 2.4
import QtPositioning 5.3 import QtPositioning 5.3
import QtLocation 5.3 import QtLocation 5.3
import QGroundControl.HUDControls 1.0 import QGroundControl.FlightControls 1.0
Rectangle { Rectangle {
id: root id: root
property real latitude: 37.803784 property real latitude: 37.803784
property real longitude : -122.462276 property real longitude : -122.462276
property real zoomLevel: (map.maximumZoomLevel - map.minimumZoomLevel) / 2 property real zoomLevel: 15
property real heading: 0 property real heading: 0
property bool alwaysNorth: true property bool alwaysNorth: true
property alias mapItem: map property alias mapItem: map
anchors.fill: parent
color: Qt.rgba(0,0,0,0) color: Qt.rgba(0,0,0,0)
clip: true clip: true
......
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)
}
}
}
}
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
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 <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief QGC Waypoint Editor
* @author Gus Grubba <mavlink@grubba.com>
*/
import QtQuick 2.4
import QGroundControl.Palette 1.0
Rectangle {
QGCPalette { id: palette; colorGroupEnabled: true }
id: root
color: palette.window
}
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 288 288" enable-background="new 0 0 288 288" xml:space="preserve">
<g>
<path fill="#BCBEC0" d="M131.601,164.5l-0.4-5.2c-1.2-10.801,2.4-22.602,12.399-34.603c9-10.601,14-18.401,14-27.401
c0-10.201-6.399-17.001-18.999-17.201c-7.2,0-15.2,2.4-20.2,6.2l-4.8-12.601c6.6-4.8,18-8,28.6-8c23,0,33.399,14.201,33.399,29.402
c0,13.601-7.6,23.401-17.199,34.802c-8.8,10.401-12,19.201-11.4,29.402l0.2,5.2H131.601z M127.201,192.502
c0-7.4,5-12.602,12-12.602s11.8,5.201,11.8,12.602c0,7-4.6,12.4-12,12.4C132,204.902,127.201,199.502,127.201,192.502z"/>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 288 288" enable-background="new 0 0 288 288" xml:space="preserve">
<g id="Layer_1">
<rect fill="#58595B" width="288" height="288"/>
</g>
<g id="Layer_2">
<polyline fill="none" stroke="#A7A9AC" stroke-width="24" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="
110.541,54 58.58,144 110.541,234 "/>
<polyline fill="none" stroke="#A7A9AC" stroke-width="24" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="
169.981,54 118.019,144 169.981,234 "/>
<polyline fill="none" stroke="#A7A9AC" stroke-width="24" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="
229.42,54 177.459,144 229.42,234 "/>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 288 288" enable-background="new 0 0 288 288" xml:space="preserve">
<g id="Layer_1">
<rect fill="#58595B" width="288" height="288"/>
</g>
<g id="Layer_2">
<polyline fill="none" stroke="#A7A9AC" stroke-width="24" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="
177.459,234 229.42,144 177.459,54 "/>
<polyline fill="none" stroke="#A7A9AC" stroke-width="24" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="
118.019,234 169.981,144 118.019,54 "/>
<polyline fill="none" stroke="#A7A9AC" stroke-width="24" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="
58.58,234 110.541,144 58.58,54 "/>
</g>
</svg>
Module QGroundControl.HUDControls Module QGroundControl.FlightControls
QGCAltitudeWidget 1.0 QGCAltitudeWidget.qml QGCAltitudeWidget 1.0 QGCAltitudeWidget.qml
QGCAttitudeWidget 1.0 QGCAttitudeWidget.qml QGCAttitudeWidget 1.0 QGCAttitudeWidget.qml
...@@ -8,4 +8,6 @@ QGCCurrentSpeed 1.0 QGCCurrentSpeed.qml ...@@ -8,4 +8,6 @@ QGCCurrentSpeed 1.0 QGCCurrentSpeed.qml
QGCMapBackground 1.0 QGCMapBackground.qml QGCMapBackground 1.0 QGCMapBackground.qml
QGCPitchWidget 1.0 QGCPitchWidget.qml QGCPitchWidget 1.0 QGCPitchWidget.qml
QGCSpeedWidget 1.0 QGCSpeedWidget.qml QGCSpeedWidget 1.0 QGCSpeedWidget.qml
QGCSlider 1.0 QGCSlider.qml QGCSlider 1.0 QGCSlider.qml
\ No newline at end of file QGCWaypointEditor 1.0 QGCWaypointEditor.qml
QGCMapToolButton 1.0 QGCMapToolButton.qml
\ No newline at end of file
...@@ -73,7 +73,6 @@ MainToolBar::MainToolBar(QWidget* parent) ...@@ -73,7 +73,6 @@ MainToolBar::MainToolBar(QWidget* parent)
if(pl) { if(pl) {
pl->setContentsMargins(0,0,0,0); pl->setContentsMargins(0,0,0,0);
} }
// Tool Bar Preferences // Tool Bar Preferences
QSettings settings; QSettings settings;
settings.beginGroup(TOOL_BAR_SETTINGS_GROUP); settings.beginGroup(TOOL_BAR_SETTINGS_GROUP);
...@@ -137,20 +136,20 @@ void MainToolBar::onSetupView() ...@@ -137,20 +136,20 @@ void MainToolBar::onSetupView()
void MainToolBar::onPlanView() void MainToolBar::onPlanView()
{ {
setCurrentView(MainWindow::VIEW_MISSION); setCurrentView(MainWindow::VIEW_PLAN);
MainWindow::instance()->loadOperatorView(); MainWindow::instance()->loadPlanView();
} }
void MainToolBar::onFlyView() void MainToolBar::onFlyView()
{ {
setCurrentView(MainWindow::VIEW_FLIGHT); setCurrentView(MainWindow::VIEW_FLIGHT);
MainWindow::instance()->loadPilotView(); MainWindow::instance()->loadFlightView();
} }
void MainToolBar::onAnalyzeView() void MainToolBar::onAnalyzeView()
{ {
setCurrentView(MainWindow::VIEW_ENGINEER); setCurrentView(MainWindow::VIEW_ANALYZE);
MainWindow::instance()->loadEngineerView(); MainWindow::instance()->loadAnalyzeView();
} }
void MainToolBar::onConnect(QString conf) void MainToolBar::onConnect(QString conf)
...@@ -264,10 +263,10 @@ void MainToolBar::setCurrentView(int currentView) ...@@ -264,10 +263,10 @@ void MainToolBar::setCurrentView(int currentView)
{ {
ViewType_t view = ViewNone; ViewType_t view = ViewNone;
switch((MainWindow::VIEW_SECTIONS)currentView) { switch((MainWindow::VIEW_SECTIONS)currentView) {
case MainWindow::VIEW_ENGINEER: case MainWindow::VIEW_ANALYZE:
view = ViewAnalyze; view = ViewAnalyze;
break; break;
case MainWindow::VIEW_MISSION: case MainWindow::VIEW_PLAN:
view = ViewPlan; view = ViewPlan;
break; break;
case MainWindow::VIEW_FLIGHT: case MainWindow::VIEW_FLIGHT:
......
...@@ -57,8 +57,8 @@ Rectangle { ...@@ -57,8 +57,8 @@ Rectangle {
property var colorGreenText: (qgcPal.globalTheme === QGCPalette.Light) ? "#046b1b" : "#00d930" property var colorGreenText: (qgcPal.globalTheme === QGCPalette.Light) ? "#046b1b" : "#00d930"
property var colorWhiteText: (qgcPal.globalTheme === QGCPalette.Light) ? "#343333" : "#f0f0f0" property var colorWhiteText: (qgcPal.globalTheme === QGCPalette.Light) ? "#343333" : "#f0f0f0"
id: toolBarHolder id: toolBarHolder
color: qgcPal.windowShade color: qgcPal.windowShade
function getMessageColor() { function getMessageColor() {
if(mainToolBar.messageType === MainToolBar.MessageNone) if(mainToolBar.messageType === MainToolBar.MessageNone)
......
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