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
a0fbb617
Commit
a0fbb617
authored
Dec 14, 2015
by
Don Gagne
Browse files
Merge pull request #2401 from DonLakeFlyer/ParamFail
Retry initial param request if it fails, notify user
parents
356e1a9f
f5c76056
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/FactSystem/ParameterLoader.cc
View file @
a0fbb617
...
...
@@ -62,6 +62,10 @@ ParameterLoader::ParameterLoader(AutoPilotPlugin* autopilot, Vehicle* vehicle, Q
// We signal this to ouselves in order to start timer on our thread
connect
(
this
,
&
ParameterLoader
::
restartWaitingParamTimer
,
this
,
&
ParameterLoader
::
_restartWaitingParamTimer
);
_initialRequestTimeoutTimer
.
setSingleShot
(
true
);
_initialRequestTimeoutTimer
.
setInterval
(
6000
);
connect
(
&
_initialRequestTimeoutTimer
,
&
QTimer
::
timeout
,
this
,
&
ParameterLoader
::
_initialRequestTimeout
);
_waitingParamTimeoutTimer
.
setSingleShot
(
true
);
_waitingParamTimeoutTimer
.
setInterval
(
1000
);
connect
(
&
_waitingParamTimeoutTimer
,
&
QTimer
::
timeout
,
this
,
&
ParameterLoader
::
_waitingParamTimeout
);
...
...
@@ -92,6 +96,8 @@ void ParameterLoader::_parameterUpdate(int uasId, int componentId, QString param
return
;
}
_initialRequestTimeoutTimer
.
stop
();
qCDebug
(
ParameterLoaderLog
)
<<
"_parameterUpdate (usaId:"
<<
uasId
<<
"componentId:"
<<
componentId
<<
"name:"
<<
parameterName
<<
...
...
@@ -296,6 +302,10 @@ void ParameterLoader::refreshAllParameters(void)
{
_dataMutex
.
lock
();
if
(
!
_initialLoadComplete
)
{
_initialRequestTimeoutTimer
.
start
();
}
// Reset index wait lists
foreach
(
int
componentId
,
_paramCountMap
.
keys
())
{
// Add/Update all indices to the wait list, parameter index is 0-based
...
...
@@ -859,3 +869,10 @@ void ParameterLoader::_checkInitialLoadComplete(void)
emit
parametersReady
(
false
);
}
}
void
ParameterLoader
::
_initialRequestTimeout
(
void
)
{
qgcApp
()
->
showMessage
(
"Vehicle did not respond to request for parameters, retrying"
);
refreshAllParameters
();
_initialRequestTimeoutTimer
.
start
();
}
src/FactSystem/ParameterLoader.h
View file @
a0fbb617
...
...
@@ -108,6 +108,7 @@ private slots:
void
_restartWaitingParamTimer
(
void
);
void
_waitingParamTimeout
(
void
);
void
_tryCacheLookup
(
void
);
void
_initialRequestTimeout
(
void
);
private:
static
QVariant
_stringToTypedVariant
(
const
QString
&
string
,
FactMetaData
::
ValueType_t
type
,
bool
failOk
=
false
);
...
...
@@ -148,6 +149,7 @@ private:
int
_totalParamCount
;
///< Number of parameters across all components
QTimer
_initialRequestTimeoutTimer
;
QTimer
_waitingParamTimeoutTimer
;
QTimer
_cacheTimeoutTimer
;
...
...
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