Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
7cbbdfb8
Commit
7cbbdfb8
authored
Dec 05, 2015
by
Don Gagne
Browse files
Fix live values
parent
f36d8d03
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/AutoPilotPlugins/APM/APMFlightModesComponentController.cc
View file @
7cbbdfb8
...
...
@@ -50,23 +50,26 @@ void APMFlightModesComponentController::_rcChannelsChanged(int channelCount, int
Q_UNUSED
(
channelCount
);
_activeFlightMode
=
0
;
int
channelValue
=
pwmValues
[
4
];
if
(
channelValue
!=
-
1
)
{
bool
found
=
false
;
int
rgThreshold
[]
=
{
1230
,
1360
,
1490
,
1620
,
1749
};
for
(
int
i
=
0
;
i
<
5
;
i
++
)
{
if
(
channelValue
<=
rgThreshold
[
i
])
{
_activeFlightMode
=
i
+
1
;
found
=
true
;
break
;
}
}
_activeFlightMode
=
5
;
if
(
!
found
)
{
_activeFlightMode
=
6
;
}
}
emit
activeFlightModeChanged
(
_activeFlightMode
);
for
(
int
i
=
0
;
i
<
6
;
i
++
)
{
_rgChannelOptionEnabled
[
i
]
=
QVariant
(
false
);
channelValue
=
pwmValues
[
i
+
7
];
channelValue
=
pwmValues
[
i
+
6
];
if
(
channelValue
!=
-
1
&&
channelValue
>
1800
)
{
_rgChannelOptionEnabled
[
i
]
=
QVariant
(
true
);
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment