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
16469725
Commit
16469725
authored
Nov 11, 2018
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
5e3d0414
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
74 deletions
+40
-74
PX4SimpleFlightModes.qml
src/AutoPilotPlugins/PX4/PX4SimpleFlightModes.qml
+40
-74
No files found.
src/AutoPilotPlugins/PX4/PX4SimpleFlightModes.qml
View file @
16469725
...
...
@@ -25,11 +25,32 @@ Item {
//property var qgcView - QGCView control
//property var qgcViewPanel - QGCViewPanel control
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
/
2
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
/
2
property
var
_switchNameList
:
[
"
ACRO
"
,
"
ARM
"
,
"
GEAR
"
,
"
KILL
"
,
"
LOITER
"
,
"
OFFB
"
,
"
POSCTL
"
,
"
RATT
"
,
"
RETURN
"
,
"
STAB
"
]
property
var
_switchFactList
:
[
]
property
var
_switchTHFactList
:
[
]
readonly
property
real
_flightModeComboWidth
:
ScreenTools
.
defaultFontPixelWidth
*
13
readonly
property
real
_channelComboWidth
:
ScreenTools
.
defaultFontPixelWidth
*
13
Component.onCompleted
:
{
if
(
controller
.
vehicle
.
fixedWing
)
{
_switchNameList
.
push
(
"
MAN
"
)
}
if
(
controller
.
vehicle
.
vtol
)
{
_switchNameList
.
push
(
"
TRANS
"
)
}
for
(
var
i
=
0
;
i
<
_switchNameList
.
length
;
i
++
)
{
_switchFactList
.
push
(
"
RC_MAP_
"
+
_switchNameList
[
i
]
+
"
_SW
"
)
_switchTHFactList
.
push
(
"
RC_
"
+
_switchNameList
[
i
]
+
"
_TH
"
)
}
if
(
controller
.
vehicle
.
fixedWing
)
{
_switchFactList
.
push
(
"
RC_MAP_FLAPS
"
)
_switchTHFactList
.
push
(
""
)
}
switchRepeater
.
model
=
_switchFactList
}
PX4SimpleFlightModesController
{
id
:
controller
factPanel
:
qgcViewPanel
...
...
@@ -138,98 +159,43 @@ Item {
columnSpacing
:
ScreenTools
.
defaultFontPixelWidth
Repeater
{
model
:
[
"
RC_MAP_ACRO_SW
"
,
"
RC_MAP_ARM_SW
"
,
"
RC_MAP_GEAR_SW
"
,
"
RC_MAP_KILL_SW
"
,
"
RC_MAP_LOITER_SW
"
,
"
RC_MAP_OFFB_SW
"
,
"
RC_MAP_POSCTL_SW
"
,
"
RC_MAP_RATT_SW
"
,
"
RC_MAP_RETURN_SW
"
,
"
RC_MAP_STAB_SW
"
]
id
:
switchRepeater
RowLayout
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
Layout.fillWidth
:
true
property
Fact
fact
:
controller
.
getParameterFact
(
-
1
,
modelData
)
property
string
thFactName
:
_switchTHFactList
[
index
]
property
bool
thFactExists
:
thFactName
==
""
property
Fact
swFact
:
controller
.
getParameterFact
(
-
1
,
modelData
)
property
Fact
thFact
:
thFactExists
?
controller
.
getParameterFact
(
-
1
,
thFactName
)
:
null
property
real
thValue
:
thFactExists
?
thFact
.
rawValue
:
0.5
property
real
thPWM
:
1000
+
(
1000
*
thValue
)
property
int
swChannel
:
swFact
.
rawValue
-
1
property
bool
swActive
:
swChannel
<
0
?
false
:
(
thValue
>=
0
?
(
controller
.
rcChannelValues
[
swChannel
]
>
thPWM
)
:
(
controller
.
rcChannelValues
[
swChannel
]
<=
thPWM
))
QGCLabel
{
text
:
f
act
.
shortDescription
text
:
swF
act
.
shortDescription
Layout.fillWidth
:
true
color
:
swActive
?
"
yellow
"
:
qgcPal
.
text
}
FactComboBox
{
Layout.preferredWidth
:
_channelComboWidth
fact
:
parent
.
f
act
fact
:
swF
act
indexModel
:
false
}
}
}
Repeater
{
model
:
[
"
RC_MAP_FLAPS
"
,
"
RC_MAP_MAN_SW
"
]
RowLayout
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
controller
.
vehicle
.
fixedWing
Layout.fillWidth
:
true
property
Fact
fact
:
controller
.
getParameterFact
(
-
1
,
modelData
)
QGCLabel
{
text
:
fact
.
shortDescription
Layout.fillWidth
:
true
}
FactComboBox
{
Layout.preferredWidth
:
_channelComboWidth
fact
:
parent
.
fact
indexModel
:
false
}
}
}
Repeater
{
model
:
[
"
RC_MAP_TRANS_SW
"
]
RowLayout
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
Layout.fillWidth
:
true
visible
:
controller
.
vehicle
.
vtol
property
Fact
fact
:
controller
.
getParameterFact
(
-
1
,
modelData
)
QGCLabel
{
text
:
fact
.
shortDescription
Layout.fillWidth
:
true
}
FactComboBox
{
Layout.preferredWidth
:
_channelComboWidth
fact
:
parent
.
fact
indexModel
:
false
}
}
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
property
Fact
fact
:
controller
.
getParameterFact
(
-
1
,
"
RC_MAP_TRANS_SW
"
,
false
)
visible
:
(
controller
.
vehicle
.
vtol
&&
controller
.
parameterExists
(
-
1
,
"
RC_MAP_TRANS_SW
"
))
QGCLabel
{
anchors.baseline
:
vtolCombo
.
baseline
text
:
qsTr
(
"
VTOL mode switch:
"
)
color
:
parent
.
fact
.
value
===
0
?
qgcPal
.
text
:
(
controller
.
rcChannelValues
[
parent
.
fact
.
value
-
1
]
>=
1500
?
"
yellow
"
:
qgcPal
.
text
)
}
FactComboBox
{
id
:
vtolCombo
width
:
_channelComboWidth
fact
:
parent
.
fact
indexModel
:
false
}
}
}
// Column
}
// Rectangle
RCChannelMonitor
{
width
:
switchSettingsRect
.
width
width
:
switchSettingsRect
.
width
twoColumn
:
true
}
}
// Column - Switch settings
}
// Row - Settings
...
...
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