Skip to content

Commit

Permalink
Merge branch 'COVESA:master' into xCode
Browse files Browse the repository at this point in the history
  • Loading branch information
bunty95 authored Jul 11, 2024
2 parents dd644d1 + 636842e commit 050d8dd
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 42 deletions.
2 changes: 1 addition & 1 deletion plugin/dltdbusplugin/dltdbusplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ void DltDBusPlugin::initFileStart(QDltFile *file)
plugin_is_active = true;
dltFile = file;
methods.clear();
qDebug() << "Activate plugin" << plugin_name_displayed << DLT_DBUS_PLUGIN_VERSION;
//qDebug() << "Activate plugin" << plugin_name_displayed << DLT_DBUS_PLUGIN_VERSION;
// clear old map
QMapIterator<uint32_t, QDltSegmentedMsg*> i(segmentedMessages);
while (i.hasNext())
Expand Down
2 changes: 1 addition & 1 deletion plugin/dltviewerplugin/dltviewerplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ void DltViewerPlugin::selectedIdxMsg(int index, QDltMsg &msg) {
void DltViewerPlugin::initFileStart(QDltFile *file)
{
dltFile = file;
qDebug() << "Activate plugin" << plugin_name_displayed << DLT_VIEWER_PLUGIN_VERSION;
//qDebug() << "Activate plugin" << plugin_name_displayed << DLT_VIEWER_PLUGIN_VERSION;
}

void DltViewerPlugin::initMsg(int /*index*/, QDltMsg & /*msg*/){
Expand Down
2 changes: 1 addition & 1 deletion plugin/filetransferplugin/filetransferplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ void FiletransferPlugin::initFileStart(QDltFile *file)
{
if (plugin_is_active == false )
{
qDebug() << "Activate plugin" << plugin_name_displayed << FILETRANSFER_PLUGIN_VERSION;
//qDebug() << "Activate plugin" << plugin_name_displayed << FILETRANSFER_PLUGIN_VERSION;
plugin_is_active = true;
}
dltFile = file;
Expand Down
2 changes: 1 addition & 1 deletion qdlt/qdltfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ int QDltFile::sizeFilter() const

bool QDltFile::open(QString _filename, bool append)
{
qDebug() << "Open file" << _filename << "started" << __FILE__ << __LINE__;
qDebug() << "Open file" << _filename << "started";

/* check if file is already opened */
if(!append)
Expand Down
32 changes: 18 additions & 14 deletions qdlt/qdltoptmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ const QStringList &QDltOptManager::getPrePluginCommands() const

void QDltOptManager::printVersion(QString appname)
{
qDebug() << "Start" << appname << "\nBuild time" << __DATE__ << __TIME__;
qDebug() << "Version" << PACKAGE_VERSION << PACKAGE_VERSION_STATE;
qDebug() << "**********************************************************";
qDebug() << "Executable Name:" << appname;
qDebug() << "Build time:" << __DATE__ << __TIME__;
qDebug() << "Version:" << PACKAGE_VERSION << PACKAGE_VERSION_STATE;
}

void QDltOptManager::printUsage()
Expand Down Expand Up @@ -122,6 +122,12 @@ void QDltOptManager::parse(QStringList *opt)
{
QString str;

qDebug() << "### Starting DLT Viewer";

printVersion(opt->at(0));

qDebug() << "### Parsing Options";

/* the default parameter - exactly one parameter - should either be
* a dlt or a dlp file, so this enables the "doubleclick" feature
*/
Expand All @@ -132,14 +138,14 @@ void QDltOptManager::parse(QStringList *opt)
{
projectFile = QString("%1").arg(opt->at(1));
project = true;
qDebug()<< "Loading projectfile " << projectFile;
qDebug()<< "Project filename:" << projectFile;
return;
}
if(opt->at(1).endsWith(".dlt") || opt->at(1).endsWith(".DLT"))
{
const QString logFile = QString("%1").arg(opt->at(1));
logFiles += logFile;
qDebug()<< "Loading logfile " << logFile;
qDebug()<< "DLT filename:" << logFile;
return;
}
}
Expand All @@ -159,7 +165,7 @@ void QDltOptManager::parse(QStringList *opt)
if ( silent_mode == false)
{
silent_mode = true;
qDebug() << "Enable silent mode";
qDebug() << "Silent mode enabled";
}
}
else if(str.compare("-v") == 0 || str.compare("--version") == 0)
Expand All @@ -179,7 +185,7 @@ void QDltOptManager::parse(QStringList *opt)
convertDestFile = QString("%1").arg(c1);
// check here already if the selected file exists

qDebug() << "Converting to" << convertDestFile;
qDebug() << "Convert filename:" << convertDestFile;
commandline_mode = true;

i += 1;
Expand Down Expand Up @@ -228,7 +234,7 @@ void QDltOptManager::parse(QStringList *opt)
{
const QString logFile = QString("%1").arg(opt->at(i));
logFiles += logFile;
qDebug()<< "Loading logfile " << logFile;
qDebug()<< "DLT filename:" << logFile;
}
else if(opt->at(i).endsWith(".dlp") || opt->at(i).endsWith(".DLP"))
{
Expand All @@ -241,24 +247,24 @@ void QDltOptManager::parse(QStringList *opt)

projectFile = QString("%1").arg(opt->at(i));
project = true;
qDebug()<< "Loading projectfile " << projectFile;
qDebug()<< "Project filename:" << projectFile;
}
else if(opt->at(i).endsWith(".dlf") || opt->at(i).endsWith(".DLF"))
{
filterFiles += QString("%1").arg(opt->at(i));
qDebug()<< "Loading filterfile " << QString("%1").arg(opt->at(i));
qDebug()<< "Filter filename:" << QString("%1").arg(opt->at(i));
}
else if(opt->at(i).endsWith(".pcap") || opt->at(i).endsWith(".PCAP"))
{
const QString pcapFile = QString("%1").arg(opt->at(i));
pcapFiles += pcapFile;
qDebug()<< "Importing pcapfile" << pcapFile;
qDebug()<< "Pcap filename:" << pcapFile;
}
else if(opt->at(i).endsWith(".mf4") || opt->at(i).endsWith(".MF4"))
{
const QString mf4File = QString("%1").arg(opt->at(i));
mf4Files += mf4File;
qDebug()<< "Importing mf4file" << mf4File;
qDebug()<< "MF4 filename:" << mf4File;
}

} // end of for loop
Expand All @@ -274,8 +280,6 @@ void QDltOptManager::parse(QStringList *opt)
FreeConsole();
}
#endif

printVersion(opt->at(0));
}

