Browse Source

FlyView: add a toolinset viewer in the fly view

this is disabled by default but can be manually uncommented in the
flyview to test or debug tool insets
QGC4.4
James Mare 1 year ago committed by Don Gagne
parent
commit
d56cdb90e7
  1. 7
      qgroundcontrol.qrc
  2. 15
      src/FlightDisplay/FlyView.qml
  3. 194
      src/FlightDisplay/FlyViewInsetViewer.qml
  4. 1
      src/QmlControls/QGroundControl/FlightDisplay/qmldir

7
qgroundcontrol.qrc

@ -185,7 +185,7 @@ @@ -185,7 +185,7 @@
<file alias="QGroundControl/Controls/TerrainStatus.qml">src/PlanView/TerrainStatus.qml</file>
<file alias="QGroundControl/Controls/TakeoffItemMapVisual.qml">src/PlanView/TakeoffItemMapVisual.qml</file>
<file alias="QGroundControl/Controls/ToolStrip.qml">src/QmlControls/ToolStrip.qml</file>
<file alias="QGroundControl/Controls/ToolStripHoverButton.qml">src/QmlControls/ToolStripHoverButton.qml</file>
<file alias="QGroundControl/Controls/ToolStripHoverButton.qml">src/QmlControls/ToolStripHoverButton.qml</file>
<file alias="QGroundControl/Controls/TransectStyleComplexItemEditor.qml">src/PlanView/TransectStyleComplexItemEditor.qml</file>
<file alias="QGroundControl/Controls/TransectStyleComplexItemStats.qml">src/PlanView/TransectStyleComplexItemStats.qml</file>
<file alias="QGroundControl/Controls/TransectStyleComplexItemTabBar.qml">src/PlanView/TransectStyleComplexItemTabBar.qml</file>
@ -287,6 +287,8 @@ @@ -287,6 +287,8 @@
<file alias="VibrationPage.qml">src/AnalyzeView/VibrationPage.qml</file>
<file alias="VirtualJoystick.qml">src/FlightDisplay/VirtualJoystick.qml</file>
<file alias="VTOLLandingPatternEditor.qml">src/PlanView/VTOLLandingPatternEditor.qml</file>
<file alias="QGroundControl/Controls/MockLinkOptionsDlg.qml">src/comm/MockLinkOptionsDlg.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewInsetViewer.qml">src/FlightDisplay/FlyViewInsetViewer.qml</file>
</qresource>
<qresource prefix="/FirstRunPromptDialogs">
<file alias="UnitsFirstRunPrompt.qml">src/FirstRunPromptDialogs/UnitsFirstRunPrompt.qml</file>
@ -357,7 +359,4 @@ @@ -357,7 +359,4 @@
<file alias="Parameter.MetaData.json">src/comm/MockLink.Parameter.MetaData.json</file>
<file alias="Arduplane.params.ftp.bin">src/comm/Mocklink.Arduplane.params.ftp.bin</file>
</qresource>
<qresource prefix="/qml">
<file alias="QGroundControl/Controls/MockLinkOptionsDlg.qml">src/comm/MockLinkOptionsDlg.qml</file>
</qresource>
</RCC>

15
src/FlightDisplay/FlyView.qml

