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
e59f0045
Commit
e59f0045
authored
Jun 13, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try initial request 5 times max
Also don’t pop errors for initial request failure on generic vehicle.
parent
727c55fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
ParameterLoader.cc
src/FactSystem/ParameterLoader.cc
+10
-4
ParameterLoader.h
src/FactSystem/ParameterLoader.h
+4
-2
No files found.
src/FactSystem/ParameterLoader.cc
View file @
e59f0045
...
...
@@ -47,6 +47,7 @@ ParameterLoader::ParameterLoader(Vehicle* vehicle)
,
_defaultComponentId
(
MAV_COMP_ID_ALL
)
,
_parameterSetMajorVersion
(
-
1
)
,
_parameterMetaData
(
NULL
)
,
_initialRequestRetryCount
(
0
)
,
_totalParamCount
(
0
)
{
Q_ASSERT
(
_vehicle
);
...
...
@@ -490,7 +491,7 @@ void ParameterLoader::_waitingParamTimeout(void)
foreach
(
int
componentId
,
_waitingReadParamIndexMap
.
keys
())
{
foreach
(
int
paramIndex
,
_waitingReadParamIndexMap
[
componentId
].
keys
())
{
_waitingReadParamIndexMap
[
componentId
][
paramIndex
]
++
;
// Bump retry count
if
(
_waitingReadParamIndexMap
[
componentId
][
paramIndex
]
>
_maxInitialLoadRetry
)
{
if
(
_waitingReadParamIndexMap
[
componentId
][
paramIndex
]
>
_maxInitialLoadRetry
SingleParam
)
{
// Give up on this index
_failedReadParamIndexMap
[
componentId
]
<<
paramIndex
;
qCDebug
(
ParameterLoaderLog
)
<<
"Giving up on (componentId:"
<<
componentId
<<
"paramIndex:"
<<
paramIndex
<<
"retryCount:"
<<
_waitingReadParamIndexMap
[
componentId
][
paramIndex
]
<<
")"
;
...
...
@@ -978,9 +979,14 @@ void ParameterLoader::_checkInitialLoadComplete(bool failIfNoDefaultComponent)
void
ParameterLoader
::
_initialRequestTimeout
(
void
)
{
qgcApp
()
->
showMessage
(
"Vehicle did not respond to request for parameters, retrying"
);
refreshAllParameters
();
_initialRequestTimeoutTimer
.
start
();
if
(
!
_vehicle
->
genericFirmware
())
{
// Generic vehicles (like BeBop) may not have any parameters, so don't annoy the user
qgcApp
()
->
showMessage
(
"Vehicle did not respond to request for parameters, retrying"
);
}
if
(
++
_initialRequestRetryCount
<=
_maxInitialRequestListRetry
)
{
refreshAllParameters
();
_initialRequestTimeoutTimer
.
start
();
}
}
QString
ParameterLoader
::
parameterMetaDataFile
(
MAV_AUTOPILOT
firmwareType
,
int
wantedMajorVersion
,
int
&
majorVersion
,
int
&
minorVersion
)
...
...
src/FactSystem/ParameterLoader.h
View file @
e59f0045
...
...
@@ -151,8 +151,10 @@ private:
int
_parameterSetMajorVersion
;
///< Version for parameter set, -1 if not known
QObject
*
_parameterMetaData
;
///< Opaque data from FirmwarePlugin::loadParameterMetaDataCall
static
const
int
_maxInitialLoadRetry
=
10
;
///< Maximum retries for initial index based load
static
const
int
_maxReadWriteRetry
=
5
;
///< Maximum retries read/write
static
const
int
_maxInitialRequestListRetry
=
5
;
///< Maximum retries for request list
int
_initialRequestRetryCount
;
///< Current retry count for request list
static
const
int
_maxInitialLoadRetrySingleParam
=
10
;
///< Maximum retries for initial index based load of a single param
static
const
int
_maxReadWriteRetry
=
5
;
///< Maximum retries read/write
QMap
<
int
,
int
>
_paramCountMap
;
///< Key: Component id, Value: count of parameters in this component
QMap
<
int
,
QMap
<
int
,
int
>
>
_waitingReadParamIndexMap
;
///< Key: Component id, Value: Map { Key: parameter index still waiting for, Value: retry count }
...
...
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