1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

bring back reporting of the size of the objects + sum of sizes

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2471 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
ligi 2011-01-17 07:51:53 +00:00 committed by ligi
parent ce87b8f05a
commit 2e3c20b12f

View File

@ -119,9 +119,11 @@ int main(int argc, char *argv[])
QFileInfoList xmlList = xmlPath.entryInfoList();
// Read in each XML file and parse object(s) in them
for (int n = 0; n < xmlList.length(); ++n) {
QFileInfo fileinfo = xmlList[n];
cout << "Parsing XML file: " << fileinfo.fileName().toStdString() << endl;
if (verbose)
cout << "Parsing XML file: " << fileinfo.fileName().toStdString() << endl;
QString filename = fileinfo.fileName();
QString xmlstr = readFile(fileinfo.absoluteFilePath());
@ -135,10 +137,13 @@ int main(int argc, char *argv[])
// check for duplicate object ID's
QList<quint32> objIDList;
int numBytesTotal=0;
for (int objidx = 0; objidx < parser->getNumObjects(); ++objidx) {
quint32 id = parser->getObjectID(objidx);
if ( objIDList.contains(id) || id == 0 ) {
numBytesTotal+=parser->getNumBytes(objidx);
if (verbose)
cout << "Checking object " << parser->getObjectName(objidx).toStdString() << " (" << parser->getNumBytes(objidx) << " bytes)" << endl;
if ( objIDList.contains(id) || id == 0 ) {
cout << "Error: Object ID collision found in object " << parser->getObjectName(objidx).toStdString() << ", modify object name" << endl;
return RETURN_ERR_XML;
}
@ -148,7 +153,7 @@ int main(int argc, char *argv[])
// done parsing and checking
cout << "Done: processed " << xmlList.length() << " XML files and generated "
<< objIDList.length() << " objects with no ID collisions." << endl;
<< objIDList.length() << " objects with no ID collisions. Total size of the data fields is " << numBytesTotal << " bytes." << endl;
if (verbose)