Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qgroundcontrol
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Valentin Platzgummer
qgroundcontrol
Commits
27db20a4
Commit
27db20a4
authored
6 years ago
by
DonLakeFlyer
Browse files
Options
Downloads
Patches
Plain Diff
Fix flight mode switch setting
parent
cbe81ce1
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/AutoPilotPlugins/PX4/PX4SimpleFlightModes.qml
+75
-63
75 additions, 63 deletions
src/AutoPilotPlugins/PX4/PX4SimpleFlightModes.qml
with
75 additions
and
63 deletions
src/AutoPilotPlugins/PX4/PX4SimpleFlightModes.qml
+
75
−
63
View file @
27db20a4
...
...
@@ -7,9 +7,9 @@
*
****************************************************************************/
import
QtQuick
2.3
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Layouts
1.2
import
QGroundControl
.
FactSystem
1.0
import
QGroundControl
.
FactControls
1.0
...
...
@@ -65,25 +65,24 @@ Item {
height
:
flightModeColumn
.
height
+
ScreenTools
.
defaultFontPixelHeight
color
:
qgcPal
.
windowShade
Column
{
Column
Layout
{
id
:
flightModeColumn
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.left
:
parent
.
left
anchors.top
:
parent
.
top
spacing
:
ScreenTools
.
defaultFontPixelHeight
Row
{
RowLayout
{
Layout.fillWidth
:
true
spacing
:
_margins
QGCLabel
{
id
:
modeChannelLabel
anchors.baseline
:
modeChannelCombo
.
baseline
Layout.fillWidth
:
true
text
:
qsTr
(
"
Mode channel:
"
)
}
FactComboBox
{
id
:
modeChannelCombo
width
:
_channelComboWidth
Layout.preferredWidth
:
_channelComboWidth
fact
:
controller
.
getParameterFact
(
-
1
,
"
RC_MAP_FLTMODE
"
)
indexModel
:
false
}
...
...
@@ -92,20 +91,20 @@ Item {
Repeater
{
model
:
6
Row
{
RowLayout
{
Layout.fillWidth
:
true
spacing
:
ScreenTools
.
defaultFontPixelWidth
property
int
index
:
modelData
+
1
QGCLabel
{
anchors.baseline
:
modeCombo
.
baselin
e
Layout.fillWidth
:
tru
e
text
:
qsTr
(
"
Flight Mode %1
"
).
arg
(
index
)
color
:
controller
.
activeFlightMode
==
index
?
"
yellow
"
:
qgcPal
.
text
}
FactComboBox
{
id
:
modeCombo
width
:
_flightModeComboWidth
Layout.preferredWidth
:
_channelComboWidth
fact
:
controller
.
getParameterFact
(
-
1
,
"
COM_FLTMODE
"
+
index
)
indexModel
:
false
}
...
...
@@ -126,73 +125,86 @@ Item {
Rectangle
{
id
:
switchSettingsRect
width
:
switchSettings
Column
.
width
+
(
_margins
*
2
)
height
:
switchSettings
Column
.
height
+
ScreenTools
.
defaultFontPixelHeight
width
:
switchSettings
Grid
.
width
+
(
_margins
*
2
)
height
:
switchSettings
Grid
.
height
+
ScreenTools
.
defaultFontPixelHeight
color
:
qgcPal
.
windowShade
Column
{
id
:
switchSettings
Column
GridLayout
{
id
:
switchSettings
Grid
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.left
:
parent
.
left
anchors.top
:
parent
.
top
spacing
:
ScreenTools
.
defaultFontPixelHeight
columns
:
2
columnSpacing
:
ScreenTools
.
defaultFontPixelWidth
Row
{
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
"
]
RowLayout
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
Layout.fillWidth
:
true
property
Fact
fact
:
controller
.
getParameterFact
(
-
1
,
"
RC_MAP_RETURN_SW
"
)
property
Fact
fact
:
controller
.
getParameterFact
(
-
1
,
modelData
)
QGCLabel
{
anchors.baseline
:
returnCombo
.
baseline
text
:
qsTr
(
"
Return switch:
"
)
color
:
parent
.
fact
.
value
===
0
?
qgcPal
.
text
:
(
controller
.
rcChannelValues
[
parent
.
fact
.
value
-
1
]
>=
1500
?
"
yellow
"
:
qgcPal
.
text
)
text
:
fact
.
shortDescription
Layout.fillWidth
:
true
}
FactComboBox
{
id
:
returnCombo
width
:
_channelComboWidth
Layout.preferredWidth
:
_channelComboWidth
fact
:
parent
.
fact
indexModel
:
false
}
}
}
Row
{
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
,
"
RC_MAP_KILL_SW
"
)
property
Fact
fact
:
controller
.
getParameterFact
(
-
1
,
modelData
)
QGCLabel
{
anchors.baseline
:
killCombo
.
baseline
text
:
qsTr
(
"
Kill switch:
"
)
color
:
parent
.
fact
.
value
===
0
?
qgcPal
.
text
:
(
controller
.
rcChannelValues
[
parent
.
fact
.
value
-
1
]
>=
1500
?
"
yellow
"
:
qgcPal
.
text
)
text
:
fact
.
shortDescription
Layout.fillWidth
:
true
}
FactComboBox
{
id
:
killCombo
width
:
_channelComboWidth
Layout.preferredWidth
:
_channelComboWidth
fact
:
parent
.
fact
indexModel
:
false
}
}
}
Row
{
Repeater
{
model
:
[
"
RC_MAP_TRANS_SW
"
]
RowLayout
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
Layout.fillWidth
:
true
visible
:
controller
.
vehicle
.
vtol
property
Fact
fact
:
controller
.
getParameterFact
(
-
1
,
"
RC_MAP_OFFB_SW
"
)
property
Fact
fact
:
controller
.
getParameterFact
(
-
1
,
modelData
)
QGCLabel
{
anchors.baseline
:
offboardCombo
.
baseline
text
:
qsTr
(
"
Offboard switch:
"
)
color
:
parent
.
fact
.
value
===
0
?
qgcPal
.
text
:
(
controller
.
rcChannelValues
[
parent
.
fact
.
value
-
1
]
>=
1500
?
"
yellow
"
:
qgcPal
.
text
)
text
:
fact
.
shortDescription
Layout.fillWidth
:
true
}
FactComboBox
{
id
:
offboardCombo
width
:
_channelComboWidth
Layout.preferredWidth
:
_channelComboWidth
fact
:
parent
.
fact
indexModel
:
false
}
}
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment