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
c8942215
Commit
c8942215
authored
Nov 22, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work correctly when no Vehicle
parent
3d9a4ce4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
18 deletions
+19
-18
FactPanelController.cc
src/FactSystem/FactControls/FactPanelController.cc
+12
-13
ParameterEditorController.cc
src/QmlControls/ParameterEditorController.cc
+7
-5
No files found.
src/FactSystem/FactControls/FactPanelController.cc
View file @
c8942215
...
...
@@ -33,19 +33,18 @@
QGC_LOGGING_CATEGORY
(
FactPanelControllerLog
,
"FactPanelControllerLog"
)
FactPanelController
::
FactPanelController
(
void
)
:
_factPanel
(
NULL
)
FactPanelController
::
FactPanelController
(
void
)
:
_vehicle
(
NULL
)
,
_uas
(
NULL
)
,
_autopilot
(
NULL
)
,
_factPanel
(
NULL
)
{
_vehicle
=
qgcApp
()
->
toolbox
()
->
multiVehicleManager
()
->
activeVehicle
();
Q_ASSERT
(
_vehicle
);
_uas
=
_vehicle
->
uas
();
Q_ASSERT
(
_uas
);
_autopilot
=
_vehicle
->
autopilotPlugin
();
Q_ASSERT
(
_autopilot
);
Q_ASSERT
(
_autopilot
->
parametersReady
());
Q_ASSERT
(
!
_autopilot
->
missingParameters
());
if
(
_vehicle
)
{
_uas
=
_vehicle
->
uas
();
_autopilot
=
_vehicle
->
autopilotPlugin
();
}
// Do a delayed check for the _factPanel finally being set correctly from Qml
QTimer
::
singleShot
(
1000
,
this
,
&
FactPanelController
::
_checkForMissingFactPanel
);
...
...
@@ -114,7 +113,7 @@ bool FactPanelController::_allParametersExists(int componentId, QStringList name
bool
noMissingFacts
=
true
;
foreach
(
QString
name
,
names
)
{
if
(
!
_autopilot
->
parameterExists
(
componentId
,
name
))
{
if
(
_autopilot
&&
!
_autopilot
->
parameterExists
(
componentId
,
name
))
{
_reportMissingParameter
(
componentId
,
name
);
noMissingFacts
=
false
;
}
...
...
@@ -132,7 +131,7 @@ void FactPanelController::_checkForMissingFactPanel(void)
Fact
*
FactPanelController
::
getParameterFact
(
int
componentId
,
const
QString
&
name
)
{
if
(
_autopilot
->
parameterExists
(
componentId
,
name
))
{
if
(
_autopilot
&&
_autopilot
->
parameterExists
(
componentId
,
name
))
{
Fact
*
fact
=
_autopilot
->
getParameterFact
(
componentId
,
name
);
QQmlEngine
::
setObjectOwnership
(
fact
,
QQmlEngine
::
CppOwnership
);
return
fact
;
...
...
@@ -144,7 +143,7 @@ Fact* FactPanelController::getParameterFact(int componentId, const QString& name
bool
FactPanelController
::
parameterExists
(
int
componentId
,
const
QString
&
name
)
{
return
_autopilot
->
parameterExists
(
componentId
,
name
)
;
return
_autopilot
?
_autopilot
->
parameterExists
(
componentId
,
name
)
:
false
;
}
void
FactPanelController
::
_showInternalError
(
const
QString
&
errorMsg
)
...
...
src/QmlControls/ParameterEditorController.cc
View file @
c8942215
...
...
@@ -34,11 +34,13 @@
/// @Brief Constructs a new ParameterEditorController Widget. This widget is used within the PX4VehicleConfig set of screens.
ParameterEditorController
::
ParameterEditorController
(
void
)
{
const
QMap
<
int
,
QMap
<
QString
,
QStringList
>
>&
groupMap
=
_autopilot
->
getGroupMap
();
foreach
(
int
componentId
,
groupMap
.
keys
())
{
_componentIds
+=
QString
(
"%1"
).
arg
(
componentId
);
}
if
(
_autopilot
)
{
const
QMap
<
int
,
QMap
<
QString
,
QStringList
>
>&
groupMap
=
_autopilot
->
getGroupMap
();
foreach
(
int
componentId
,
groupMap
.
keys
())
{
_componentIds
+=
QString
(
"%1"
).
arg
(
componentId
);
}
}
}
ParameterEditorController
::~
ParameterEditorController
()
...
...
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