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
2eccba9f
Commit
2eccba9f
authored
Oct 27, 2014
by
Lorenz Meier
Browse files
Fix system type update, now correctly hiding airspeed if required
parent
c6d295fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/uas/UAS.cc
View file @
2eccba9f
...
...
@@ -497,27 +497,8 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
// Set new type if it has changed
if
(
this
->
type
!=
state
.
type
)
{
this
->
type
=
state
.
type
;
if
(
airframe
==
0
)
{
switch
(
type
)
{
case
MAV_TYPE_FIXED_WING
:
setAirframe
(
UASInterface
::
QGC_AIRFRAME_EASYSTAR
);
break
;
case
MAV_TYPE_QUADROTOR
:
setAirframe
(
UASInterface
::
QGC_AIRFRAME_CHEETAH
);
break
;
case
MAV_TYPE_HEXAROTOR
:
setAirframe
(
UASInterface
::
QGC_AIRFRAME_HEXCOPTER
);
break
;
default:
// Do nothing
break
;
}
}
this
->
autopilot
=
state
.
autopilot
;
emit
s
ystemType
Set
(
this
,
type
);
setS
ystemType
(
state
.
type
);
}
bool
currentlyArmed
=
state
.
base_mode
&
MAV_MODE_FLAG_DECODE_POSITION_SAFETY
;
...
...
@@ -2593,17 +2574,25 @@ void UAS::setSystemType(int systemType)
// If the airframe is still generic, change it to a close default type
if
(
airframe
==
0
)
{
switch
(
systemT
ype
)
switch
(
t
ype
)
{
case
MAV_TYPE_FIXED_WING
:
a
irframe
=
QGC_AIRFRAME_EASYSTAR
;
setA
irframe
(
UASInterface
::
QGC_AIRFRAME_EASYSTAR
)
;
break
;
case
MAV_TYPE_QUADROTOR
:
airframe
=
QGC_AIRFRAME_MIKROKOPTER
;
setAirframe
(
UASInterface
::
QGC_AIRFRAME_CHEETAH
);
break
;
case
MAV_TYPE_HEXAROTOR
:
setAirframe
(
UASInterface
::
QGC_AIRFRAME_HEXCOPTER
);
break
;
default:
// Do nothing
break
;
}
}
emit
systemSpecsChanged
(
uasId
);
emit
systemTypeSet
(
this
,
type
);
qDebug
()
<<
"TYPE CHANGED TO:"
<<
type
;
}
}
...
...
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