Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve speed of non verbose plugin Fibex loader #386

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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