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
066ce669
Commit
066ce669
authored
Jul 22, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #311 from tstellanova/display_flt_modes
Display full flight modes
parents
38caf81a
ee28a045
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
24 deletions
+36
-24
UAS.cc
src/uas/UAS.cc
+36
-24
No files found.
src/uas/UAS.cc
View file @
066ce669
...
...
@@ -3325,45 +3325,55 @@ QString UAS::getAudioModeTextFor(int id)
return
mode
;
}
/**
* The mode returned can be auto, stabilized, test, manual, preflight or unknown.
* @return the short text of the mode for the id given.
*/
/**
* The mode returned can be auto, stabilized, test, manual, preflight or unknown.
* @return the short text of the mode for the id given.
*/
QString
UAS
::
getShortModeTextFor
(
int
id
)
{
QString
mode
;
QString
mode
=
""
;
uint8_t
modeid
=
id
;
qDebug
()
<<
"MODE:"
<<
modeid
;
// BASE MODE DECODING
if
(
modeid
&
(
uint8_t
)
MAV_MODE_FLAG_DECODE_POSITION_AUTO
)
{
mode
+=
"|AUTO"
;
}
else
if
(
modeid
&
(
uint8_t
)
MAV_MODE_FLAG_DECODE_POSITION_GUIDED
)
{
mode
+=
"|VECTOR"
;
}
if
(
modeid
&
(
uint8_t
)
MAV_MODE_FLAG_DECODE_POSITION_STABILIZE
)
{
mode
+=
"|STABILIZED"
;
}
else
if
(
modeid
&
(
uint8_t
)
MAV_MODE_FLAG_DECODE_POSITION_TEST
)
{
mode
+=
"|TEST"
;
}
else
if
(
modeid
&
(
uint8_t
)
MAV_MODE_FLAG_DECODE_POSITION_MANUAL
)
{
mode
+=
"|MANUAL"
;
}
else
if
(
modeid
==
0
)
if
(
modeid
==
0
)
{
mode
=
"|PREFLIGHT"
;
}
else
else
{
if
(
modeid
&
(
uint8_t
)
MAV_MODE_FLAG_DECODE_POSITION_AUTO
){
mode
+=
"|AUTO"
;
}
if
(
modeid
&
(
uint8_t
)
MAV_MODE_FLAG_DECODE_POSITION_MANUAL
){
mode
+=
"|MANUAL"
;
}
if
(
modeid
&
(
uint8_t
)
MAV_MODE_FLAG_DECODE_POSITION_GUIDED
){
mode
+=
"|VECTOR"
;
}
if
(
modeid
&
(
uint8_t
)
MAV_MODE_FLAG_DECODE_POSITION_STABILIZE
){
mode
+=
"|STABILIZED"
;
}
if
(
modeid
&
(
uint8_t
)
MAV_MODE_FLAG_DECODE_POSITION_TEST
){
mode
+=
"|TEST"
;
}
}
if
(
mode
.
length
()
==
0
)
{
mode
=
"|UNKNOWN"
;
qDebug
()
<<
__FILE__
<<
__LINE__
<<
" Unknown modeid: "
<<
modeid
;
}
// ARMED STATE DECODING
...
...
@@ -3382,6 +3392,8 @@ QString UAS::getShortModeTextFor(int id)
mode
.
prepend
(
"HIL:"
);
}
qDebug
()
<<
"MODE: "
<<
modeid
<<
" "
<<
mode
;
return
mode
;
}
...
...
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