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
8412f333
Commit
8412f333
authored
Aug 23, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1792 from DonLakeFlyer/AirframeLogging
Clean up noisy Airframe meta data logging
parents
65aa662a
0f348180
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
67 deletions
+9
-67
AirframeComponentAirframes.cc
src/AutoPilotPlugins/PX4/AirframeComponentAirframes.cc
+0
-1
PX4AirframeLoader.cc
src/AutoPilotPlugins/PX4/PX4AirframeLoader.cc
+9
-66
No files found.
src/AutoPilotPlugins/PX4/AirframeComponentAirframes.cc
View file @
8412f333
...
...
@@ -62,7 +62,6 @@ void AirframeComponentAirframes::insert(QString& group, QString& image, QString&
}
else
{
g
->
imageResource
=
QString
(
"qrc:/qmlimages/AirframeStandardPlane.png"
);
}
qDebug
()
<<
"IMAGE:"
<<
g
->
imageResource
;
rgAirframeTypes
.
insert
(
group
,
g
);
}
else
{
g
=
rgAirframeTypes
.
value
(
group
);
...
...
src/AutoPilotPlugins/PX4/PX4AirframeLoader.cc
View file @
8412f333
...
...
@@ -56,7 +56,6 @@ void PX4AirframeLoader::loadAirframeFactMetaData(void)
}
qCDebug
(
PX4AirframeLoaderLog
)
<<
"Loading PX4 airframe fact meta data"
;
qDebug
()
<<
"LOADING META DATA"
;
Q_ASSERT
(
AirframeComponentAirframes
::
get
().
count
()
==
0
);
...
...
@@ -83,14 +82,14 @@ void PX4AirframeLoader::loadAirframeFactMetaData(void)
Q_ASSERT
(
success
);
if
(
!
success
)
{
q
Warning
(
)
<<
"Failed opening airframe XML"
;
q
CWarning
(
PX4AirframeLoaderLog
)
<<
"Failed opening airframe XML"
;
return
;
}
QXmlStreamReader
xml
(
xmlFile
.
readAll
());
xmlFile
.
close
();
if
(
xml
.
hasError
())
{
q
Warning
(
)
<<
"Badly formed XML"
<<
xml
.
errorString
();
q
CWarning
(
PX4AirframeLoaderLog
)
<<
"Badly formed XML"
<<
xml
.
errorString
();
return
;
}
...
...
@@ -98,7 +97,6 @@ void PX4AirframeLoader::loadAirframeFactMetaData(void)
QString
image
;
QString
errorString
;
int
xmlState
=
XmlStateNone
;
bool
badMetaData
=
true
;
while
(
!
xml
.
atEnd
())
{
if
(
xml
.
isStartElement
())
{
...
...
@@ -106,14 +104,14 @@ void PX4AirframeLoader::loadAirframeFactMetaData(void)
if
(
elementName
==
"airframes"
)
{
if
(
xmlState
!=
XmlStateNone
)
{
q
Warning
(
)
<<
"Badly formed XML"
;
q
CWarning
(
PX4AirframeLoaderLog
)
<<
"Badly formed XML"
;
return
;
}
xmlState
=
XmlStateFoundAirframes
;
}
else
if
(
elementName
==
"version"
)
{
if
(
xmlState
!=
XmlStateFoundAirframes
)
{
q
Warning
(
)
<<
"Badly formed XML"
;
q
CWarning
(
PX4AirframeLoaderLog
)
<<
"Badly formed XML"
;
return
;
}
xmlState
=
XmlStateFoundVersion
;
...
...
@@ -122,7 +120,7 @@ void PX4AirframeLoader::loadAirframeFactMetaData(void)
QString
strVersion
=
xml
.
readElementText
();
int
intVersion
=
strVersion
.
toInt
(
&
convertOk
);
if
(
!
convertOk
)
{
q
Warning
(
)
<<
"Badly formed XML"
;
q
CWarning
(
PX4AirframeLoaderLog
)
<<
"Badly formed XML"
;
return
;
}
if
(
intVersion
<
1
)
{
...
...
@@ -141,7 +139,7 @@ void PX4AirframeLoader::loadAirframeFactMetaData(void)
xmlState
=
XmlStateFoundGroup
;
if
(
!
xml
.
attributes
().
hasAttribute
(
"name"
)
||
!
xml
.
attributes
().
hasAttribute
(
"image"
))
{
q
Warning
(
)
<<
"Badly formed XML"
;
q
CWarning
(
PX4AirframeLoaderLog
)
<<
"Badly formed XML"
;
return
;
}
airframeGroup
=
xml
.
attributes
().
value
(
"name"
).
toString
();
...
...
@@ -150,13 +148,13 @@ void PX4AirframeLoader::loadAirframeFactMetaData(void)
}
else
if
(
elementName
==
"airframe"
)
{
if
(
xmlState
!=
XmlStateFoundGroup
)
{
q
Warning
(
)
<<
"Badly formed XML"
;
q
CWarning
(
PX4AirframeLoaderLog
)
<<
"Badly formed XML"
;
return
;
}
xmlState
=
XmlStateFoundAirframe
;
if
(
!
xml
.
attributes
().
hasAttribute
(
"name"
)
||
!
xml
.
attributes
().
hasAttribute
(
"id"
))
{
q
Warning
(
)
<<
"Badly formed XML"
;
q
CWarning
(
PX4AirframeLoaderLog
)
<<
"Badly formed XML"
;
return
;
}
...
...
@@ -171,70 +169,15 @@ void PX4AirframeLoader::loadAirframeFactMetaData(void)
}
else
{
// We should be getting meta data now
if
(
xmlState
!=
XmlStateFoundAirframe
)
{
q
Warning
(
)
<<
"Badly formed XML"
;
q
CWarning
(
PX4AirframeLoaderLog
)
<<
"Badly formed XML"
;
return
;
}
if
(
!
badMetaData
)
{
// We eventually want this, just not yet now
// if (elementName == "short_desc") {
// Q_ASSERT(metaData);
// QString text = xml.readElementText();
// text = text.replace("\n", " ");
// qCDebug(PX4AirframeLoaderLog) << "Short description:" << text;
// metaData->setShortDescription(text);
// } else if (elementName == "long_desc") {
// Q_ASSERT(metaData);
// QString text = xml.readElementText();
// text = text.replace("\n", " ");
// qCDebug(PX4AirframeLoaderLog) << "Long description:" << text;
// metaData->setLongDescription(text);
// } else if (elementName == "min") {
// Q_ASSERT(metaData);
// QString text = xml.readElementText();
// qCDebug(PX4AirframeLoaderLog) << "Min:" << text;
// QVariant varMin;
// if (metaData->convertAndValidate(text, true /* convertOnly */, varMin, errorString)) {
// metaData->setMin(varMin);
// } else {
// qCWarning(PX4AirframeLoaderLog) << "Invalid min value, name:" << metaData->name() << " type:" << metaData->type() << " min:" << text << " error:" << errorString;
// }
// } else if (elementName == "max") {
// Q_ASSERT(metaData);
// QString text = xml.readElementText();
// qCDebug(PX4AirframeLoaderLog) << "Max:" << text;
// QVariant varMax;
// if (metaData->convertAndValidate(text, true /* convertOnly */, varMax, errorString)) {
// metaData->setMax(varMax);
// } else {
// qCWarning(PX4AirframeLoaderLog) << "Invalid max value, name:" << metaData->name() << " type:" << metaData->type() << " max:" << text << " error:" << errorString;
// }
// } else if (elementName == "unit") {
// Q_ASSERT(metaData);
// QString text = xml.readElementText();
// qCDebug(PX4AirframeLoaderLog) << "Unit:" << text;
// metaData->setUnits(text);
// } else {
qDebug
()
<<
"Unknown element in XML: "
<<
elementName
;
// }
}
}
}
else
if
(
xml
.
isEndElement
())
{
QString
elementName
=
xml
.
name
().
toString
();
if
(
elementName
==
"airframe"
)
{
// Done loading this airframe, validate
// Reset for next airframe
badMetaData
=
false
;
xmlState
=
XmlStateFoundGroup
;
}
else
if
(
elementName
==
"airframe_group"
)
{
xmlState
=
XmlStateFoundVersion
;
...
...
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