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
a11b1dbf
Commit
a11b1dbf
authored
Aug 08, 2017
by
Don Gagne
Committed by
GitHub
Aug 08, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5460 from HorusAeronaves/wind_rose_solution
Wind rose solution
parents
6b6361ef
2c1e6da6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
17 deletions
+34
-17
SurveyItemEditor.qml
src/PlanView/SurveyItemEditor.qml
+34
-17
No files found.
src/PlanView/SurveyItemEditor.qml
View file @
a11b1dbf
...
@@ -443,12 +443,12 @@ Rectangle {
...
@@ -443,12 +443,12 @@ Rectangle {
id
:
windRoseButton
id
:
windRoseButton
anchors.verticalCenter
:
angleText
.
verticalCenter
anchors.verticalCenter
:
angleText
.
verticalCenter
iconSource
:
qgcPal
.
globalTheme
===
QGCPalette
.
Light
?
"
/res/wind-roseBlack.svg
"
:
"
/res/wind-rose.svg
"
iconSource
:
qgcPal
.
globalTheme
===
QGCPalette
.
Light
?
"
/res/wind-roseBlack.svg
"
:
"
/res/wind-rose.svg
"
// Wind Rose is temporarily turned off until bugs are fixed
visible
:
_vehicle
.
fixedWing
visible
:
false
//_vehicle.fixedWing
onClicked
:
{
onClicked
:
{
windRosePie
.
angle
=
Number
(
gridAngleText
.
text
)
var
cords
=
windRoseButton
.
mapToItem
(
_root
,
0
,
0
)
var
cords
=
windRoseButton
.
mapToItem
(
_root
,
0
,
0
)
windRosePie
.
popup
(
cords
.
x
+
windRoseButton
.
width
/
2
,
cords
.
y
+
windRoseButton
.
height
/
2
)
;
windRosePie
.
popup
(
cords
.
x
+
windRoseButton
.
width
/
2
,
cords
.
y
+
windRoseButton
.
height
/
2
)
}
}
}
}
}
}
...
@@ -465,7 +465,9 @@ Rectangle {
...
@@ -465,7 +465,9 @@ Rectangle {
Layout.fillWidth
:
true
Layout.fillWidth
:
true
}
}
QGCLabel
{
text
:
qsTr
(
"
Entry
"
)
}
QGCLabel
{
text
:
qsTr
(
"
Entry
"
)
}
FactComboBox
{
FactComboBox
{
fact
:
missionItem
.
gridEntryLocation
fact
:
missionItem
.
gridEntryLocation
indexModel
:
false
indexModel
:
false
...
@@ -545,12 +547,11 @@ Rectangle {
...
@@ -545,12 +547,11 @@ Rectangle {
anchors.verticalCenter
:
manualAngleText
.
verticalCenter
anchors.verticalCenter
:
manualAngleText
.
verticalCenter
Layout.columnSpan
:
1
Layout.columnSpan
:
1
iconSource
:
qgcPal
.
globalTheme
===
QGCPalette
.
Light
?
"
/res/wind-roseBlack.svg
"
:
"
/res/wind-rose.svg
"
iconSource
:
qgcPal
.
globalTheme
===
QGCPalette
.
Light
?
"
/res/wind-roseBlack.svg
"
:
"
/res/wind-rose.svg
"
// Wind Rose is temporarily turned off until bugs are fixed
visible
:
_vehicle
.
fixedWing
visible
:
false
//_vehicle.fixedWing
onClicked
:
{
onClicked
:
{
var
cords
=
manualWindRoseButton
.
mapToItem
(
_root
,
0
,
0
)
var
cords
=
manualWindRoseButton
.
mapToItem
(
_root
,
0
,
0
)
windRosePie
.
popup
(
cords
.
x
+
manualWindRoseButton
.
width
/
2
,
cords
.
y
+
manualWindRoseButton
.
height
/
2
)
;
windRosePie
.
popup
(
cords
.
x
+
manualWindRoseButton
.
width
/
2
,
cords
.
y
+
manualWindRoseButton
.
height
/
2
)
}
}
}
}
}
}
...
@@ -577,9 +578,14 @@ Rectangle {
...
@@ -577,9 +578,14 @@ Rectangle {
fact
:
missionItem
.
turnaroundDist
fact
:
missionItem
.
turnaroundDist
Layout.fillWidth
:
true
Layout.fillWidth
:
true
}
}
QGCLabel
{
text
:
qsTr
(
"
Entry
"
)
}
QGCLabel
{
text
:
qsTr
(
"
Entry
"
)
visible
:
!
windRoseButton
.
visible
}
FactComboBox
{
FactComboBox
{
id
:
gridAngleBox
fact
:
missionItem
.
gridEntryLocation
fact
:
missionItem
.
gridEntryLocation
visible
:
!
windRoseButton
.
visible
indexModel
:
false
indexModel
:
false
Layout.fillWidth
:
true
Layout.fillWidth
:
true
}
}
...
@@ -674,7 +680,7 @@ Rectangle {
...
@@ -674,7 +680,7 @@ Rectangle {
property
string
colorCircle
:
qgcPal
.
windowShade
property
string
colorCircle
:
qgcPal
.
windowShade
property
string
colorBackground
:
qgcPal
.
colorGrey
property
string
colorBackground
:
qgcPal
.
colorGrey
property
real
lineWidth
:
windRoseButton
.
width
/
3
property
real
lineWidth
:
windRoseButton
.
width
/
3
property
real
angle
:
0
property
real
angle
:
Number
(
gridAngleText
.
text
)
Canvas
{
Canvas
{
id
:
windRoseCanvas
id
:
windRoseCanvas
...
@@ -689,13 +695,13 @@ Rectangle {
...
@@ -689,13 +695,13 @@ Rectangle {
var
end
=
windRosePie
.
angle
*
Math
.
PI
/
180
+
angleWidth
var
end
=
windRosePie
.
angle
*
Math
.
PI
/
180
+
angleWidth
ctx
.
reset
()
ctx
.
reset
()
ctx
.
beginPath
()
;
ctx
.
beginPath
()
ctx
.
arc
(
x
,
y
,
(
width
/
3
)
-
windRosePie
.
lineWidth
/
2
,
0
,
2
*
Math
.
PI
,
false
)
ctx
.
arc
(
x
,
y
,
(
width
/
3
)
-
windRosePie
.
lineWidth
/
2
,
0
,
2
*
Math
.
PI
,
false
)
ctx
.
lineWidth
=
windRosePie
.
lineWidth
ctx
.
lineWidth
=
windRosePie
.
lineWidth
ctx
.
strokeStyle
=
windRosePie
.
colorBackground
ctx
.
strokeStyle
=
windRosePie
.
colorBackground
ctx
.
stroke
()
ctx
.
stroke
()
ctx
.
beginPath
()
;
ctx
.
beginPath
()
ctx
.
arc
(
x
,
y
,
(
width
/
3
)
-
windRosePie
.
lineWidth
/
2
,
start
,
end
,
false
)
ctx
.
arc
(
x
,
y
,
(
width
/
3
)
-
windRosePie
.
lineWidth
/
2
,
start
,
end
,
false
)
ctx
.
lineWidth
=
windRosePie
.
lineWidth
ctx
.
lineWidth
=
windRosePie
.
lineWidth
ctx
.
strokeStyle
=
windRosePie
.
colorCircle
ctx
.
strokeStyle
=
windRosePie
.
colorCircle
...
@@ -709,12 +715,13 @@ Rectangle {
...
@@ -709,12 +715,13 @@ Rectangle {
function
popup
(
x
,
y
)
{
function
popup
(
x
,
y
)
{
if
(
x
!==
undefined
)
if
(
x
!==
undefined
)
windRosePie
.
x
=
x
-
windRosePie
.
width
/
2
;
windRosePie
.
x
=
x
-
windRosePie
.
width
/
2
if
(
y
!==
undefined
)
if
(
y
!==
undefined
)
windRosePie
.
y
=
y
-
windRosePie
.
height
/
2
;
windRosePie
.
y
=
y
-
windRosePie
.
height
/
2
windRosePie
.
visible
=
true
;
windRosePie
.
visible
=
true
windRosePie
.
focus
=
true
windRosePie
.
focus
=
true
missionItemEditorListView
.
interactive
=
false
}
}
MouseArea
{
MouseArea
{
...
@@ -723,15 +730,25 @@ Rectangle {
...
@@ -723,15 +730,25 @@ Rectangle {
acceptedButtons
:
Qt
.
LeftButton
|
Qt
.
RightButton
acceptedButtons
:
Qt
.
LeftButton
|
Qt
.
RightButton
onClicked
:
{
onClicked
:
{
windRosePie
.
visible
=
false
;
windRosePie
.
visible
=
false
missionItemEditorListView
.
interactive
=
true
}
}
onPositionChanged
:
{
onPositionChanged
:
{
var
point
=
Qt
.
point
(
mouseX
-
parent
.
width
/
2
,
mouseY
-
parent
.
height
/
2
)
var
point
=
Qt
.
point
(
mouseX
-
parent
.
width
/
2
,
mouseY
-
parent
.
height
/
2
)
var
angle
=
Math
.
round
(
Math
.
atan2
(
point
.
y
,
point
.
x
)
*
180
/
Math
.
PI
)
var
angle
=
Math
.
round
(
Math
.
atan2
(
point
.
y
,
point
.
x
)
*
180
/
Math
.
PI
)
windRoseCanvas
.
requestPaint
()
windRoseCanvas
.
requestPaint
()
windRosePie
.
angle
=
angle
windRosePie
.
angle
=
angle
gridAngleText
.
text
=
-
angle
gridAngleText
.
text
=
angle
gridAngleText
.
editingFinished
();
gridAngleText
.
editingFinished
()
if
(
angle
>
-
135
&&
angle
<=
-
45
)
{
gridAngleBox
.
activated
(
2
)
// or 3
}
else
if
(
angle
>
-
45
&&
angle
<=
45
)
{
gridAngleBox
.
activated
(
2
)
// or 0
}
else
if
(
angle
>
45
&&
angle
<=
135
)
{
gridAngleBox
.
activated
(
1
)
// or 0
}
else
if
(
angle
>
135
||
angle
<=
-
135
)
{
gridAngleBox
.
activated
(
1
)
// or 3
}
}
}
}
}
}
}
...
...
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