bool QDltOptManager::isProjectFile(){ return project;}
Expand Down
2 changes: 1 addition & 1 deletion qdlt/qdltpluginmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ bool QDltPluginManager::setPluginPriority(const QString name, unsigned int prio)
for (int num = 0; num < plugins.size(); ++num) {
if (plugins[num]->name() == name) {
if (prio != num) {
qDebug() << "changing prio of" << name << "from" << num << "to" << prio;
qDebug() << "Changing priority of plugin" << name << "from" << num << "to" << prio;
plugins.move(num, prio);
}
result = true;
Expand Down
24 changes: 14 additions & 10 deletions src/dltfileindexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ bool DltFileIndexer::index(int num)
return true; // because it is just empty, not an error ...
}

int modulo = f.size()/2000; // seems to be the propper ratio ...
int modulo = f.size()/200; // seems to be the propper ratio ...
if (modulo == 0) // avoid divison by zero ( very small files )
{
modulo = 1;
Expand Down Expand Up @@ -161,6 +161,7 @@ bool DltFileIndexer::index(int num)
emit(progress(0));


qDebug() << "Create index: Start";
do
{
pos = f.pos();
Expand Down Expand Up @@ -327,22 +328,21 @@ bool DltFileIndexer::index(int num)

if( 0 == (abspos%modulo) && ( file_size > 0 ) )
{
//qszPercent = QString("Indexed: %1 %").arg(pos, 0, 'f',2);
iPercent = ( abspos*100 )/file_size;
if( true == QDltOptManager::getInstance()->issilentMode() )
{
qDebug() << "Create index file:" << iPercent << "%";// << currentRun;//<< pos << f.size() << __LINE__;
qDebug() << "Create index:" << iPercent << "%";
}
else
{
emit(progress((iPercent)));
//qDebug() << "Create index file:" << iPercent << "%";// << currentRun;//<< pos << f.size() << __LINE__;
}
}

} // end of for loop to read within one segment accross "number"
}
while(length>0); // overall "do loop"
qDebug() << "Create index: Finish";

if ( errors_in_file != 0 )
{
Expand Down Expand Up @@ -465,6 +465,9 @@ bool DltFileIndexer::indexFilter(QStringList filenames)
indexerThread.start(); // thread starts reading its queue
}

qDebug() << "### Create filter index";
qDebug() << "Create filter index: Start";

// Start reading messages
for(ix=start;ix<end;ix++)
{
Expand Down Expand Up @@ -492,7 +495,7 @@ bool DltFileIndexer::indexFilter(QStringList filenames)
// QDebug deb = qDebug();
// deb.noquote();
// deb << "\33[2K\rT IF Indexed:" << iPercent << "%";
qDebug().noquote() << "IF Indexed:" << iPercent << "%";
qDebug().noquote() << "Create filter index:" << iPercent << "%";
}
else
{
Expand Down Expand Up @@ -534,8 +537,8 @@ bool DltFileIndexer::indexFilter(QStringList filenames)
qDebug() << "Saved filter index cache for files" << filenames;
}

qDebug() << "Indexed: 100.00 %";// << iPercent << __LINE__ ;
//qDebug() << "Dauer:" << time.elapsed()/1000 << __LINE__;
qDebug() << "Create filter index: Finish";

return true;
}

Expand Down Expand Up @@ -1037,6 +1040,7 @@ bool DltFileIndexer::loadIndex(QString filename, QVector<qint64> &index)
return false;
}

qDebug() << "### Load index file";
qDebug() << "Load index file " << filename;// << __FILE__ << "LINE" << __LINE__;

index.reserve(static_cast<int>((file.size() - sizeof(version)) / sizeof(value))); // prevent memory issues through reallocation
Expand Down Expand Up @@ -1068,7 +1072,7 @@ bool DltFileIndexer::loadIndex(QString filename, QVector<qint64> &index)
}
else
{
qDebug().noquote() << "Loading index file: 0 %";
qDebug().noquote() << "Load index: Start";
}

do
Expand All @@ -1086,7 +1090,7 @@ bool DltFileIndexer::loadIndex(QString filename, QVector<qint64> &index)
}
else
{
qDebug().noquote() << "Loading index file:" << ( indexcount * 8 *100 )/file.size() << "%";
qDebug().noquote() << "Load index:" << ( indexcount * 8 *100 )/file.size() << "%";
}
}
indexcount++;
Expand All @@ -1101,7 +1105,7 @@ bool DltFileIndexer::loadIndex(QString filename, QVector<qint64> &index)
}
else
{
qDebug().noquote() << "Loading index file:" << ( indexcount * 8 *100 )/file.size() << "%";// << length << indexcount << file.size(); //<< pos << f.size() << __LINE__;
qDebug().noquote() << "Load index: Finish";
}
// close cache file
file.close();
Expand Down
Loading

0 comments on commit 050d8dd

Please sign in to comment.