@ -85,6 +85,7 @@ Item { @@ -85,6 +85,7 @@ Item {
visible: !QGroundControl.videoManager.fullScreen
}
FlyViewCustomLayer {
id: customOverlay
anchors.fill: widgetLayer
@ -94,6 +95,20 @@ Item { @@ -94,6 +95,20 @@ Item {
visible: !QGroundControl.videoManager.fullScreen
}
// Development tool for visualizing the insets for a paticular layer, enable if needed
/*
FlyViewInsetViewer {
id: widgetLayerInsetViewer
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: guidedValueSlider.visible ? guidedValueSlider.left : parent.right
z: widgetLayer.z + 1
insetsToView: customOverlay.totalToolInsets
}*/
GuidedActionsController {
id: guidedActionsController
missionController: _missionController

194
src/FlightDisplay/FlyViewInsetViewer.qml

@ -0,0 +1,194 @@ @@ -0,0 +1,194 @@
/****************************************************************************
*
* (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.Controls 1.0
import QGroundControl.Controllers 1.0
import QGroundControl.FlightDisplay 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.FlightMap 1.0
// This is the ui overlay layer for the widgets/tools for Fly View
Item {
id: _root
property var insetsToView: QGCToolInsets {}
property int _linethickness: 3
Rectangle {
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: parent.width/8
height: checkboxcolumn.height
width: checkboxcolumn.width
color: "dimgray"
ColumnLayout {
id: checkboxcolumn
QGCCheckBox{
checked: true
text: "leftEdgeTopInset"
onClicked: leftEdgeTopInset.visible = checked
textColor: leftEdgeTopInset.color
textBold: true
}
QGCCheckBox{
checked: true
text: "leftEdgeBottomInset"
onClicked: leftEdgeBottomInset.visible = checked
textColor: leftEdgeBottomInset.color
textBold: true
}
QGCCheckBox{
checked: true
text: "rightEdgeTopInset"
onClicked: rightEdgeTopInset.visible = checked
textColor: rightEdgeTopInset.color
textBold: true
}
QGCCheckBox{
checked: true
text: "rightEdgeBottomInset"
onClicked: rightEdgeBottomInset.visible = checked
textColor: rightEdgeBottomInset.color
textBold: true
}
QGCCheckBox{
checked: true
text: "topEdgeLeftInset"
onClicked: topEdgeLeftInset.visible = checked
textColor: topEdgeLeftInset.color
textBold: true
}
QGCCheckBox{
checked: true
text: "topEdgeRightInset"
onClicked: topEdgeRightInset.visible = checked
textColor: topEdgeRightInset.color
textBold: true
}
QGCCheckBox{
checked: true
text: "bottomEdgeLeftInset"
onClicked: bottomEdgeLeftInset.visible = checked
textColor: bottomEdgeLeftInset.color
textBold: true
}
QGCCheckBox{
checked: true
text: "bottomEdgeRightInset"
onClicked: bottomEdgeRightInset.visible = checked
textColor: bottomEdgeRightInset.color
textBold: true
}
QGCCheckBox{
checked: true
text: "centerInsetRect"
onClicked: centerInsetRect.visible = checked
textColor: centerInsetRect.border.color
textBold: true
}
}
}
Rectangle { // leftEdgeTopInset
id: leftEdgeTopInset
anchors.top: parent.top
anchors.left: parent.left
anchors.leftMargin: insetsToView.leftEdgeTopInset
height: parent.height
width: _linethickness
color: "coral"
}
Rectangle { // leftEdgeBottomInset
id: leftEdgeBottomInset
anchors.top: parent.top
anchors.left: parent.left
anchors.leftMargin: insetsToView.leftEdgeBottomInset
height: parent.height
width: _linethickness
color: "cornflowerblue"
}
Rectangle { // rightEdgeTopInset
id: rightEdgeTopInset
anchors.top: parent.top
anchors.right: parent.right
anchors.rightMargin: insetsToView.rightEdgeTopInset
height: parent.height
width: _linethickness
color: "darkslateblue"
}
Rectangle { // rightEdgeBottomInset
id: rightEdgeBottomInset
anchors.top: parent.top
anchors.right: parent.right
anchors.rightMargin: insetsToView.rightEdgeBottomInset
height: parent.height
width: _linethickness
color: "firebrick"
}
Rectangle { // topEdgeLeftInset
id: topEdgeLeftInset
anchors.top: parent.top
anchors.left: parent.left
anchors.topMargin: insetsToView.topEdgeLeftInset
height: _linethickness
width: parent.width
color: "mediumseagreen"
}
Rectangle { // topEdgeRightInset
id: topEdgeRightInset
anchors.top: parent.top
anchors.left: parent.left
anchors.topMargin: insetsToView.topEdgeRightInset
height: _linethickness
width: parent.width
color: "moccasin"
}
Rectangle { // bottomEdgeLeftInset
id: bottomEdgeLeftInset
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.bottomMargin: insetsToView.bottomEdgeLeftInset
height: _linethickness
width: parent.width
color: "salmon"
}
Rectangle { // bottomEdgeRightInset
id: bottomEdgeRightInset
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.bottomMargin: insetsToView.bottomEdgeRightInset
height: _linethickness
width: parent.width
color: "slategrey"
}
Rectangle {
id: centerInsetRect
x: insetsToView.leftEdgeCenterInset
y: insetsToView.topEdgeCenterInset
width: _root.width - insetsToView.leftEdgeCenterInset - insetsToView.rightEdgeCenterInset
height: _root.height - insetsToView.topEdgeCenterInset - insetsToView.bottomEdgeCenterInset
color: "transparent"
border.color: "yellow"
border.width: 1
radius: 0
}
}

1
src/QmlControls/QGroundControl/FlightDisplay/qmldir

@ -11,6 +11,7 @@ FlyViewToolStrip 1.0 FlyViewToolStrip.qml @@ -11,6 +11,7 @@ FlyViewToolStrip 1.0 FlyViewToolStrip.qml
FlyViewToolStripActionList 1.0 FlyViewToolStripActionList.qml
FlyViewVideo 1.0 FlyViewVideo.qml
FlyViewWidgetLayer 1.0 FlyViewWidgetLayer.qml
FlyViewInsetViewer 1.0 FlyViewInsetViewer.qml
GuidedActionActionList 1.0 GuidedActionActionList.qml
GuidedActionConfirm 1.0 GuidedActionConfirm.qml
GuidedActionsController 1.0 GuidedActionsController.qml

Loading…
Cancel
Save