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
aa52020c
Commit
aa52020c
authored
Apr 22, 2016
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed crash when switching to the Flight Modes panel.
parent
0d214e1e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
38 deletions
+52
-38
FlightModesComponent.cc
src/AutoPilotPlugins/PX4/FlightModesComponent.cc
+10
-8
PX4AutoPilotPlugin.cc
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc
+21
-21
PX4SimpleFlightModesController.cc
src/AutoPilotPlugins/PX4/PX4SimpleFlightModesController.cc
+21
-9
No files found.
src/AutoPilotPlugins/PX4/FlightModesComponent.cc
View file @
aa52020c
...
@@ -107,6 +107,8 @@ QString FlightModesComponent::prerequisiteSetup(void) const
...
@@ -107,6 +107,8 @@ QString FlightModesComponent::prerequisiteSetup(void) const
return
plugin
->
airframeComponent
()
->
name
();
return
plugin
->
airframeComponent
()
->
name
();
}
else
if
(
!
plugin
->
radioComponent
()
->
setupComplete
())
{
}
else
if
(
!
plugin
->
radioComponent
()
->
setupComplete
())
{
return
plugin
->
radioComponent
()
->
name
();
return
plugin
->
radioComponent
()
->
name
();
}
else
if
(
!
plugin
->
sensorsComponent
()
->
setupComplete
())
{
return
plugin
->
sensorsComponent
()
->
name
();
}
}
}
}
...
...
src/AutoPilotPlugins/PX4/PX4AutoPilotPlugin.cc
View file @
aa52020c
...
@@ -106,14 +106,14 @@ const QVariantList& PX4AutoPilotPlugin::vehicleComponents(void)
...
@@ -106,14 +106,14 @@ const QVariantList& PX4AutoPilotPlugin::vehicleComponents(void)
_radioComponent
->
setupTriggerSignals
();
_radioComponent
->
setupTriggerSignals
();
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_radioComponent
));
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_radioComponent
));
_flightModesComponent
=
new
FlightModesComponent
(
_vehicle
,
this
);
_flightModesComponent
->
setupTriggerSignals
();
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_flightModesComponent
));
_sensorsComponent
=
new
SensorsComponent
(
_vehicle
,
this
);
_sensorsComponent
=
new
SensorsComponent
(
_vehicle
,
this
);
_sensorsComponent
->
setupTriggerSignals
();
_sensorsComponent
->
setupTriggerSignals
();
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_sensorsComponent
));
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_sensorsComponent
));
_flightModesComponent
=
new
FlightModesComponent
(
_vehicle
,
this
);
_flightModesComponent
->
setupTriggerSignals
();
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_flightModesComponent
));
_powerComponent
=
new
PowerComponent
(
_vehicle
,
this
);
_powerComponent
=
new
PowerComponent
(
_vehicle
,
this
);
_powerComponent
->
setupTriggerSignals
();
_powerComponent
->
setupTriggerSignals
();
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_powerComponent
));
_components
.
append
(
QVariant
::
fromValue
((
VehicleComponent
*
)
_powerComponent
));
...
...
src/AutoPilotPlugins/PX4/PX4SimpleFlightModesController.cc
View file @
aa52020c
...
@@ -53,9 +53,21 @@ void PX4SimpleFlightModesController::_rcChannelsChanged(int channelCount, int pw
...
@@ -53,9 +53,21 @@ void PX4SimpleFlightModesController::_rcChannelsChanged(int channelCount, int pw
}
}
emit
rcChannelValuesChanged
();
emit
rcChannelValuesChanged
();
int
flightModeChannel
=
getParameterFact
(
-
1
,
"RC_MAP_FLTMODE"
)
->
rawValue
().
toInt
()
-
1
;
Fact
*
pFact
=
getParameterFact
(
-
1
,
"RC_MAP_FLTMODE"
);
if
(
!
pFact
)
{
qCritical
()
<<
"RC_MAP_FLTMODE Fact is NULL in"
<<
__func__
<<
__FILE__
<<
__LINE__
;
return
;
}
int
flightModeChannel
=
pFact
->
rawValue
().
toInt
()
-
1
;
pFact
=
getParameterFact
(
-
1
,
QString
(
"RC%1_REV"
).
arg
(
flightModeChannel
+
1
));
if
(
!
pFact
)
{
qCritical
()
<<
QString
(
"RC%1_REV"
).
arg
(
flightModeChannel
+
1
)
<<
"is NULL in"
<<
__func__
<<
__FILE__
<<
__LINE__
;
return
;
}
int
flightModeReversed
=
getParameterFact
(
1
,
QString
(
"RC%1_REV"
).
arg
(
flightModeChannel
+
1
))
->
rawValue
().
toInt
();
int
flightModeReversed
=
pFact
->
rawValue
().
toInt
();
if
(
flightModeChannel
<
0
||
flightModeChannel
>
channelCount
)
{
if
(
flightModeChannel
<
0
||
flightModeChannel
>
channelCount
)
{
return
;
return
;
...
...
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