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
6aae99ff
Commit
6aae99ff
authored
Oct 08, 2018
by
Willian Galvani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
APMAutoPilotPlugin: update to use versionCompare()
parent
158fd4e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
APMAutoPilotPlugin.cc
src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc
+3
-4
No files found.
src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc
View file @
6aae99ff
...
@@ -72,7 +72,7 @@ const QVariantList& APMAutoPilotPlugin::vehicleComponents(void)
...
@@ -72,7 +72,7 @@ const QVariantList& APMAutoPilotPlugin::vehicleComponents(void)
}
}
// No flight modes component for Sub versions 3.5 and up
// No flight modes component for Sub versions 3.5 and up
if
(
!
_vehicle
->
sub
()
||
(
_vehicle
->
firmwareMajorVersion
()
==
3
&&
_vehicle
->
firmwareMinorVersion
()
<=
4
))
{
if
(
!
_vehicle
->
sub
()
||
(
_vehicle
->
versionCompare
(
3
,
5
,
0
)
<
0
))
{
_flightModesComponent
=
new
APMFlightModesComponent
(
_vehicle
,
this
);
_flightModesComponent
=
new
APMFlightModesComponent
(
_vehicle
,
this
);
_flightModesComponent
->
setupTriggerSignals
();
_flightModesComponent
->
setupTriggerSignals
();
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_flightModesComponent
));
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_flightModesComponent
));
...
@@ -86,8 +86,7 @@ const QVariantList& APMAutoPilotPlugin::vehicleComponents(void)
...
@@ -86,8 +86,7 @@ const QVariantList& APMAutoPilotPlugin::vehicleComponents(void)
_powerComponent
->
setupTriggerSignals
();
_powerComponent
->
setupTriggerSignals
();
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_powerComponent
));
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_powerComponent
));
int
versionInt
=
_vehicle
->
firmwareMajorVersion
()
*
100
+
_vehicle
->
firmwareMinorVersion
()
*
10
+
_vehicle
->
firmwarePatchVersion
();
if
(
_vehicle
->
sub
()
&&
_vehicle
->
versionCompare
(
3
,
5
,
3
)
>=
0
)
{
if
(
_vehicle
->
sub
()
&&
versionInt
>=
353
)
{
_motorComponent
=
new
APMMotorComponent
(
_vehicle
,
this
);
_motorComponent
=
new
APMMotorComponent
(
_vehicle
,
this
);
_motorComponent
->
setupTriggerSignals
();
_motorComponent
->
setupTriggerSignals
();
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_motorComponent
));
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_motorComponent
));
...
@@ -116,7 +115,7 @@ const QVariantList& APMAutoPilotPlugin::vehicleComponents(void)
...
@@ -116,7 +115,7 @@ const QVariantList& APMAutoPilotPlugin::vehicleComponents(void)
_lightsComponent
->
setupTriggerSignals
();
_lightsComponent
->
setupTriggerSignals
();
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_lightsComponent
));
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_lightsComponent
));
if
(
_vehicle
->
firmwareMajorVersion
()
>
3
||
(
_vehicle
->
firmwareMajorVersion
()
==
3
&&
_vehicle
->
firmwareMinorVersion
()
>=
5
)
)
{
if
(
_vehicle
->
versionCompare
(
3
,
5
,
0
)
>=
0
)
{
_subFrameComponent
=
new
APMSubFrameComponent
(
_vehicle
,
this
);
_subFrameComponent
=
new
APMSubFrameComponent
(
_vehicle
,
this
);
_subFrameComponent
->
setupTriggerSignals
();
_subFrameComponent
->
setupTriggerSignals
();
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_subFrameComponent
));
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_subFrameComponent
));
...
...
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