Skip to content

Commit

Permalink
Improve speed of non verbose plugin Fibex loader (#386)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Wenzel <[email protected]>
  • Loading branch information
alexmucde authored Oct 26, 2023
1 parent a09306e commit a3b3436
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions plugin/nonverboseplugin/nonverboseplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <QtGui>
#include <QMessageBox>
#include <QDir>
#include <QDebug>

#include "nonverboseplugin.h"
#include "dlt_protocol.h"
Expand Down Expand Up @@ -122,6 +123,8 @@ bool NonverbosePlugin::parseFile(QString filename)
DltFibexPdu *pdu = 0;
DltFibexFrame *frame = 0;

qDebug() << "Start loading Fibex XML " << filename;

QXmlStreamReader xml(&file);
while (!xml.atEnd()) {
xml.readNext();
Expand Down Expand Up @@ -430,30 +433,31 @@ bool NonverbosePlugin::parseFile(QString filename)

file.close();

qDebug() << "Finish loading Fibex XML.";

if (warning_text.length()){
warning_text.chop(2); // remove last ", "
m_error_string.append("Duplicated FRAMES ignored: \n").append(warning_text);
ret = true;//it is not breaking the plugin functionality, but could cause wrong decoding.
}

qDebug() << "Start Creating Links";
/* create PDU Ref links */
foreach(DltFibexFrame *frame, framemapwithkey)
{
if(!frame->filename.compare(filename))
{
foreach(DltFibexPduRef *ref, frame->pdureflist)
{
foreach(DltFibexPdu *pdu, pdumap)
{
if((pdu->id == ref->id))
{
ref->ref = pdu;
break;
}
QHash<QString,DltFibexPdu*>::iterator i = pdumap.find(ref->id);
while (i != pdumap.end() && i.key() == ref->id) {
ref->ref = i.value();
++i;
}
}
}
}
qDebug() << "Finish Creating Links";

pdumap.clear();

Expand Down

0 comments on commit a3b3436

Please sign in to comment.