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
27db20a4
Commit
27db20a4
authored
Jun 20, 2018
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix flight mode switch setting
parent
cbe81ce1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
63 deletions
+75
-63
PX4SimpleFlightModes.qml
src/AutoPilotPlugins/PX4/PX4SimpleFlightModes.qml
+75
-63
No files found.
src/AutoPilotPlugins/PX4/PX4SimpleFlightModes.qml
View file @
27db20a4
...
@@ -7,9 +7,9 @@
...
@@ -7,9 +7,9 @@
*
*
****************************************************************************/
****************************************************************************/
import
QtQuick
2.3
import
QtQuick
2.3
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Layouts
1.2
import
QGroundControl
.
FactSystem
1.0
import
QGroundControl
.
FactSystem
1.0
import
QGroundControl
.
FactControls
1.0
import
QGroundControl
.
FactControls
1.0
...
@@ -65,49 +65,48 @@ Item {
...
@@ -65,49 +65,48 @@ Item {
height
:
flightModeColumn
.
height
+
ScreenTools
.
defaultFontPixelHeight
height
:
flightModeColumn
.
height
+
ScreenTools
.
defaultFontPixelHeight
color
:
qgcPal
.
windowShade
color
:
qgcPal
.
windowShade
Column
{
Column
Layout
{
id
:
flightModeColumn
id
:
flightModeColumn
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
spacing
:
ScreenTools
.
defaultFontPixelHeight
spacing
:
ScreenTools
.
defaultFontPixelHeight
Row
{
RowLayout
{
spacing
:
_margins
Layout.fillWidth
:
true
spacing
:
_margins
QGCLabel
{
QGCLabel
{
id
:
modeChannelLabel
Layout.fillWidth
:
true
anchors.baseline
:
modeChannelCombo
.
baseline
text
:
qsTr
(
"
Mode channel:
"
)
text
:
qsTr
(
"
Mode channel:
"
)
}
}
FactComboBox
{
FactComboBox
{
id
:
modeChannelCombo
Layout.preferredWidth
:
_channelComboWidth
width
:
_channelComboWidth
fact
:
controller
.
getParameterFact
(
-
1
,
"
RC_MAP_FLTMODE
"
)
fact
:
controller
.
getParameterFact
(
-
1
,
"
RC_MAP_FLTMODE
"
)
indexModel
:
false
indexModel
:
false
}
}
}
}
Repeater
{
Repeater
{
model
:
6
model
:
6
Row
{
RowLayout
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
Layout.fillWidth
:
true
spacing
:
ScreenTools
.
defaultFontPixelWidth
property
int
index
:
modelData
+
1
property
int
index
:
modelData
+
1
QGCLabel
{
QGCLabel
{
anchors.baseline
:
modeCombo
.
baselin
e
Layout.fillWidth
:
tru
e
text
:
qsTr
(
"
Flight Mode %1
"
).
arg
(
index
)
text
:
qsTr
(
"
Flight Mode %1
"
).
arg
(
index
)
color
:
controller
.
activeFlightMode
==
index
?
"
yellow
"
:
qgcPal
.
text
color
:
controller
.
activeFlightMode
==
index
?
"
yellow
"
:
qgcPal
.
text
}
}
FactComboBox
{
FactComboBox
{
id
:
modeCombo
Layout.preferredWidth
:
_channelComboWidth
width
:
_flightModeComboWidth
fact
:
controller
.
getParameterFact
(
-
1
,
"
COM_FLTMODE
"
+
index
)
fact
:
controller
.
getParameterFact
(
-
1
,
"
COM_FLTMODE
"
+
index
)
indexModel
:
false
indexModel
:
false
}
}
}
}
}
// Repeater - Flight Modes
}
// Repeater - Flight Modes
...
@@ -126,74 +125,87 @@ Item {
...
@@ -126,74 +125,87 @@ Item {
Rectangle
{
Rectangle
{
id
:
switchSettingsRect
id
:
switchSettingsRect
width
:
switchSettings
Column
.
width
+
(
_margins
*
2
)
width
:
switchSettings
Grid
.
width
+
(
_margins
*
2
)
height
:
switchSettings
Column
.
height
+
ScreenTools
.
defaultFontPixelHeight
height
:
switchSettings
Grid
.
height
+
ScreenTools
.
defaultFontPixelHeight
color
:
qgcPal
.
windowShade
color
:
qgcPal
.
windowShade
Column
{
GridLayout
{
id
:
switchSettings
Column
id
:
switchSettings
Grid
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
spacing
:
ScreenTools
.
defaultFontPixelHeight
columns
:
2
columnSpacing
:
ScreenTools
.
defaultFontPixelWidth
R
ow
{
R
epeater
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
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
"
]
property
Fact
fact
:
controller
.
getParameterFact
(
-
1
,
"
RC_MAP_RETURN_SW
"
)
RowLayout
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
Layout.fillWidth
:
true
QGCLabel
{
property
Fact
fact
:
controller
.
getParameterFact
(
-
1
,
modelData
)
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
)
}
FactComboBox
{
QGCLabel
{
id
:
returnCombo
text
:
fact
.
shortDescription
width
:
_channelComboWidth
Layout.fillWidth
:
true
fact
:
parent
.
fact
}
indexModel
:
false
FactComboBox
{
Layout.preferredWidth
:
_channelComboWidth
fact
:
parent
.
fact
indexModel
:
false
}
}
}
}
}
R
ow
{
R
epeater
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
model
:
[
"
RC_MAP_FLAPS
"
,
"
RC_MAP_MAN_SW
"
]
property
Fact
fact
:
controller
.
getParameterFact
(
-
1
,
"
RC_MAP_KILL_SW
"
)
RowLayout
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
controller
.
vehicle
.
fixedWing
Layout.fillWidth
:
true
QGCLabel
{
property
Fact
fact
:
controller
.
getParameterFact
(
-
1
,
modelData
)
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
)
}
FactComboBox
{
QGCLabel
{
id
:
killCombo
text
:
fact
.
shortDescription
width
:
_channelComboWidth
Layout.fillWidth
:
true
fact
:
parent
.
fact
}
indexModel
:
false
FactComboBox
{
Layout.preferredWidth
:
_channelComboWidth
fact
:
parent
.
fact
indexModel
:
false
}
}
}
}
}
R
ow
{
R
epeater
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
model
:
[
"
RC_MAP_TRANS_SW
"
]
property
Fact
fact
:
controller
.
getParameterFact
(
-
1
,
"
RC_MAP_OFFB_SW
"
)
RowLayout
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
Layout.fillWidth
:
true
visible
:
controller
.
vehicle
.
vtol
QGCLabel
{
property
Fact
fact
:
controller
.
getParameterFact
(
-
1
,
modelData
)
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
)
}
FactComboBox
{
QGCLabel
{
id
:
offboardCombo
text
:
fact
.
shortDescription
width
:
_channelComboWidth
Layout.fillWidth
:
true
fact
:
parent
.
fact
}
indexModel
:
false
FactComboBox
{
Layout.preferredWidth
:
_channelComboWidth
fact
:
parent
.
fact
indexModel
:
false
}
}
}
}
}
Row
{
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
spacing
:
ScreenTools
.
defaultFontPixelWidth
...
...
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