Unverified Commit e3b7affe authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #8731 from DonLakeFlyer/FlyViewLayers

Rework Fly View into separate layers which can be customized at each layer
parents 3fbf2893 7644653c
......@@ -31,4 +31,7 @@
<file alias="Custom/Widgets/CustomVehicleButton.qml">res/Custom/Widgets/CustomVehicleButton.qml</file>
<file alias="Custom/Widgets/qmldir">res/Custom/Widgets/qmldir</file>
</qresource>
<qresource prefix="/qml">
<file alias="QGroundControl/FlightDisplay/FlyViewCustomLayer.qml">res/CustomFlyViewOverlay.qml</file>
</qresource>
</RCC>
<file alias="PaperPlane.svg">src/ui/toolbar/Images/PaperPlane.svg</file>
<file alias="QGroundControl/FlightDisplay/FlyViewCustomLayer.qml">src/FlightDisplay/FlyViewCustomLayer.qml</file>
......@@ -127,6 +127,7 @@
<file alias="QGroundControl/Controls/QGCButton.qml">../src/QmlControls/QGCButton.qml</file>
<file alias="QGroundControl/Controls/QGCCheckBox.qml">../src/QmlControls/QGCCheckBox.qml</file>
<file alias="QGroundControl/Controls/QGCColoredImage.qml">../src/QmlControls/QGCColoredImage.qml</file>
<file alias="QGroundControl/Controls/QGCControlDebug.qml">../src/QmlControls/QGCControlDebug.qml</file>
<file alias="QGroundControl/Controls/QGCComboBox.qml">../src/QmlControls/QGCComboBox.qml</file>
<file alias="QGroundControl/Controls/QGCFileDialog.qml">../src/QmlControls/QGCFileDialog.qml</file>
<file alias="QGroundControl/Controls/QGCFlickable.qml">../src/QmlControls/QGCFlickable.qml</file>
......@@ -147,7 +148,8 @@
<file alias="QGroundControl/Controls/QGCMovableItem.qml">../src/QmlControls/QGCMovableItem.qml</file>
<file alias="QGroundControl/Controls/QGCPopupDialog.qml">../src/QmlControls/QGCPopupDialog.qml</file>
<file alias="QGroundControl/Controls/QGCPopupDialogContainer.qml">../src/QmlControls/QGCPopupDialogContainer.qml</file>
<file alias="QGroundControl/Controls/QGCPipable.qml">../src/QmlControls/QGCPipable.qml</file>
<file alias="QGroundControl/Controls/QGCPipOverlay.qml">../src/QmlControls/QGCPipOverlay.qml</file>
<file alias="QGroundControl/Controls/QGCPipState.qml">../src/QmlControls/QGCPipState.qml</file>
<file alias="QGroundControl/Controls/QGCRadioButton.qml">../src/QmlControls/QGCRadioButton.qml</file>
<file alias="QGroundControl/Controls/QGCSlider.qml">../src/QmlControls/QGCSlider.qml</file>
<file alias="QGroundControl/Controls/QGCSwitch.qml">../src/QmlControls/QGCSwitch.qml</file>
......@@ -155,6 +157,7 @@
<file alias="QGroundControl/Controls/QGCTabButton.qml">../src/QmlControls/QGCTabButton.qml</file>
<file alias="QGroundControl/Controls/QGCTextField.qml">../src/QmlControls/QGCTextField.qml</file>
<file alias="QGroundControl/Controls/QGCToolBarButton.qml">../src/QmlControls/QGCToolBarButton.qml</file>
<file alias="QGroundControl/Controls/QGCToolInsets.qml">../src/QmlControls/QGCToolInsets.qml</file>
<file alias="QGroundControl/Controls/QGCViewDialog.qml">../src/QmlControls/QGCViewDialog.qml</file>
<file alias="QGroundControl/Controls/QGCViewMessage.qml">../src/QmlControls/QGCViewMessage.qml</file>
<file alias="QGroundControl/Controls/qmldir">../src/QmlControls/QGroundControl/Controls/qmldir</file>
......@@ -190,21 +193,31 @@
<file alias="QGroundControl/FactControls/FactTextFieldSlider.qml">../src/FactSystem/FactControls/FactTextFieldSlider.qml</file>
<file alias="QGroundControl/FactControls/FactValueSlider.qml">../src/FactSystem/FactControls/FactValueSlider.qml</file>
<file alias="QGroundControl/FactControls/qmldir">../src/QmlControls/QGroundControl/FactControls/qmldir</file>
<file alias="QGroundControl/FlightDisplay/FlightDisplayView.qml">../src/FlightDisplay/FlightDisplayView.qml</file>
<file alias="QGroundControl/FlightDisplay/FlightDisplayViewMap.qml">../src/FlightDisplay/FlightDisplayViewMap.qml</file>
<file alias="QGroundControl/FlightDisplay/FlightDisplayViewVideo.qml">../src/FlightDisplay/FlightDisplayViewVideo.qml</file>
<file alias="QGroundControl/FlightDisplay/FlightDisplayViewWidgets.qml">../src/FlightDisplay/FlightDisplayViewWidgets.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewAirspaceIndicator.qml">../src/FlightDisplay/FlyViewAirspaceIndicator.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyView.qml">../src/FlightDisplay/FlyView.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewCustomLayer.qml">../src/FlightDisplay/FlyViewCustomLayer.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewInstrumentPanel.qml">../src/FlightDisplay/FlyViewInstrumentPanel.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewMap.qml">../src/FlightDisplay/FlyViewMap.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewMissionCompleteDialog.qml">../src/FlightDisplay/FlyViewMissionCompleteDialog.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewPreFlightChecklistPopup.qml">../src/FlightDisplay/FlyViewPreFlightChecklistPopup.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewToolStrip.qml">../src/FlightDisplay/FlyViewToolStrip.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewVideo.qml">../src/FlightDisplay/FlyViewVideo.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewWidgetLayer.qml">../src/FlightDisplay/FlyViewWidgetLayer.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedActionConfirm.qml">../src/FlightDisplay/GuidedActionConfirm.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedActionList.qml">../src/FlightDisplay/GuidedActionList.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedActionsController.qml">../src/FlightDisplay/GuidedActionsController.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedAltitudeSlider.qml">../src/FlightDisplay/GuidedAltitudeSlider.qml</file>
<file alias="QGroundControl/FlightDisplay/MultiVehicleList.qml">../src/FlightDisplay/MultiVehicleList.qml</file>
<file alias="QGroundControl/FlightDisplay/MultiVehiclePanel.qml">../src/FlightDisplay/MultiVehiclePanel.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightBatteryCheck.qml">../src/FlightDisplay/PreFlightBatteryCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightGPSCheck.qml">../src/FlightDisplay/PreFlightGPSCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightRCCheck.qml">../src/FlightDisplay/PreFlightRCCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightSensorsHealthCheck.qml">../src/FlightDisplay/PreFlightSensorsHealthCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightSoundCheck.qml">../src/FlightDisplay/PreFlightSoundCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/TerrainProgress.qml">../src/FlightDisplay/TerrainProgress.qml</file>
<file alias="QGroundControl/FlightDisplay/VehicleWarnings.qml">../src/FlightDisplay/VehicleWarnings.qml</file>
<file alias="QGroundControl/FlightDisplay/qmldir">../src/QmlControls/QGroundControl/FlightDisplay/qmldir</file>
<file alias="QGroundControl/FlightMap/CameraTriggerIndicator.qml">../src/FlightMap/MapItems/CameraTriggerIndicator.qml</file>
<file alias="QGroundControl/FlightMap/CenterMapDropButton.qml">../src/FlightMap/Widgets/CenterMapDropButton.qml</file>
......
This diff is collapsed.
......@@ -26,33 +26,41 @@
QGC_LOGGING_CATEGORY(CustomLog, "CustomLog")
CustomOptions::CustomOptions(CustomPlugin*, QObject* parent)
: QGCOptions(parent)
CustomFlyViewOptions::CustomFlyViewOptions(CustomOptions* options, QObject* parent)
: QGCFlyViewOptions(options, parent)
{
}
// Firmware upgrade page is only shown in Advanced Mode.
bool CustomOptions::showFirmwareUpgrade() const
// This custom build does not support conecting multiple vehicles to it. This in turn simplifies various parts of the QGC ui.
bool CustomFlyViewOptions::showMultiVehicleList(void) const
{
return qgcApp()->toolbox()->corePlugin()->showAdvancedUI();
return false;
}
// This custom build does not support conecting multiple vehicles to it. This in turn simplifies various parts of the QGC ui.
bool CustomOptions::enableMultiVehicleList(void) const
// This custom build has it's own custom instrument panel. Don't show regular one.
bool CustomFlyViewOptions::showInstrumentPanel(void) const
{
return false;
}
// This allows you to show a custom overlay on the fly screen.
QUrl CustomOptions::flyViewOverlay(void) const
CustomOptions::CustomOptions(CustomPlugin*, QObject* parent)
: QGCOptions(parent)
{
}
QGCFlyViewOptions* CustomOptions::flyViewOptions(void)
{
return QUrl::fromUserInput("qrc:/custom/CustomFlyViewOverlay.qml");
if (!_flyViewOptions) {
_flyViewOptions = new CustomFlyViewOptions(this, this);
}
return _flyViewOptions;
}
// The standard instrement widget is now show. Only the custom overlay is shown.
CustomInstrumentWidget* CustomOptions::instrumentWidget(void)
// Firmware upgrade page is only shown in Advanced Mode.
bool CustomOptions::showFirmwareUpgrade() const
{
return nullptr;
return qgcApp()->toolbox()->corePlugin()->showAdvancedUI();
}
// Normal QGC needs to work with an ESP8266 WiFi thing which is remarkably crappy. This in turns causes PX4 Pro calibration to fail
......@@ -63,11 +71,9 @@ bool CustomOptions::wifiReliableForCalibration(void) const
return true;
}
CustomPlugin::CustomPlugin(QGCApplication *app, QGCToolbox* toolbox)
: QGCCorePlugin(app, toolbox)
{
_options = new CustomOptions(this, this);
_showAdvancedUI = false;
}
......
......@@ -19,25 +19,35 @@
#include <QTranslator>
class CustomOptions;
class CustomPlugin;
class CustomSettings;
Q_DECLARE_LOGGING_CATEGORY(CustomLog)
class CustomFlyViewOptions : public QGCFlyViewOptions
{
public:
CustomFlyViewOptions(CustomOptions* options, QObject* parent = nullptr);
// Overrides from CustomFlyViewOptions
bool showInstrumentPanel (void) const final;
bool showMultiVehicleList (void) const final;
};
class CustomOptions : public QGCOptions
{
public:
CustomOptions(CustomPlugin*, QObject* parent = nullptr);
// Overrides from QGCOptions
bool wifiReliableForCalibration (void) const final;
QUrl flyViewOverlay (void) const final;
CustomInstrumentWidget* instrumentWidget (void) final;
bool showFirmwareUpgrade (void) const final;
bool enableMultiVehicleList (void) const final;
};
QGCFlyViewOptions* flyViewOptions(void) final;
private:
CustomFlyViewOptions* _flyViewOptions = nullptr;
};
class CustomPlugin : public QGCCorePlugin
{
......
......@@ -157,6 +157,7 @@
<file alias="QGroundControl/Controls/QGCTabButton.qml">src/QmlControls/QGCTabButton.qml</file>
<file alias="QGroundControl/Controls/QGCTextField.qml">src/QmlControls/QGCTextField.qml</file>
<file alias="QGroundControl/Controls/QGCToolBarButton.qml">src/QmlControls/QGCToolBarButton.qml</file>
<file alias="QGroundControl/Controls/QGCToolInsets.qml">src/QmlControls/QGCToolInsets.qml</file>
<file alias="QGroundControl/Controls/QGCViewDialog.qml">src/QmlControls/QGCViewDialog.qml</file>
<file alias="QGroundControl/Controls/QGCViewMessage.qml">src/QmlControls/QGCViewMessage.qml</file>
<file alias="QGroundControl/Controls/qmldir">src/QmlControls/QGroundControl/Controls/qmldir</file>
......@@ -192,14 +193,18 @@
<file alias="QGroundControl/FactControls/FactTextFieldSlider.qml">src/FactSystem/FactControls/FactTextFieldSlider.qml</file>
<file alias="QGroundControl/FactControls/FactValueSlider.qml">src/FactSystem/FactControls/FactValueSlider.qml</file>
<file alias="QGroundControl/FactControls/qmldir">src/QmlControls/QGroundControl/FactControls/qmldir</file>
<file alias="QGroundControl/FlightDisplay/FlightDisplayView.qml">src/FlightDisplay/FlightDisplayView.qml</file>
<file alias="QGroundControl/FlightDisplay/FlightDisplayViewMap.qml">src/FlightDisplay/FlightDisplayViewMap.qml</file>
<file alias="QGroundControl/FlightDisplay/FlightDisplayViewVideo.qml">src/FlightDisplay/FlightDisplayViewVideo.qml</file>
<file alias="QGroundControl/FlightDisplay/FlightDisplayViewWidgets.qml">src/FlightDisplay/FlightDisplayViewWidgets.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewAirspaceIndicator.qml">src/FlightDisplay/FlyViewAirspaceIndicator.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyView.qml">src/FlightDisplay/FlyView.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewCustomLayer.qml">src/FlightDisplay/FlyViewCustomLayer.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewInstrumentPanel.qml">src/FlightDisplay/FlyViewInstrumentPanel.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewMap.qml">src/FlightDisplay/FlyViewMap.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewMissionCompleteDialog.qml">src/FlightDisplay/FlyViewMissionCompleteDialog.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewPreFlightChecklistPopup.qml">src/FlightDisplay/FlyViewPreFlightChecklistPopup.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewToolStrip.qml">src/FlightDisplay/FlyViewToolStrip.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewVideo.qml">src/FlightDisplay/FlyViewVideo.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewWidgetLayer.qml">src/FlightDisplay/FlyViewWidgetLayer.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedActionConfirm.qml">src/FlightDisplay/GuidedActionConfirm.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedActionList.qml">src/FlightDisplay/GuidedActionList.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedActionsController.qml">src/FlightDisplay/GuidedActionsController.qml</file>
......@@ -212,6 +217,7 @@
<file alias="QGroundControl/FlightDisplay/PreFlightSensorsHealthCheck.qml">src/FlightDisplay/PreFlightSensorsHealthCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightSoundCheck.qml">src/FlightDisplay/PreFlightSoundCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/TerrainProgress.qml">src/FlightDisplay/TerrainProgress.qml</file>
<file alias="QGroundControl/FlightDisplay/VehicleWarnings.qml">src/FlightDisplay/VehicleWarnings.qml</file>
<file alias="QGroundControl/FlightDisplay/qmldir">src/QmlControls/QGroundControl/FlightDisplay/qmldir</file>
<file alias="QGroundControl/FlightMap/CameraTriggerIndicator.qml">src/FlightMap/MapItems/CameraTriggerIndicator.qml</file>
<file alias="QGroundControl/FlightMap/CenterMapDropButton.qml">src/FlightMap/Widgets/CenterMapDropButton.qml</file>
......
This diff is collapsed.
......@@ -50,12 +50,6 @@ Item {
font.pointSize: useSmallFont ? ScreenTools.smallFontPointSize : ScreenTools.largeFontPointSize
anchors.centerIn: parent
}
MouseArea {
anchors.fill: parent
onDoubleClicked: {
QGroundControl.videoManager.fullScreen = !QGroundControl.videoManager.fullScreen
}
}
}
Rectangle {
anchors.fill: parent
......@@ -176,13 +170,6 @@ Item {
opacity: _camera ? (_camera.thermalMode === QGCCameraControl.THERMAL_BLEND ? _camera.thermalOpacity / 100 : 1.0) : 0
}
}
//-- Full screen toggle
MouseArea {
anchors.fill: parent
onDoubleClicked: {
QGroundControl.videoManager.fullScreen = !QGroundControl.videoManager.fullScreen
}
}
//-- Zoom
PinchArea {
id: pinchZoom
......
/****************************************************************************
*
* (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.12
import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.12
import QtLocation 5.3
import QtPositioning 5.3
import QtQuick.Window 2.2
import QtQml.Models 2.1
import QGroundControl 1.0
import QGroundControl.Airspace 1.0
import QGroundControl.Airmap 1.0
import QGroundControl.Controllers 1.0
import QGroundControl.Controls 1.0
import QGroundControl.FactSystem 1.0
import QGroundControl.FlightDisplay 1.0
import QGroundControl.FlightMap 1.0
import QGroundControl.Palette 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.Vehicle 1.0
Item {
id: _root
PlanMasterController {
id: _planController
Component.onCompleted: {
start(true /* flyView */)
mainWindow.planMasterControllerFlyView = _planController
}
}
property bool _mainWindowIsMap: mapControl.pipState.state === mapControl.pipState.fullState
property bool _isFullWindowItemDark: _mainWindowIsMap ? mapControl.isSatelliteMap : true
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property var _missionController: _planController.missionController
property var _geoFenceController: _planController.geoFenceController
property var _rallyPointController: _planController.rallyPointController
property real _margins: ScreenTools.defaultFontPixelWidth / 2
property var _guidedController: guidedActionsController
property var _guidedActionList: guidedActionList
property var _guidedAltSlider: guidedAltSlider
property var _guidedConfirm: guidedActionConfirm
property real _toolsMargin: ScreenTools.defaultFontPixelWidth * 0.75
property rect _centerViewport: Qt.rect(0, 0, width, height)
property real _rightPanelWidth: ScreenTools.defaultFontPixelWidth * 30
property var _mapControl: mapControl
property real _fullItemZorder: 0
property real _pipItemZorder: QGroundControl.zOrderWidgets
function _calcCenterViewPort() {
var newToolInset = Qt.rect(0, 0, width, height)
toolstrip.adjustToolInset(newToolInset)
if (QGroundControl.corePlugin.options.instrumentWidget) {
flightDisplayViewWidgets.adjustToolInset(newToolInset)
}
}
QGCToolInsets {
id: _toolInsets
leftEdgeBottomInset: _pipOverlay.visible ? _pipOverlay.x + _pipOverlay.width : 0
bottomEdgeLeftInset: _pipOverlay.visible ? parent.height - _pipOverlay.y : 0
}
FlyViewWidgetLayer {
id: widgetLayer
anchors.rightMargin: _toolsMargin
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: guidedAltSlider.visible ? guidedAltSlider.left : parent.right
z: _fullItemZorder + 1
parentToolInsets: _toolInsets
mapControl: _mapControl
visible: !QGroundControl.videoManager.fullScreen
}
FlyViewCustomLayer {
id: customOverlay
anchors.fill: widgetLayer
z: _fullItemZorder + 2
parentToolInsets: widgetLayer.totalToolInsets
mapControl: _mapControl
visible: !QGroundControl.videoManager.fullScreen
}
GuidedActionsController {
id: guidedActionsController
missionController: _missionController
confirmDialog: _guidedConfirm
actionList: _guidedActionList
altitudeSlider: _guidedAltSlider
}
GuidedActionConfirm {
id: guidedActionConfirm
anchors.margins: _margins
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
z: QGroundControl.zOrderTopMost
guidedController: _guidedController
altitudeSlider: _guidedAltSlider
}
GuidedActionList {
id: guidedActionList
anchors.margins: _margins
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
z: QGroundControl.zOrderTopMost
guidedController: _guidedController
}
//-- Altitude slider
GuidedAltitudeSlider {
id: guidedAltSlider
anchors.margins: _toolsMargin
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
z: QGroundControl.zOrderTopMost
radius: ScreenTools.defaultFontPixelWidth / 2
width: ScreenTools.defaultFontPixelWidth * 10
color: qgcPal.window
visible: false
}
FlyViewMap {
id: mapControl
guidedActionsController: _guidedController
planMasterController: _planController
rightPanelWidth: ScreenTools.defaultFontPixelHeight * 9
pipMode: !_mainWindowIsMap
toolInsets: customOverlay.totalToolInsets
mapName: "FlightDisplayView"
}
FlyViewVideo {
id: videoControl
}
QGCPipOverlay {
id: _pipOverlay
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.margins: _toolsMargin
item1IsFullSettingsKey: "MainFlyWindowIsMap"
item1: mapControl
item2: QGroundControl.videoManager.hasVideo ? videoControl : null
fullZOrder: _fullItemZorder
pipZOrder: _pipItemZorder
show: !QGroundControl.videoManager.fullScreen
}
}
/****************************************************************************
*
* (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.12
import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.12
import QtLocation 5.3
import QtPositioning 5.3
import QtQuick.Window 2.2
import QtQml.Models 2.1
import QGroundControl 1.0
import QGroundControl.Airspace 1.0
import QGroundControl.Airmap 1.0
import QGroundControl.Controllers 1.0
import QGroundControl.Controls 1.0
import QGroundControl.FactSystem 1.0
import QGroundControl.FlightDisplay 1.0
import QGroundControl.FlightMap 1.0
import QGroundControl.Palette 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.Vehicle 1.0
// To implement a custom overlay copy this code to your own control in your custom code source. Then override the
// FlyViewCustomLayer.qml resource with your own qml. See the custom example and documentation for details.
Item {
id: _root
property var parentToolInsets // These insets tell you what screen real estate is available for positioning the controls in your overlay
property var toolInsets: _toolInsets // These are the insets for your custom overlay additions
property var mapControl
QGCToolInsets {
id: _toolInsets
leftEdgeCenterInset: 0
leftEdgeTopInset: 0
leftEdgeBottomInset: 0
rightEdgeCenterInset: 0
rightEdgeTopInset: 0
rightEdgeBottomInset: 0
topEdgeCenterInset: 0
topEdgeLeftInset: 0
topEdgeRightInset: 0
bottomEdgeCenterInset: 0
bottomEdgeLeftInset: 0
bottomEdgeRightInset: 0
}
}
/****************************************************************************
*
* (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.12
import QGroundControl 1.0
import QGroundControl.Airspace 1.0
import QGroundControl.Airmap 1.0
import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0
// This control contains the instruments as well and the instrument pages which include values, camera, ...
Column {
id: _root
spacing: _toolsMargin
z: QGroundControl.zOrderWidgets
property real availableHeight
property var guidedActionsController
MultiVehiclePanel {
id: multiVehiclePanel
width: parent.width
availableHeight: parent.height - y
guidedActionsController: _root.guidedActionsController
}
AirspaceControl {
id: airspaceControl
width: parent.width
planView: false
visible: QGroundControl.airmapSupported ? QGroundControl.settingsManager.airMapSettings.enableAirMap.rawValue : false
}
FlightDisplayViewWidgets {
id: flightDisplayViewWidgets
width: parent.width
missionController: _missionController
availableHeight: _root.availableHeight - y
visible: multiVehiclePanel.singleVehiclePanel
}
}
/****************************************************************************
*
* (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.12
import QGroundControl 1.0
import QGroundControl.Controls 1.0
Item {
id: _root
visible: QGroundControl.videoManager.hasVideo
property Item pipState: videoPipState
QGCPipState {
id: videoPipState
pipOverlay: _pipOverlay
isDark: true
onWindowAboutToOpen: {
QGroundControl.videoManager.stopVideo()
videoStartDelay.start()
}
onWindowAboutToClose: {
QGroundControl.videoManager.stopVideo()
videoStartDelay.start()
}
onStateChanged: {
if (pipState.state !== pipState.fullState) {
QGroundControl.videoManager.fullScreen = false
}
}
}
Timer {
id: videoStartDelay
interval: 2000;
running: false
repeat: false
onTriggered: QGroundControl.videoManager.startVideo()
}
//-- Video Streaming
FlightDisplayViewVideo {
id: videoStreaming
anchors.fill: parent
useSmallFont: _root.pipState.state !== _root.pipState.fullState
visible: QGroundControl.videoManager.isGStreamer
}
//-- UVC Video (USB Camera or Video Device)
Loader {
id: cameraLoader
anchors.fill: parent
visible: !QGroundControl.videoManager.isGStreamer
source: visible ? (QGroundControl.videoManager.uvcEnabled ? "qrc:/qml/FlightDisplayViewUVC.qml" : "qrc:/qml/FlightDisplayViewDummy.qml") : ""
}
MouseArea {
anchors.fill: parent
enabled: pipState.state === pipState.fullState
onDoubleClicked: QGroundControl.videoManager.fullScreen = !QGroundControl.videoManager.fullScreen
}
}
/****************************************************************************
*
* (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.12
import QtQuick.Controls 2.4
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.12
import QtLocation 5.3
import QtPositioning 5.3
import QtQuick.Window 2.2
import QtQml.Models 2.1
import QGroundControl 1.0
import QGroundControl.Airspace 1.0
import QGroundControl.Airmap 1.0
import QGroundControl.Controllers 1.0
import QGroundControl.Controls 1.0
import QGroundControl.FactSystem 1.0
import QGroundControl.FlightDisplay 1.0
import QGroundControl.FlightMap 1.0
import QGroundControl.Palette 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.Vehicle 1.0
// This is the ui overlay layer for the widgets/tools for Fly View
Item {
id: _root
property var parentToolInsets
property var totalToolInsets: _totalToolInsets
property var mapControl
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property var _planMasterController: mainWindow.planMasterControllerPlanView
property var _missionController: _planMasterController.missionController
property var _geoFenceController: _planMasterController.geoFenceController
property var _rallyPointController: _planMasterController.rallyPointController
property real _margins: ScreenTools.defaultFontPixelWidth / 2
property real _toolsMargin: ScreenTools.defaultFontPixelWidth * 0.75
property rect _centerViewport: Qt.rect(0, 0, width, height)
property real _rightPanelWidth: ScreenTools.defaultFontPixelWidth * 30
QGCToolInsets {
id: _totalToolInsets
leftEdgeCenterInset: toolStrip.leftInset
leftEdgeTopInset: toolStrip.leftInset
leftEdgeBottomInset: parentToolInsets.leftEdgeBottomInset
rightEdgeCenterInset: instrumentPanel.rightInset
rightEdgeTopInset: instrumentPanel.rightInset
rightEdgeBottomInset: instrumentPanel.rightInset
topEdgeCenterInset: parentToolInsets.topEdgeCenterInset
topEdgeLeftInset: parentToolInsets.topEdgeLeftInset
topEdgeRightInset: parentToolInsets.topEdgeRightInset
bottomEdgeCenterInset: mapScale.centerInset
bottomEdgeLeftInset: parentToolInsets.bottomEdgeLeftInset
bottomEdgeRightInset: parentToolInsets.bottomEdgeRightInset
}
FlyViewMissionCompleteDialog {
missionController: _missionController
geoFenceController: _geoFenceController
rallyPointController: _rallyPointController
guidedController: _root.guidedActionsController
}
FlyViewInstrumentPanel {
id: instrumentPanel
anchors.margins: _toolsMargin
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
width: _rightPanelWidth
spacing: _toolsMargin
visible: QGroundControl.corePlugin.options.flyView.showInstrumentPanel
guidedActionsController: _guidedController
availableHeight: parent.height - y - _toolsMargin
property real rightInset: visible ? parent.width - x : 0
}
//-- Virtual Joystick
Loader {
id: virtualJoystickMultiTouch
z: QGroundControl.zOrderTopMost + 1
width: parent.width - (_pipOverlay.width / 2)
height: Math.min(parent.height * 0.25, ScreenTools.defaultFontPixelWidth * 16)
visible: (_virtualJoystick ? _virtualJoystick.value : false) && !(_activeVehicle ? _activeVehicle.highLatencyLink : false)
anchors.bottom: parent.bottom
anchors.bottomMargin: parentToolInsets.leftEdgeBottomInset + ScreenTools.defaultFontPixelHeight * 2
anchors.horizontalCenter: parent.horizontalCenter
source: "qrc:/qml/VirtualJoystick.qml"
active: (_virtualJoystick ? _virtualJoystick.value : false) && !(_activeVehicle ? _activeVehicle.highLatencyLink : false)
property bool centralizeThrottle: _virtualJoystickCentralized ? _virtualJoystickCentralized.value : false
property var parentToolInsets: _totalToolInsets
property Fact _virtualJoystick: QGroundControl.settingsManager.appSettings.virtualJoystick
property Fact _virtualJoystickCentralized: QGroundControl.settingsManager.appSettings.virtualJoystickCentralized
}
FlyViewToolStrip {
id: toolStrip
anchors.leftMargin: _toolsMargin + parentToolInsets.leftEdgeCenterInset
anchors.topMargin: _toolsMargin + parentToolInsets.leftEdgeTopInset
anchors.left: parent.left
anchors.top: parent.top
z: QGroundControl.zOrderWidgets