Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qgroundcontrol
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Valentin Platzgummer
qgroundcontrol
Commits
8b7bc4ad
Commit
8b7bc4ad
authored
9 years ago
by
Don Gagne
Browse files
Options
Downloads
Patches
Plain Diff
Notify user of vehicle boot errors
parent
0b539643
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/FactSystem/ParameterLoader.cc
+31
-7
31 additions, 7 deletions
src/FactSystem/ParameterLoader.cc
src/uas/UASMessageHandler.cc
+13
-0
13 additions, 0 deletions
src/uas/UASMessageHandler.cc
src/uas/UASMessageHandler.h
+5
-0
5 additions, 0 deletions
src/uas/UASMessageHandler.h
with
49 additions
and
7 deletions
src/FactSystem/ParameterLoader.cc
+
31
−
7
View file @
8b7bc4ad
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#include
"QGCLoggingCategory.h"
#include
"QGCLoggingCategory.h"
#include
"QGCApplication.h"
#include
"QGCApplication.h"
#include
"QGCMessageBox.h"
#include
"QGCMessageBox.h"
#include
"UASMessageHandler.h"
#include
<QFile>
#include
<QFile>
#include
<QDebug>
#include
<QDebug>
...
@@ -752,14 +753,37 @@ void ParameterLoader::_checkInitialLoadComplete(void)
...
@@ -752,14 +753,37 @@ void ParameterLoader::_checkInitialLoadComplete(void)
}
}
}
}
// Check for any errors during vehicle boot
UASMessageHandler
*
msgHandler
=
UASMessageHandler
::
instance
();
if
(
msgHandler
->
getErrorCount
())
{
QString
errors
;
msgHandler
->
lockAccess
();
foreach
(
UASMessage
*
msg
,
msgHandler
->
messages
())
{
if
(
msg
->
severityIsError
())
{
errors
+=
msg
->
getText
();
errors
+=
"
\n
"
;
}
}
msgHandler
->
unlockAccess
();
QGCMessageBox
::
critical
(
"Vehicle startup errors"
,
QString
(
"Errors were detected during vehicle startup:
\n
"
"%1"
"You should resolve these prior to flight."
).
arg
(
errors
));
}
// Warn of parameter load failure
if
(
initialLoadFailures
)
{
if
(
initialLoadFailures
)
{
QGCMessageBox
::
critical
(
"Parameter Load Failure"
,
QGCMessageBox
::
critical
(
"Parameter Load Failure"
,
QString
(
"QGroundControl was unable to retrieve the full set of parameters from the vehicle. "
"QGroundControl was unable to retrieve the full set of parameters from the vehicle. "
"This will cause QGroundControl to be unable to display it's full user interface. "
"This will cause QGroundControl to be unable to display it's full user interface. "
"This usually indicates an error in the vehicle's firmwar
e. "
"If you are using modified firmware, you may need to resolve any vehicle startup errors to resolve the issu
e. "
"Please upgrade your firmware to the latest version if possible. "
"If you are using standard firmware, you may need to upgrade to a newer version to resolve the issue."
);
"If that doesn't work, notify the firmware develop
er
s
of
this error. "
qCWarning
(
ParameterLoaderLog
)
<<
"The following parameter indices could not be loaded after the maximum numb
er of
retries: "
<<
indexList
;
"The following parameter indices could not be loaded after the maximum number of retries: %1."
).
arg
(
indexList
));
}
else
{
}
else
{
// No failed parameters, ok to signal ready
// No failed parameters, ok to signal ready
_parametersReady
=
true
;
_parametersReady
=
true
;
...
@@ -767,4 +791,4 @@ void ParameterLoader::_checkInitialLoadComplete(void)
...
@@ -767,4 +791,4 @@ void ParameterLoader::_checkInitialLoadComplete(void)
_setupGroupMap
();
_setupGroupMap
();
emit
parametersReady
();
emit
parametersReady
();
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/uas/UASMessageHandler.cc
+
13
−
0
View file @
8b7bc4ad
...
@@ -38,6 +38,19 @@ UASMessage::UASMessage(int componentid, int severity, QString text)
...
@@ -38,6 +38,19 @@ UASMessage::UASMessage(int componentid, int severity, QString text)
_text
=
text
;
_text
=
text
;
}
}
bool
UASMessage
::
severityIsError
()
{
switch
(
_severity
)
{
case
MAV_SEVERITY_EMERGENCY
:
case
MAV_SEVERITY_ALERT
:
case
MAV_SEVERITY_CRITICAL
:
case
MAV_SEVERITY_ERROR
:
return
true
;
default:
return
false
;
}
}
IMPLEMENT_QGC_SINGLETON
(
UASMessageHandler
,
UASMessageHandler
)
IMPLEMENT_QGC_SINGLETON
(
UASMessageHandler
,
UASMessageHandler
)
UASMessageHandler
::
UASMessageHandler
(
QObject
*
parent
)
UASMessageHandler
::
UASMessageHandler
(
QObject
*
parent
)
...
...
This diff is collapsed.
Click to expand it.
src/uas/UASMessageHandler.h
+
5
−
0
View file @
8b7bc4ad
...
@@ -63,6 +63,11 @@ public:
...
@@ -63,6 +63,11 @@ public:
* @brief Get (html) formatted text (in the form: "[11:44:21.137 - COMP:50] Info: [pm] sending list")
* @brief Get (html) formatted text (in the form: "[11:44:21.137 - COMP:50] Info: [pm] sending list")
*/
*/
QString
getFormatedText
()
{
return
_formatedText
;
}
QString
getFormatedText
()
{
return
_formatedText
;
}
/**
* @return true: This message is a of a severity which is considered an error
*/
bool
severityIsError
();
private
:
private
:
UASMessage
(
int
componentid
,
int
severity
,
QString
text
);
UASMessage
(
int
componentid
,
int
severity
,
QString
text
);
void
_setFormatedText
(
const
QString
formatedText
)
{
_formatedText
=
formatedText
;
}
void
_setFormatedText
(
const
QString
formatedText
)
{
_formatedText
=
formatedText
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment