Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
9df678f1
Commit
9df678f1
authored
Dec 16, 2019
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wimaMenu variable size added
parent
3b151cb4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
343 additions
and
239 deletions
+343
-239
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+55
-0
FlightDisplayWimaMenu.qml
src/FlightDisplay/FlightDisplayWimaMenu.qml
+288
-239
No files found.
src/FlightDisplay/FlightDisplayView.qml
View file @
9df678f1
...
...
@@ -546,6 +546,59 @@ QGCView {
visible
:
singleVehicleView
.
checked
&&
!
QGroundControl
.
videoManager
.
fullScreen
}
/*Rectangle {
z: _panel.z + 4
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.leftMargin: ScreenTools.defaultFontPixelWidth
anchors.bottomMargin: ScreenTools.defaultFontPixelWidth
color: "red"
width: childrenRect.width
height: childrenRect.height
Rectangle {
height: 20
width: 100
anchors.bottom: innerRectangle.top
anchors.left: parent.left
color: "green"
}
Rectangle {
id:innerRectangle
height: 100
width: 100
anchors.bottom: parent.bottom
anchors.left: parent.left
color: "blue"
}
MouseArea {
property bool value: false
anchors.fill: innerRectangle
onClicked: {
if (value) {
innerRectangle.height /= 2
innerRectangle.width /= 2
value = false
}
else
{
innerRectangle.height *= 2
innerRectangle.width *= 2
value = true
}
}
}
}*/
FlightDisplayWimaMenu
{
id
:
wimaMenu
z
:
_panel
.
z
+
4
...
...
@@ -553,6 +606,8 @@ QGCView {
anchors.bottom
:
parent
.
bottom
anchors.leftMargin
:
ScreenTools
.
defaultFontPixelWidth
anchors.bottomMargin
:
ScreenTools
.
defaultFontPixelWidth
maxWidth
:
300
maxHeight
:
500
wimaController
:
wimaController
...
...
src/FlightDisplay/FlightDisplayWimaMenu.qml
View file @
9df678f1
...
...
@@ -21,14 +21,16 @@ Item {
id
:
_root
height
:
mainFrame
.
height
width
:
mainFrame
.
width
property
var
maxHeight
:
500
property
var
maxWidth
:
300
property
int
maxHeight
:
500
property
int
maxWidth
:
300
property
var
wimaController
// must be provided by the user
property
var
planMasterController
// must be provided by the user
property
bool
_controllerValid
:
planMasterController
!==
undefined
property
real
_controllerProgressPct
:
_controllerValid
?
planMasterController
.
missionController
.
progressPct
:
0
property
double
_margins
:
ScreenTools
.
defaultPixelWidth
*
0.3
property
real
_margins
:
ScreenTools
.
defaultPixelWidth
*
0.3
signal
initSmartRTL
();
...
...
@@ -58,13 +60,13 @@ Item {
// box containing all items
Rectangle
{
// maybe replace with column and remove anchors => dynamic height:
id
:
mainFrame
anchors.left
:
parent
.
left
anchors.bottom
:
parent
.
bottom
height
:
enableWima
.
enableWimaBoolean
?
Math
.
min
(
parent
.
maxHeight
,
enableWima
.
height
+
flickable
.
contentHeight
+
2
*
_margins
)
:
enableWima
.
height
+
_margins
width
:
enableWima
.
enableWimaBoolean
?
Math
.
min
(
parent
.
maxWidth
,
flickable
.
contentWidth
+
2
*
_margins
)
:
enableWima
.
width
height
:
enableWima
.
height
+
flickable
.
height
width
:
Math
.
max
(
enableWima
.
width
,
flickable
.
width
)
color
:
enableWima
.
enableWimaBoolean
?
qgcPal
.
window
:
"
transparent
"
radius
:
ScreenTools
.
defaultFontPixelHeight
/
4
clip
:
false
radius
:
Math
.
min
(
height
,
width
)
/
50
clip
:
true
property
real
_margins
:
_root
.
_margins
Component.onCompleted
:
{
console
.
log
(
'
onCompleted
'
)
...
...
@@ -72,46 +74,65 @@ Item {
console
.
log
(
height
)
console
.
log
(
'
width
'
)
console
.
log
(
width
)
console
.
log
(
enableWima
.
width
)
console
.
log
(
enableWima
.
height
)
console
.
log
(
flickable
.
contentWidth
)
console
.
log
(
flickable
.
contentHeight
)
width
=
enableWima
.
width
+
flickable
.
contentWidth
+
2
*
_margins
console
.
log
(
'
width
'
)
console
.
log
(
width
)
}
onHeightChanged
:
{
console
.
log
(
'
height
'
)
console
.
log
(
height
)
_root
.
height
=
mainFrame
.
height
//
_root.height = mainFrame.height
}
onWidthChanged
:
{
console
.
log
(
'
width
'
)
console
.
log
(
width
)
_root
.
width
=
mainFrame
.
width
//
_root.width = mainFrame.width
}
// checkbox to enable/ disable wima
SliderSwitch
{
id
:
enableWima
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.topMargin
:
_margins
anchors.top
:
parent
.
top
anchors.horizontalCenter
:
flickable
.
horizontalCenter
anchors.bottom
:
flickable
.
top
confirmText
:
enableWimaBoolean
?
qsTr
(
"
disable WiMA
"
)
:
qsTr
(
"
enable WiMA
"
)
property
var
enableWimaFact
:
wimaController
.
enableWimaController
property
bool
enableWimaBoolean
:
enableWimaFact
.
value
Component.onCompleted
:
{
enableWimaFact
.
value
=
false
/*onXChanged: {
console.log('x')
}
onYChanged: {
console.log('y')
}
Component.onCompleted: {
enableWimaFact.value = true
}*/
onAccept
:
{
if
(
enableWimaBoolean
)
{
enableWimaFact
.
value
=
false
enableWimaMouseArea
.
enabled
=
true
timer
.
start
()
}
else
{
enableWimaFact
.
value
=
true
enableWimaMouseArea
.
enabled
=
false
timer
.
stop
()
}
}
}
/*MouseArea {
MouseArea
{
id
:
enableWimaMouseArea
anchors.fill
:
enableWima
hoverEnabled
:
true
...
...
@@ -119,48 +140,68 @@ Item {
property
var
enableWimaFact
:
wimaController
.
enableWimaController
property
bool
enableWimaBoolean
:
enableWimaFact
.
value
onEntered
:
{
timer.stop()
enableWima
.
visible
=
true
}
onExited: {
if (enableWimaBoolean === false) {
enabled
=
false
timer
.
start
()
}
}
onExited
:
timer
.
start
()
}
Timer
{
id
:
timer
interval:
1
000
interval
:
3
000
running
:
false
repeat
:
false
onTriggered: enableWima.visible = false
}*/
onTriggered
:
triggerHandler
()
function
triggerHandler
()
{
if
(
enableWima
.
enableWimaBoolean
===
false
)
{
enableWima
.
visible
=
false
enableWimaMouseArea
.
enabled
=
true
}
}
Component.onCompleted
:
{
start
()
}
}
QGCFlickable
{
id
:
flickable
clip
:
fals
e
anchors.top
:
enableWima
.
bottom
clip
:
tru
e
visible
:
enableWima
.
enableWimaBoolean
anchors.left
:
parent
.
left
contentHeight
:
mainColumn
.
height
contentWidth
:
mainColumn
.
width
anchors.bottom
:
parent
.
bottom
width
:
enableWima
.
enableWimaBoolean
?
Math
.
min
(
contentWidth
,
maxWidth
)
:
enableWima
.
width
height
:
enableWima
.
enableWimaBoolean
?
Math
.
min
(
contentHeight
,
maxHeight
)
:
0
contentHeight
:
columnWrapper
.
height
contentWidth
:
columnWrapper
.
width
onContentHeightChanged
:
{
console
.
log
(
'
contentHeight
'
)
console
.
log
(
contentHeight
)
mainFrame
.
height
=
enableWima
.
enableWimaBoolean
?
Math
.
min
(
parent
.
maxHeight
,
enableWima
.
height
+
flickable
.
contentHeight
+
2
*
_margins
)
:
enableWima
.
height
+
_margins
//
mainFrame.height = enableWima.enableWimaBoolean ? Math.min(parent.maxHeight, enableWima.height + flickable.contentHeight + 2*_margins) : enableWima.height + _margins
}
onContentWidthChanged
:
{
console
.
log
(
'
contentWidth
'
)
console
.
log
(
contentWidth
)
mainFrame
.
width
=
enableWima
.
enableWimaBoolean
?
Math
.
min
(
parent
.
maxWidth
,
flickable
.
contentWidth
+
2
*
_margins
)
:
enableWima
.
width
//
mainFrame.width = enableWima.enableWimaBoolean ? Math.min(parent.maxWidth, flickable.contentWidth + 2*_margins) : enableWima.width
}
Row
{
id
:
columnWrapper
Item
{
// spacer
width
:
6
height
:
1
}
Column
{
id
:
mainColumn
anchors.horizontalCenter
:
parent
.
horizontalCenter
spacing
:
ScreenTools
.
defaultFontPixelHeight
*
0.3
SectionHeader
{
...
...
@@ -381,6 +422,14 @@ Item {
}
}
}
// settingsColumn
Item
{
// spacer
width
:
6
height
:
1
}
}
}
// QGCFlickable
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment