From 085d3c07bcc81ee4844eb95a7359b57b07b2da9a Mon Sep 17 00:00:00 2001 From: omircon Date: Wed, 20 Nov 2024 09:51:13 +0100 Subject: [PATCH 01/11] Add missing includes Without them we had incomplete types. --- src/mainwindow.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 100ee7da..8cb91638 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -48,6 +48,8 @@ #include #include #include +#include +#include /** * From QDlt. From cf30a0e541f96d71f4494b4cfae550b6c93984c8 Mon Sep 17 00:00:00 2001 From: omircon Date: Wed, 20 Nov 2024 09:53:03 +0100 Subject: [PATCH 02/11] Set C standard to c11 This is needed, because dlt_common.c includes `` which includes implicitly `` which contains ``` static_assert(sizeof(ptrdiff_t) == sizeof(size_t), "Weird ptrdiff_t and size_t definitions"); ... ``` But `static_assert` in C is available only from c11 standard. Though this is working with clang, but not with gcc compiler, so we set the standard explicitly to c11. --- CMakeLists.txt | 2 ++ src/src.pro | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f285aa2a..a944af1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,8 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +set(CMAKE_C_STANDARD 11) + if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) endif() diff --git a/src/src.pro b/src/src.pro index a3918dd1..3b42f1ea 100644 --- a/src/src.pro +++ b/src/src.pro @@ -6,7 +6,7 @@ QT_VER_MIN = $$member(QT_VERSION, 1) CONFIG += c++1z *-gcc* { - QMAKE_CFLAGS += -std=gnu99 + QMAKE_CFLAGS += -std=c11 QMAKE_CFLAGS += -Wall QMAKE_CFLAGS += -Wextra #QMAKE_CXXFLAGS += -pedantic From e390c9d851a53294ed706c544d3bf4adc376743e Mon Sep 17 00:00:00 2001 From: Viktor Kopp Date: Sun, 24 Nov 2024 17:00:04 +0100 Subject: [PATCH 03/11] No use of QtGlobal in c-code Signed-off-by: Viktor Kopp --- plugin/dlttestrobotplugin/dlttestrobotplugin.cpp | 11 +---------- qdlt/dlt_types.h | 2 +- qdlt/dlt_user.h | 1 - qdlt/export_rules.h | 8 ++------ qdlt/qdltsegmentedmsg.h | 1 - src/dltmsgqueue.cpp | 2 ++ src/mainwindow.cpp | 10 ++-------- 7 files changed, 8 insertions(+), 27 deletions(-) diff --git a/plugin/dlttestrobotplugin/dlttestrobotplugin.cpp b/plugin/dlttestrobotplugin/dlttestrobotplugin.cpp index 14291b90..99fcdb23 100644 --- a/plugin/dlttestrobotplugin/dlttestrobotplugin.cpp +++ b/plugin/dlttestrobotplugin/dlttestrobotplugin.cpp @@ -108,16 +108,7 @@ bool DltTestRobotPlugin::controlMsg(int , QDltMsg &) return false; } -bool DltTestRobotPlugin::stateChanged(int index, QDltConnection::QDltConnectionState connectionState,QString hostname){ - Q_UNUSED(index) - Q_UNUSED(connectionState) - Q_UNUSED(hostname) - -#if QT_5_SUPPORTED_VERSION - //qDebug() << ecuList->at(index) << "ConnectionState:" << connectionState << "Hostname:" << hostname << Qt::endl; -#else - //qDebug() << ecuList->at(index) << "ConnectionState:" << connectionState << "Hostname:" << hostname << endl; -#endif +bool DltTestRobotPlugin::stateChanged(int, QDltConnection::QDltConnectionState, QString) { return true; } diff --git a/qdlt/dlt_types.h b/qdlt/dlt_types.h index d806c639..d4494abe 100644 --- a/qdlt/dlt_types.h +++ b/qdlt/dlt_types.h @@ -59,7 +59,7 @@ typedef int pid_t; #endif -#ifdef TARGET_OS_MAC +#ifdef __APPLE__ typedef unsigned long speed_t; #else typedef unsigned int speed_t; diff --git a/qdlt/dlt_user.h b/qdlt/dlt_user.h index f9baef79..194602d2 100644 --- a/qdlt/dlt_user.h +++ b/qdlt/dlt_user.h @@ -71,7 +71,6 @@ \{ */ -#include "dlt_types.h" #include "dlt_common.h" #ifdef __cplusplus diff --git a/qdlt/export_rules.h b/qdlt/export_rules.h index 61e79ed5..588b173c 100644 --- a/qdlt/export_rules.h +++ b/qdlt/export_rules.h @@ -1,24 +1,20 @@ -#include - #ifndef EXPORT_RULES_H #define EXPORT_RULES_H #if defined(QDLT_LIBRARY) # define QDLT_EXPORT Q_DECL_EXPORT -# ifdef Q_OS_WIN +# if defined(_WIN32) || defined(_WIN64) # define QDLT_C_EXPORT __declspec(dllexport) # else # define QDLT_C_EXPORT __attribute__((visibility("default"))) # endif #else # define QDLT_EXPORT Q_DECL_IMPORT -# ifdef Q_OS_WIN +# if defined(_WIN32) || defined(_WIN64) # define QDLT_C_EXPORT __declspec(dllimport) # else # define QDLT_C_EXPORT # endif #endif -#define QT_5_SUPPORTED_VERSION (QT_VERSION_MAJOR == 5 && QT_VERSION_MINOR >= 14) || (QT_VERSION_MAJOR >= 6) - #endif // EXPORT_RULES_H diff --git a/qdlt/qdltsegmentedmsg.h b/qdlt/qdltsegmentedmsg.h index 9ac08d67..8c03daf5 100644 --- a/qdlt/qdltsegmentedmsg.h +++ b/qdlt/qdltsegmentedmsg.h @@ -25,7 +25,6 @@ #include "export_rules.h" #include -#include //! Combine segmented network messages /*! diff --git a/src/dltmsgqueue.cpp b/src/dltmsgqueue.cpp index 3c0c0590..61297674 100644 --- a/src/dltmsgqueue.cpp +++ b/src/dltmsgqueue.cpp @@ -1,6 +1,8 @@ #include "dltmsgqueue.h" #include +#define QT_5_SUPPORTED_VERSION (QT_VERSION_MAJOR == 5 && QT_VERSION_MINOR >= 14) || (QT_VERSION_MAJOR >= 6) + DltMsgQueue::DltMsgQueue(int size) : bufferSize(size), buffer(new QPair, int> [size]), diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 100ee7da..f28bb4e2 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -7139,14 +7139,10 @@ void MainWindow::filterUpdate() if(filter->enableRegexp_Appid || filter->enableRegexp_Context || filter->enableRegexp_Header || filter->enableRegexp_Payload) { - if(false == filter->compileRegexps()) + if(!filter->compileRegexps()) { // This is also validated in the UI part -#if QT_5_SUPPORTED_VERSION - qDebug() << "Error compiling a regexp" << Qt::endl << "in" << __FILE__ << __LINE__; -#else - qDebug() << "Error compiling a regexp" << endl << "in" << __FILE__ << __LINE__; -#endif + qDebug() << "Error compiling a regexp\nin" << __FILE__ << __LINE__; } } @@ -7155,8 +7151,6 @@ void MainWindow::filterUpdate() qfile.updateSortedFilter(); } - - void MainWindow::on_tableView_customContextMenuRequested(QPoint pos) { /* show custom pop menu for configuration */ From d058968e0eddeffb2074fb1a3f8e4b78a5fbf255 Mon Sep 17 00:00:00 2001 From: Viktor Kopp Date: Sun, 17 Nov 2024 22:08:51 +0100 Subject: [PATCH 04/11] Various code fixes - Fix couple of warnings - Minor cleanup of dead code - Const-correctness for a couple of funcs Signed-off-by: Viktor Kopp --- src/dltfileindexer.cpp | 10 +--------- src/dltfileindexer.h | 2 +- src/mainwindow.cpp | 25 ++++++++++++------------- src/mainwindow.h | 7 +++---- 4 files changed, 17 insertions(+), 27 deletions(-) diff --git a/src/dltfileindexer.cpp b/src/dltfileindexer.cpp index f85f9a93..9013eb97 100644 --- a/src/dltfileindexer.cpp +++ b/src/dltfileindexer.cpp @@ -151,7 +151,6 @@ bool DltFileIndexer::index(int num) quint8 version=1; qint64 lengthOffset=2; qint64 storageLength=0; - int iPercent =0; errors_in_file = 0; char *data = new char[DLT_FILE_INDEXER_SEG_SIZE]; @@ -378,7 +377,6 @@ bool DltFileIndexer::indexFilter(QStringList filenames) { QSharedPointer msg; QDltFilterList filterList; - QTime time; quint64 ix = 0; unsigned int iPercent = 0; @@ -429,12 +427,6 @@ bool DltFileIndexer::indexFilter(QStringList filenames) return true; } - unsigned int modvalue = dltFile->size()/20; - if (modvalue == 0) // avoid divison by zero - { - modvalue = 1; - } - // Initialise progress bar emit(progressText(QString("CFI %1/%2").arg(currentRun).arg(maxRun))); emit(progressMax(100)); @@ -470,7 +462,7 @@ bool DltFileIndexer::indexFilter(QStringList filenames) qDebug() << "Create filter index: Start"; /* init fileprogress */ - int progressCounter = 1; + unsigned int progressCounter = 1; emit progress(0); // Start reading messages diff --git a/src/dltfileindexer.h b/src/dltfileindexer.h index 3ba992bf..0951bfae 100644 --- a/src/dltfileindexer.h +++ b/src/dltfileindexer.h @@ -128,7 +128,7 @@ class DltFileIndexer : public QThread // get index of all messages QVector getIndexAll() { return indexAllList; } QVector getIndexFilters() { return indexFilterList; } - QList getGetLogInfoList() { return getLogInfoList; } + const QList& getGetLogInfoList() { return getLogInfoList; } // let worker thread append to getLogInfoList void appendToGetLogInfoList(int value); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 100ee7da..f2cc36a6 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -685,8 +685,8 @@ void MainWindow::initFileHandling() ui->checkBoxSortByTimestamp->setEnabled(ui->filtersEnabled->isChecked()); ui->checkBoxSortByTimestamp->setChecked(QDltSettingsManager::getInstance()->value("startup/sortByTimestampEnabled", false).toBool()); ui->checkBoxFilterRange->setEnabled(ui->filtersEnabled->isChecked()); - ui->lineEditFilterStart->setEnabled(ui->checkBoxFilterRange->isChecked() & ui->filtersEnabled->isChecked()); - ui->lineEditFilterEnd->setEnabled(ui->checkBoxFilterRange->isChecked() & ui->filtersEnabled->isChecked()); + ui->lineEditFilterStart->setEnabled(ui->checkBoxFilterRange->isChecked() && ui->filtersEnabled->isChecked()); + ui->lineEditFilterEnd->setEnabled(ui->checkBoxFilterRange->isChecked() && ui->filtersEnabled->isChecked()); /* Process Project */ if(QDltOptManager::getInstance()->isProjectFile()) @@ -1895,7 +1895,7 @@ void MainWindow::on_action_menuFile_Clear_triggered() return; } -void MainWindow::contextLoadingFile(QDltMsg &msg) +void MainWindow::contextLoadingFile(const QDltMsg &msg) { /* analyse message, check if DLT control message response */ if ( (msg.getType()==QDltMsg::DltTypeControl) && (msg.getSubtype()==QDltMsg::DltControlResponse)) @@ -1931,7 +1931,7 @@ void MainWindow::contextLoadingFile(QDltMsg &msg) } - controlMessage_ReceiveControlMessage(ecuitemFound,msg); + controlMessage_ReceiveControlMessage(ecuitemFound, msg); } } @@ -2058,15 +2058,14 @@ void MainWindow::reloadLogFileFinishFilter() m_searchtableModel->modelChanged(); // process getLogInfoMessages - if(( dltIndexer->getMode() == DltFileIndexer::modeIndexAndFilter) && settings->updateContextLoadingFile) - { - QList list = dltIndexer->getGetLogInfoList(); - QDltMsg msg; + if ((dltIndexer->getMode() == DltFileIndexer::modeIndexAndFilter) && + settings->updateContextLoadingFile) { + const QList &msgIndexList = dltIndexer->getGetLogInfoList(); // FIXME: this is slow operation running in the main loop - for(int num=0;num Date: Fri, 22 Nov 2024 21:23:08 +0100 Subject: [PATCH 05/11] Remove redundant check We are looping over messages which satisfy this condition since they were filtered in indexer, see DltFileIndexerThread::processMessage method Signed-off-by: Viktor Kopp --- src/mainwindow.cpp | 48 +++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index f2cc36a6..d355b17c 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1897,42 +1897,38 @@ void MainWindow::on_action_menuFile_Clear_triggered() void MainWindow::contextLoadingFile(const QDltMsg &msg) { - /* analyse message, check if DLT control message response */ - if ( (msg.getType()==QDltMsg::DltTypeControl) && (msg.getSubtype()==QDltMsg::DltControlResponse)) + /* find ecu item */ + EcuItem *ecuitemFound = 0; + for(int num = 0; num < project.ecu->topLevelItemCount (); num++) { - /* find ecu item */ - EcuItem *ecuitemFound = 0; - for(int num = 0; num < project.ecu->topLevelItemCount (); num++) + EcuItem *ecuitem = (EcuItem*)project.ecu->topLevelItem(num); + if(ecuitem->id == msg.getEcuid()) { - EcuItem *ecuitem = (EcuItem*)project.ecu->topLevelItem(num); - if(ecuitem->id == msg.getEcuid()) - { - ecuitemFound = ecuitem; - break; - } + ecuitemFound = ecuitem; + break; } + } - if(!ecuitemFound) - { - /* no Ecuitem found, create a new one */ - ecuitemFound = new EcuItem(0); - - /* update ECU item */ - ecuitemFound->id = msg.getEcuid(); - ecuitemFound->update(); + if(!ecuitemFound) + { + /* no Ecuitem found, create a new one */ + ecuitemFound = new EcuItem(0); - /* add ECU to configuration */ - project.ecu->addTopLevelItem(ecuitemFound); + /* update ECU item */ + ecuitemFound->id = msg.getEcuid(); + ecuitemFound->update(); - /* Update the ECU list in control plugins */ - updatePluginsECUList(); + /* add ECU to configuration */ + project.ecu->addTopLevelItem(ecuitemFound); - pluginManager.stateChanged(project.ecu->indexOfTopLevelItem(ecuitemFound), QDltConnection::QDltConnectionOffline,ecuitemFound->getHostname()); + /* Update the ECU list in control plugins */ + updatePluginsECUList(); - } + pluginManager.stateChanged(project.ecu->indexOfTopLevelItem(ecuitemFound), QDltConnection::QDltConnectionOffline,ecuitemFound->getHostname()); - controlMessage_ReceiveControlMessage(ecuitemFound, msg); } + + controlMessage_ReceiveControlMessage(ecuitemFound, msg); } void MainWindow::reloadLogFileStop() From fccc90ab5d5f3124879d5b6b01bfe3b22bbb9202 Mon Sep 17 00:00:00 2001 From: Viktor Kopp Date: Fri, 22 Nov 2024 21:32:38 +0100 Subject: [PATCH 06/11] Prettify a bit controlMessage_ReceiveControlMessage method Signed-off-by: Viktor Kopp --- src/mainwindow.cpp | 55 ++++++++++------------------------------------ 1 file changed, 11 insertions(+), 44 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d355b17c..04e95953 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -4466,21 +4466,21 @@ void MainWindow::controlMessage_ReceiveControlMessage(EcuItem *ecuitem, const QD length = payload.size(); /* control message was received */ - uint32_t service_id=0, service_id_tmp=0; + uint32_t service_id_tmp=0; DLT_MSG_READ_VALUE(service_id_tmp,ptr,length,uint32_t); - service_id=DLT_ENDIAN_GET_32( ((msg.getEndianness()==QDltMsg::DltEndiannessBigEndian)?DLT_HTYP_MSBF:0), service_id_tmp); - - /* check if plugin autoload enabled and - * it is a version message and - version string not already parsed */ - if(service_id == DLT_SERVICE_ID_GET_SOFTWARE_VERSION && (false == autoloadPluginsVersionEcus.contains(msg.getEcuid()))) - { - versionString(msg); - autoloadPluginsVersionEcus.append(msg.getEcuid()); - } + uint32_t service_id=DLT_ENDIAN_GET_32( ((msg.getEndianness()==QDltMsg::DltEndiannessBigEndian)?DLT_HTYP_MSBF:0), service_id_tmp); switch (service_id) { + case DLT_SERVICE_ID_GET_SOFTWARE_VERSION: + { + // check if plugin autoload enabled and version string not already parsed + if(!autoloadPluginsVersionEcus.contains(msg.getEcuid())) + { + versionString(msg); + autoloadPluginsVersionEcus.append(msg.getEcuid()); + } + } case DLT_SERVICE_ID_GET_LOG_INFO: { /* Only status 1,2,6,7,8 is supported yet! */ @@ -4559,14 +4559,6 @@ void MainWindow::controlMessage_ReceiveControlMessage(EcuItem *ecuitem, const QD } } - char com_interface[DLT_ID_SIZE]; - DLT_MSG_READ_ID(com_interface,ptr,length); - - if (length<0) - { - // wxMessageBox(_("Control Message corrupted!"),_("Receive Control Message")); - } - break; } case DLT_SERVICE_ID_GET_DEFAULT_LOG_LEVEL: @@ -4603,31 +4595,6 @@ void MainWindow::controlMessage_ReceiveControlMessage(EcuItem *ecuitem, const QD } case DLT_SERVICE_ID_SET_LOG_LEVEL: { - uint8_t status=0; - DLT_MSG_READ_VALUE(status,ptr,length,uint8_t); /* No endian conversion necessary */ - - switch (status) - { - case 0: /* OK */ - { - //conitem->status = EcuItem::valid; - } - break; - case 1: /* NOT_SUPPORTED */ - { - //conitem->status = EcuItem::unknown; - } - break; - case 2: /* ERROR */ - { - //conitem->status = EcuItem::invalid; - } - break; - } - - /* update status*/ - //conitem->update(); - break; } case DLT_SERVICE_ID_TIMEZONE: From 5081dc50768e167db887aa19e2a39db6e2714475 Mon Sep 17 00:00:00 2001 From: Viktor Kopp Date: Mon, 25 Nov 2024 21:07:49 +0100 Subject: [PATCH 07/11] Introduce EcuItem::find method to accelerate search Use new EcuItem::find method where possible Signed-off-by: Viktor Kopp --- src/mainwindow.cpp | 116 ++++++++++++++++----------------------------- src/project.cpp | 9 ++++ src/project.h | 4 ++ 3 files changed, 53 insertions(+), 76 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 04e95953..802978e7 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -5499,89 +5499,56 @@ void MainWindow::on_action_menuDLT_Send_Injection_triggered() void MainWindow::controlMessage_SetApplication(EcuItem *ecuitem, QString apid, QString appdescription) { - /* Try to find App */ - for(int numapp = 0; numapp < ecuitem->childCount(); numapp++) - { - ApplicationItem * appitem = (ApplicationItem *) ecuitem->child(numapp); - - if(appitem->id == apid) - { - appitem->description = appdescription; - appitem->update(); - return; - } + if (auto appitem = ecuitem->find(apid); appitem) { + appitem->description = appdescription; + appitem->update(); + } else { + appitem = new ApplicationItem(ecuitem); + appitem->id = apid; + appitem->description = appdescription; + appitem->update(); + ecuitem->addChild(appitem); } - - /* No app and no con found */ - ApplicationItem* appitem = new ApplicationItem(ecuitem); - appitem->id = apid; - appitem->description = appdescription; - appitem->update(); - ecuitem->addChild(appitem); - } void MainWindow::controlMessage_SetContext(EcuItem *ecuitem, QString apid, QString ctid,QString ctdescription,int log_level,int trace_status) { - /* First try to find existing context */ - //qDebug() << "New CTX for" << apid << ctid << ctdescription; - - for(int numapp = 0; numapp < ecuitem->childCount(); numapp++) - { - ApplicationItem * appitem = (ApplicationItem *) ecuitem->child(numapp); + if (auto appitem = ecuitem->find(apid); appitem) { - for(int numcontext = 0; numcontext < appitem->childCount(); numcontext++) - { - ContextItem * conitem = (ContextItem *) appitem->child(numcontext); - - if(appitem->id == apid && conitem->id == ctid) - { - /* set new log level and trace status */ - conitem->loglevel = log_level; - conitem->tracestatus = trace_status; - conitem->description = ctdescription; - conitem->status = ContextItem::valid; - conitem->update(); - return; + ContextItem *conitem = nullptr; + for (int numcontext = 0; numcontext < appitem->childCount(); numcontext++) { + ContextItem *currconitem = (ContextItem *)appitem->child(numcontext); + if (currconitem->id == ctid) { + conitem = currconitem; } } - } - - /* Try to find App */ - for(int numapp = 0; numapp < ecuitem->childCount(); numapp++) - { - ApplicationItem * appitem = (ApplicationItem *) ecuitem->child(numapp); - if(appitem->id == apid) - { - /* Add new context */ - ContextItem* conitem = new ContextItem(appitem); - conitem->id = ctid; - conitem->loglevel = log_level; - conitem->tracestatus = trace_status; - conitem->description = ctdescription; - conitem->status = ContextItem::valid; - conitem->update(); + if (!conitem) { + conitem = new ContextItem(appitem); appitem->addChild(conitem); - - return; } + conitem->id = ctid; + conitem->loglevel = log_level; + conitem->tracestatus = trace_status; + conitem->description = ctdescription; + conitem->status = ContextItem::valid; + conitem->update(); + } else { + appitem = new ApplicationItem(ecuitem); + appitem->id = apid; + appitem->description = ""; + appitem->update(); + ecuitem->addChild(appitem); + + ContextItem* conitem = new ContextItem(appitem); + conitem->id = ctid; + conitem->loglevel = log_level; + conitem->tracestatus = trace_status; + conitem->description = ctdescription; + conitem->status = ContextItem::valid; + conitem->update(); + appitem->addChild(conitem); } - - /* No app and no con found */ - ApplicationItem* appitem = new ApplicationItem(ecuitem); - appitem->id = apid; - appitem->description = QString(""); - appitem->update(); - ecuitem->addChild(appitem); - ContextItem* conitem = new ContextItem(appitem); - conitem->id = ctid; - conitem->loglevel = log_level; - conitem->tracestatus = trace_status; - conitem->description = ctdescription; - conitem->status = ContextItem::valid; - conitem->update(); - appitem->addChild(conitem); } void MainWindow::controlMessage_Timezone(int timezone, unsigned char dst) @@ -5614,15 +5581,12 @@ void MainWindow::controlMessage_UnregisterContext(QString ecuId,QString appId,QS return; /* First try to find existing context */ - for(int numapp = 0; numapp < ecuitemFound->childCount(); numapp++) + if(auto appitem = ecuitemFound->find(appId); appitem) { - ApplicationItem * appitem = (ApplicationItem *) ecuitemFound->child(numapp); - for(int numcontext = 0; numcontext < appitem->childCount(); numcontext++) { ContextItem * conitem = (ContextItem *) appitem->child(numcontext); - - if(appitem->id == appId && conitem->id == ctId) + if(conitem->id == ctId) { /* remove context */ delete conitem->parent()->takeChild(conitem->parent()->indexOfChild(conitem)); diff --git a/src/project.cpp b/src/project.cpp index cc4f2e98..38c37443 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -250,6 +250,15 @@ void EcuItem::updateAutoReconnectTimestamp() //qDebug() << "updateAutoReconnectTimestamp" << autoReconnectTimestamp; } +ApplicationItem *EcuItem::find(const QString &apid) const { + for (int numapp = 0; numapp < childCount(); numapp++) { + ApplicationItem *appitem = static_cast(child(numapp)); + if (appitem->id == apid) + return appitem; + } + return nullptr; +} + ApplicationItem::ApplicationItem(QTreeWidgetItem *parent) : QTreeWidgetItem(parent,application_type) { diff --git a/src/project.h b/src/project.h index 46842089..0c0b6dea 100644 --- a/src/project.h +++ b/src/project.h @@ -42,6 +42,8 @@ enum dlt_item_type { ecu_type = QTreeWidgetItem::UserType, application_type, context_type, filter_type, plugin_type }; +class ApplicationItem; + class EcuItem : public QTreeWidgetItem { public: @@ -99,6 +101,8 @@ class EcuItem : public QTreeWidgetItem bool isAutoReconnectTimeoutPassed(); void updateAutoReconnectTimestamp(); + ApplicationItem* find(const QString& apid) const; + private: QDateTime autoReconnectTimestamp; bool operator< ( const QTreeWidgetItem & other ) const; From fa46493f3d3e539e10643a3259646aef154a50d6 Mon Sep 17 00:00:00 2001 From: Alexander Wenzel Date: Thu, 5 Dec 2024 14:08:54 +0100 Subject: [PATCH 08/11] Prepare v2.27.0 release (#598) Signed-off-by: Alexander Wenzel --- INSTALL.md | 2 +- README.md | 116 +++++++++++++++++++------ ReleaseNotes_Viewer.txt | 183 +++++++++++++++++++++++++++++++++++++++- src/version.h | 4 +- 4 files changed, 275 insertions(+), 30 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 7d357d70..ba8bd19e 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -5,7 +5,7 @@ Alexander Wenzel ## Instructions for installing DLT Viewer (GUI) * Install Qt5 SDK and Qt6 SDK including Qt Creator and Microsoft Visual Studio Build Tools 2019 -* Tested with QT 5.15.2 (Windows), QT 6.7.2 (Windows), and Qt 5.12.8 (Ubuntu 20.04LTS Linux) +* Tested with QT 5.15.2 (Windows), QT 6.7.3 (Windows), and Qt 5.15.13 (Ubuntu 24.04LTS Linux) * Open project BuildDltViewer.pro in Qt Creator. * Ensure that build options point to correct QT and MSVC. * Build Release in Qt Creator or via CMake (see last). diff --git a/README.md b/README.md index e3eb9500..df43da9f 100644 --- a/README.md +++ b/README.md @@ -11,28 +11,96 @@ The Diagnostic Log and Trace Viewer is an application that can send and receive + DLT Release Notes: ReleaseNotes.txt + DLT Installation: INSTALL.md -### Command line usage; - -+ Windows: `dlt-viewer.exe [OPTIONS] [logfile] [projectfile] [filterfile]` -+ Linux: `dlt-viewer [OPTIONS] [logfile] [projectfile] [filterfile]` -+ MacOS: `open -a $DLT_BUILD_DIR/bin/DLT\ Viewer.app --args [OPTIONS] [logfile] [projectfile] [filterfile]` - -Options: -+ [logfile] Loading one or more logfiles on startup (must end with .dlt) -+ [projectfile] Loading project file on startup (must end with .dlp) -+ [filterfile] Loading filterfile on startup (must end with .dlf) -+ `-h` Print usage -+ `-c textfile` Convert logfile file to textfile -+ `-u` Conversion will be done in UTF8 instead of ASCII; -+ `-csv` Conversion will be done in CSV format; -+ `-d` Conversion will NOT be done, save in dlt file format again instead -+ `-dd` Conversion will NOT be done, save as decoded messages in dlt format -+ `-b "name of plugin|command in plugin|param1|..|param"` Execute a plugin command with parameters before loading log file -+ `-e "name of plugin|command in plugin|param1|..|param"` Execute a plugin command with parameters after loading log file -+ `-s or --silent` Enable silent mode without warning message boxes -+ `-t or --terminate` Terminate DLT Viewer after command line execution -+ `-v or --version` Only show version and buildtime information -+ `-w workingdirectory` Set the working directory +### Command line usage DLT Viewer: + ++ Windows: `dlt-viewer.exe [OPTIONS] [logfile] [projectfile] [filterfile] [pcapfile] [mf4file]` ++ Linux: `dlt-viewer [OPTIONS] [logfile] [projectfile] [filterfile] [pcapfile] [mf4file]` ++ MacOS: `open -a $DLT_BUILD_DIR/bin/DLT\ Viewer.app --args [OPTIONS] [logfile] [projectfile] [filterfile] [pcapfile] [mf4file]` + +Options: + -c Convert logfile file to + -u Conversion will be done in UTF8 + instead of ASCII + --csv Conversion will be done in CSV format + -d Conversion will NOT be done, save in + dlt file format again instead + --dd Conversion will NOT be done, save as + decoded messages in dlt format + -b > Execute a plugin command with + parameters before loading log file. + -e > Execute a plugin command with + parameters after loading log file. + -s, --silent Enable silent mode without any GUI. + Ideal for commandline usage. + --stream Treat the input logfiles as DLT + stream instead of DLT files. + -t, --terminate Terminate DLT Viewer after command + line execution. + -w Set the working directory + --delimiter The used delimiter for CSV export + (Default: ,). + -h, --help Print this help message. + -v, --version Print the version. + +Arguments: + logfile Loading one or more logfiles on + startup (must end with .dlt) + projectfile Loading project file on startup (must + end with .dlp) + filterfile Loading filterfile on startup (must + end with .dlf) + pcapfile Importing DLT/IPC from pcap file on + startup (must end with .pcap) + mf4file Importing DLT/IPC from mf4 file on + startup (must end with .mf4) + + +Examples: + dlt-viewer.exe -t -c output.txt input.dlt + dlt-viewer.exe -t -s -u -c output.txt input.dlt + dlt-viewer.exe -t -s -d -c output.dlt input.dlt + dlt-viewer.exe -t -s decoded.dlp -dd -c output.dlt input.dlt + dlt-viewer.exe -t -s -csv -c output.csv input.dlt + dlt-viewer.exe -t -s -d filter.dlf -c output.dlt input.dlt + dlt-viewer.exe -p export.dlp -e "Filetransfer Plugin|export|ftransferdir" input.dlt + dlt-viewer.exe input1.dlt input2.dlt + dlt-viewer.exe -t -c output.txt input.pcap + dlt-viewer.exe -t -c output.txt input1.mf4 input2.mf4 + +### Command line usage DLT Commander: + +Usage: + + dlt-commander [OPTIONS] [logfile] [projectfile] [filterfile] [mf4file] [pcapfile] + +Options: + + [logfile] Loading one or more logfiles on startup (must end with .dlt) + [filterfile] Loading filterfile on startup (must end with .dlf) + [pcapfile] Importing DLT/IPC from pcap file on startup (must end with .pcap) + [mf4file] Importing DLT/IPC from mf4 file on startup (must end with .mf4) + -h Print usage + -v or --version Only show version and buildtime information + -c textfile Convert logfile file to textfile (logfile must end with .dlt) + -u Conversion will be done in UTF8 instead of ASCII + -csv Conversion will be done in CSV format + -d Conversion will NOT be done, save in dlt file format again instead + -delimiter The used delimiter for CSV export (Default: ,). + -multifilter Multifilter will generate a separate export file with the name of the filter. + -c will define the folder name, not the filename. + +Examples: + + dlt-commander -c .\trace.txt c:\trace\trace.dlt + dlt-commander -c -u .\trace.txt c:\trace\trace.dlt + dlt-commander -d -c .\trace.dlt c:\trace\trace.dlt + dlt-commander -csv -c .\trace.csv c:\trace\trace.dlt + dlt-commander -d -c .\filteredtrace.dlt c:\filter\filter.dlf c:\trace\trace.dlt + dlt-commander trace_1.dlt trace_2.dlt + dlt-commander input.pcap output.dlt + dlt-commander -c output.txt input.pcap + dlt-commander -c output.txt input1.mf4 input2.mf4 + ## API Documentation @@ -42,8 +110,8 @@ See INSTALL.txt regarding doxygen API documentation generation. Developed with QT5 and Qt6 (http://qt-project.org/) Tested with Windows 11 + Qt 5.15.2 + Microsoft Visual Studio Build Tools 2019 -Tested with Windows 11 + Qt 6.7.1 + Microsoft Visual Studio Build Tools 2019 -Tested with Ubuntu Linux 18.04 + Qt 5.9.5 +Tested with Windows 11 + Qt 6.7.3 + Microsoft Visual Studio Build Tools 2019 +Tested with Ubuntu Linux 24.04 + Qt 5.15.13 Tested with macOS Catalina + Qt 5.15.13 Dynamically linked open source software diff --git a/ReleaseNotes_Viewer.txt b/ReleaseNotes_Viewer.txt index d8b17200..d7a74ea2 100644 --- a/ReleaseNotes_Viewer.txt +++ b/ReleaseNotes_Viewer.txt @@ -5,18 +5,195 @@ Gernot Wirschal Version ------- -Version 2.26.0 RELEASE - +Version 2.27.0 RELEASE Known issues ------------ * none - Changes ------- +2.27.0 + +* Fix MF4 import with only one datablock. (#596) +* Build app for ubuntu 22 and 24 + Rename Linux build +* Rename Linux build +* Fix multifilter export filepath +* Multifilter export feature for dlt-commander (-multifilter) (#591) +* DLT Commander remove creation of Filter index when exporting to speed up. (#590) +* Remove extra thread for filter index to improve performance. (#589) +* Updated Info.plist.in + Added minimum macOS version and category of application +* Updated icon to meet Apple signing requirements +* Improve speed MF4 import. (#585) +* Background thread for export. (#584) +* Background thread for import. (#582) +* Progress output in dlt-commander. (#581) +* Remove unused mcudpsocket class (#579) +* rm unused mcudpsocket +* add clang-format settings file + No enforcement, just as a tool and reference for + those who want to have convenient and consistent way + to format their code. +* Fix wheel scrolling of the main tableview (#580) +* LRU for main table model (#575) +* Add generic lrucache structure +* Use LRU cache +* Handle color of corrupted messages +* Change table view font on Ctrl + Wheel combination (#578) +* Fix for command line parser issue with multiple arguments with same type. (#574) +* Reapply "Use QCommandLineParser instead of custom cmd args parsing (#543)" (#566) +* Simplify handling of logging only mode in log table view (#569) +* Improve progress output. (#571) + Fix add multiple filter to dlt commander. + Enable filter when providing a filter file by the commandline. +* Remove CtxId check from Filetransfer Plugin. (#570) +* Add dlf file extension when saving filter (#567) +* Windows update Script to use Qt 6.7.3. (#568) + Windows Multicore build for qmake. +* Add QDltOptmanager unit tests and minor cleanup (#564) +* Add unit tests for qdltoptmanager +* Avoid double work when adding cmd argument + Reuse help text in main window +* Avoid duplicate text on --version call +* Remove redundant code in QDltOptmanager singleton +* Avoid -Wempty-body compiler warnings +* Fix and Improve RegEx Replace feature. (#565) + RegEx Replace will only be executed when filter matches. + Re enable RegEx Replace for DLT Export, no influence on non verbose messages anymore. +* Linux build only with cmake in CI +* Rename qmake build file for Windows +* Rename build file for Darwin +* Revert/Remove Regex Replace feature for DLT Export. (#556) + This causes currently issues with non verbose messages. +* Fix setting filter index range start and stop when filter are active. (#555) +* Revert "Use QCommandLineParser instead of custom cmd args parsing (#543)" +* Enable Filter Regex Replacement also for exporting into DLT format. (#554) +* Use QCommandLineParser instead of custom cmd args parsing (#543) + - avoid code duplication by reusing help text in main window + - add tests + Add QDltOptManager::reset method to have possibility + to test the singleton +* Improve speed of MF4 and PCAP import. (#553) + Enable MF4 import of multiple data frames. +* Additional port 3489 for DLT MF4 Import. (#552) +* Reorder label in MacOS release job +* Include MacOS artifacts to release action +* MacOS release with codesign and notarization +* Fix MAcOS release artifacts +* Change regex replace func from std to qt internal. (#546) + CAUTION: Replacement placeholder changes from %1 to \1 . +* Extend regex replace filter operation to all functionalities. (#545) +* Fix qmake build (#544) +* Run unit tests for Linux on CI (#538) +* Build unit tests on CI +* Run tests upon Linux build on CI +* Accelerate linux build +* Enable Debian build for noble. (#542) +* Skip notarization on a fork + https://github.com/orgs/community/discussions/25217#discussioncomment-3246904 +* Removed creating tar from build + removed tar command from build as after notarization, binaries are tar'ed +* Download on release MacOS x86 and arm64 artifacts separately + Notarization (copy) +* Format yaml file +* Notarization + Adding signing of macOS apps + Notarization + Syntax fixed +* Make code backward compatible with Qt 5.12 (#531) + Names of the signals changed between Qt 5.12 and 5.15, + while we still need to maintain compatibility with 5.12 +* Keep console logging if app is launched from cmd (#528) +* Increase precision of float ouput to 8 digits (#530) +* Bump action +* Abi in MacOS artifacts +* Replace search progress dialog with an in-place progress bar (#509) +* replace progress dialog with built-in progress bar +* Adjust search input margins +* Remove dead code related to payload range search functionality (#525) +* remove functionality of payload search range + It was broken for long time and most probably + unused +* Adjust layout of search dialog + Compensate gap due to removed payload-range + input fields +* fix signal for socket error (#519) + The QAbstractSocket::error signal existed in Qt<5.15, but was renamed to + QAbstractSocket::errorOccured probably to avoid + https://stackoverflow.com/a/48250710 + Since the codebase still uses the old style of connections + the compiler could not detect that signal does not exist anymore + and error was reported only on runtime: + "qt.core.qobject.connect: QObject::connect: + No such signal QTcpSocket::error(QAbstractSocket::SocketError)" +* Testable search (#505) +* Make tempPayload a local var +* establish tools lib and tests infra +* rm redundant SearchDialog::is_TimeStampRangeValid state var + If timestamp range search is selected + the loop will only continue if range is valid. It does not make sense + to check in functions below if range is valid since otherwise + that code cannot be even reached +* implement matching for ctx and app Ids +* use ctxid and appid match functionality in app +* TimestampRange +* use new timestamp filtering +* text search using dltmessagematcher +* fix build + move matcher to qdlt lib + enable c++17 in qmake config + The new code uses variant and optional + added in c++17 standard while qmake config was + setup restricted to c++11 + enable tests only if gtest package found + Set c++17 standard in cmake + export class for windows linker +* change parent of actions in config context menu (#522) + MainWindow was set as a parent of the context menu actions + as a result all actions ever created (upon each ctx menu open) + in one program session remained on heap until program is closed. + Assigning local menu variable as a parent deallocates actions + when menu is closed +* Mac app store (#521) +* Update README.md +* Update INSTALL.md +* Fix MF4 Import. (#518) +* install qoffscreen plugin on windows (#510) +* New command line option delimiter for CSV export. (#515) + Set dlt-commander export timezone to default. +* Revert Rename of dlt_common. (#512) + Enable plugins if disabled when pre command called. +* Rename dlt_common.c into dlt_common.cpp. (#506) + This makes sure c++ compiler is used and not plain c, failing with some error. + macOS Catalina +* Update INSTALL.md +* Update README.md +* Update build.sh +* Fix more compilation warnings (#499) +* fix warning in PluginTreeWidget + due to comaprison of ints with different signedness +* fix warnings in DltImporter::dltIpcFromMF4 + comparison of integer expressions of different signedness +* fix warnings in QDltMsg::checkMsgSize + comparison of integer expressions of different signedness +* fix warnings in SettingsDialog::writeDlg + using integer constants in boolean context +* fix warning in QDltPluginManager::setPluginPriority + + additional minor fixes +* rm unused QDltPluginManager::sizeEnabled +* replace deprecated constructor of QMessageBox +* fix cast warnings in QDltArgument +* DLT Commander Tool (#500) +* Move Export, Import and Fieldname classes to qdlt. +* Current limitation that progress bar is not updated. +* First DLT Commander tool. +* Command line only tool for environments without Qt GUI. +* Finish first commander version. + 2.26.0 * Remove all zeros in every output of payload. diff --git a/src/version.h b/src/version.h index f3e70037..1cf2eb20 100644 --- a/src/version.h +++ b/src/version.h @@ -23,12 +23,12 @@ /* changing minor & major when layout of settings file config.ini changes */ /* this kind of change is tracked in the settings dialogr */ /* for other bugfixes and not major feature enhancement just use patch level */ -#define PACKAGE_VERSION_STATE "unstable" +#define PACKAGE_VERSION_STATE "stable" #define PACKAGE_MAJOR_VERSION 2 #define PACKAGE_MINOR_VERSION 27 #define PACKAGE_PATCH_LEVEL 0 #define PACKAGE_VERSION "2.27.0" -#define PACKAGE_REVISION "unstable" +#define PACKAGE_REVISION "stable" #define PACKAGE_DESCRIPTION "DLT Viewer" #define DLT_SUPPORT_MAIL_ADDRESS "" #define DLT_SUPPORT_NAME "COVESA" From 1ec208b17423ebaba1526da8d75c81b660ce16ea Mon Sep 17 00:00:00 2001 From: Alexander Wenzel Date: Mon, 9 Dec 2024 16:42:32 +0100 Subject: [PATCH 09/11] Set filter range end automatically to end of file. (#600) Signed-off-by: Alexander Wenzel --- src/mainwindow.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 100ee7da..59c11e91 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1315,8 +1315,8 @@ bool MainWindow::openDltFile(QStringList fileNames) // clear index filter ui->checkBoxFilterRange->setChecked(false); - ui->lineEditFilterStart->setText(QString("0")); - ui->lineEditFilterEnd->setText(QString("0")); + //ui->lineEditFilterStart->setText(QString("0")); + //ui->lineEditFilterEnd->setText(QString("%1").arg(qfile.size())); if (ret) emit dltFileLoaded(fileNames); @@ -2022,6 +2022,12 @@ void MainWindow::reloadLogFileFinishIndex() statusProgressBar->reset(); statusProgressBar->hide(); } + + ui->lineEditFilterStart->setText(QString("0")); + if(qfile.size()>0) + ui->lineEditFilterEnd->setText(QString("%1").arg(qfile.size()-1)); + else + ui->lineEditFilterEnd->setText(QString("0")); } void MainWindow::reloadLogFileFinishFilter() From eebd79ef72f23d5e6f5db95f0b08ee08ca120881 Mon Sep 17 00:00:00 2001 From: Alexander Wenzel Date: Wed, 11 Dec 2024 13:46:42 +0100 Subject: [PATCH 10/11] Prepare next unstable 2.28.0. Signed-off-by: Alexander Wenzel --- src/version.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/version.h b/src/version.h index 1cf2eb20..56608426 100644 --- a/src/version.h +++ b/src/version.h @@ -23,12 +23,12 @@ /* changing minor & major when layout of settings file config.ini changes */ /* this kind of change is tracked in the settings dialogr */ /* for other bugfixes and not major feature enhancement just use patch level */ -#define PACKAGE_VERSION_STATE "stable" +#define PACKAGE_VERSION_STATE "unstable" #define PACKAGE_MAJOR_VERSION 2 -#define PACKAGE_MINOR_VERSION 27 +#define PACKAGE_MINOR_VERSION 28 #define PACKAGE_PATCH_LEVEL 0 -#define PACKAGE_VERSION "2.27.0" -#define PACKAGE_REVISION "stable" +#define PACKAGE_VERSION "2.28.0" +#define PACKAGE_REVISION "unstable" #define PACKAGE_DESCRIPTION "DLT Viewer" #define DLT_SUPPORT_MAIL_ADDRESS "" #define DLT_SUPPORT_NAME "COVESA" From 2981aa693f69d27a61845a91d1df93be4fc41a81 Mon Sep 17 00:00:00 2001 From: Alexander Wenzel Date: Wed, 11 Dec 2024 16:07:02 +0100 Subject: [PATCH 11/11] Remove qmake windows build scripts. Signed-off-by: Alexander Wenzel --- ...sdk_windows_qt5_MSVC_interactive_qmake.bat | 4 - build_sdk_windows_qt5_MSVC_qmake.bat | 270 ------------------ 2 files changed, 274 deletions(-) delete mode 100644 build_sdk_windows_qt5_MSVC_interactive_qmake.bat delete mode 100644 build_sdk_windows_qt5_MSVC_qmake.bat diff --git a/build_sdk_windows_qt5_MSVC_interactive_qmake.bat b/build_sdk_windows_qt5_MSVC_interactive_qmake.bat deleted file mode 100644 index 7955d535..00000000 --- a/build_sdk_windows_qt5_MSVC_interactive_qmake.bat +++ /dev/null @@ -1,4 +0,0 @@ -call build_sdk_windows_qt5_MSVC_qmake.bat -SET RETCODE=%ERRORLEVEL% -set /p name= Continue -exit /b %RETCODE% \ No newline at end of file diff --git a/build_sdk_windows_qt5_MSVC_qmake.bat b/build_sdk_windows_qt5_MSVC_qmake.bat deleted file mode 100644 index 97fe5e29..00000000 --- a/build_sdk_windows_qt5_MSVC_qmake.bat +++ /dev/null @@ -1,270 +0,0 @@ -@echo off - -REM Date Version Author Changes -REM 4.7.19 1.0 Alexander Wenzel Update to Qt 5.12.4 and Visual Studio 2015 -REM 25.11.20 1.1 Alexander Wenzel Update to Qt 5.12.10 -REM 11.1.21 1.2 Alexander Wenzel Update to Qt 5.12.12, Visual Studio 2017 Build Tools and simplify - -echo ************************************ -echo *** DLT Viewer SDK *** -echo ************************************ - -call build_config.bat - -if '%WORKSPACE%'=='' ( - if '%DLT_VIEWER_SDK_DIR%'=='' ( - set DLT_VIEWER_SDK_DIR=c:\DltViewerSDKQt%QTNO% - ) - - set SOURCE_DIR=%CD% - set BUILD_DIR=%CD%\build\release -) else ( - if '%DLT_VIEWER_SDK_DIR%'=='' ( - set DLT_VIEWER_SDK_DIR=%WORKSPACE%\build\dist\DltViewerSDKQt%QTNO% - ) - - set SOURCE_DIR=%WORKSPACE% - set BUILD_DIR=%WORKSPACE%\build\release -) - -echo ************************************ -echo * QTDIR = %QTDIR% -echo * MSVC_DIR = %MSVC_DIR% -echo * PATH = %PATH% -echo * DLT_VIEWER_SDK_DIR = %DLT_VIEWER_SDK_DIR% -echo * SOURCE_DIR = %SOURCE_DIR% -echo * BUILD_DIR = %BUILD_DIR% -echo ************************************ - -if exist build ( -echo ************************************ -echo *** Delete old build Directory *** -echo ************************************ - - rmdir /s /q build || rem - if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -) - -echo ************************************ -echo *** Configure MSVC environment *** -echo ************************************ - -call vcvarsall.bat x86_amd64 -if %ERRORLEVEL% NEQ 0 goto ERROR_HANDLER -echo configuring was successful - -if exist %DLT_VIEWER_SDK_DIR% ( -echo ************************************ -echo *** Delete old SDK Directory *** -echo ************************************ - - rmdir /s /q %DLT_VIEWER_SDK_DIR% || rem - if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER -) - -echo ************************************ -echo *** Build DLT Viewer *** -echo ************************************ - -mkdir build -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -cd build -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -qmake ../BuildDltViewer.pro -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -set CL=/MP -nmake -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -echo ************************************ -echo *** Create SDK *** -echo ************************************ - -if not exist %DLT_VIEWER_SDK_DIR% mkdir %DLT_VIEWER_SDK_DIR% -echo *** Create directories %DLT_VIEWER_SDK_DIR% *** -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -mkdir %DLT_VIEWER_SDK_DIR%\plugins -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -mkdir %DLT_VIEWER_SDK_DIR%\plugins\examples -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -mkdir %DLT_VIEWER_SDK_DIR%\sdk -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -mkdir %DLT_VIEWER_SDK_DIR%\sdk\include -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -mkdir %DLT_VIEWER_SDK_DIR%\sdk\lib -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -mkdir %DLT_VIEWER_SDK_DIR%\sdk\src -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -mkdir %DLT_VIEWER_SDK_DIR%\sdk\src\dummydecoderplugin -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -mkdir %DLT_VIEWER_SDK_DIR%\sdk\src\dummyviewerplugin -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -mkdir %DLT_VIEWER_SDK_DIR%\sdk\src\dummycontrolplugin -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -mkdir %DLT_VIEWER_SDK_DIR%\filters -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -mkdir %DLT_VIEWER_SDK_DIR%\platforms -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -mkdir %DLT_VIEWER_SDK_DIR%\styles -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -mkdir %DLT_VIEWER_SDK_DIR%\doc -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -mkdir %DLT_VIEWER_SDK_DIR%\cache -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -echo *** Copy files *** -copy %QTDIR%\bin\Qt?Core.dll %DLT_VIEWER_SDK_DIR% -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %QTDIR%\bin\Qt?Gui.dll %DLT_VIEWER_SDK_DIR% -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %QTDIR%\bin\Qt?Network.dll %DLT_VIEWER_SDK_DIR% -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %QTDIR%\bin\Qt?Sql.dll %DLT_VIEWER_SDK_DIR% -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %QTDIR%\bin\Qt?Svg.dll %DLT_VIEWER_SDK_DIR% -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %QTDIR%\bin\Qt?Widgets.dll %DLT_VIEWER_SDK_DIR% -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %QTDIR%\bin\Qt?PrintSupport.dll %DLT_VIEWER_SDK_DIR% -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %QTDIR%\bin\Qt?Xml.dll %DLT_VIEWER_SDK_DIR% -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %QTDIR%\bin\Qt?OpenGL.dll %DLT_VIEWER_SDK_DIR% -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %QTDIR%\bin\Qt?SerialPort.dll %DLT_VIEWER_SDK_DIR% -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %QTDIR%\plugins\platforms\qwindows.dll %DLT_VIEWER_SDK_DIR%\platforms -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %QTDIR%\plugins\platforms\qoffscreen.dll %DLT_VIEWER_SDK_DIR%\platforms -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -if "%QTNO%"=="5" ( - copy %QTDIR%\plugins\styles\qwindowsvistastyle.dll %DLT_VIEWER_SDK_DIR%\styles - if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER -) -if "%QTNO%"=="6" ( - copy %QTDIR%\plugins\styles\qmodernwindowsstyle.dll %DLT_VIEWER_SDK_DIR%\styles - if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER -) - -copy %BUILD_DIR%\dlt-viewer.exe %DLT_VIEWER_SDK_DIR% -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %BUILD_DIR%\dlt-commander.exe %DLT_VIEWER_SDK_DIR% -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %BUILD_DIR%\qdlt.dll %DLT_VIEWER_SDK_DIR% -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %BUILD_DIR%\plugins\dltviewerplugin.dll %DLT_VIEWER_SDK_DIR%\plugins -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %BUILD_DIR%\plugins\nonverboseplugin.dll %DLT_VIEWER_SDK_DIR%\plugins -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %BUILD_DIR%\plugins\filetransferplugin.dll %DLT_VIEWER_SDK_DIR%\plugins -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %BUILD_DIR%\plugins\dltsystemviewerplugin.dll %DLT_VIEWER_SDK_DIR%\plugins -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %BUILD_DIR%\plugins\dltdbusplugin.dll %DLT_VIEWER_SDK_DIR%\plugins -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %BUILD_DIR%\plugins\dltlogstorageplugin.dll %DLT_VIEWER_SDK_DIR%\plugins -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %BUILD_DIR%\plugins\dlttestrobotplugin.dll %DLT_VIEWER_SDK_DIR%\plugins -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %SOURCE_DIR%\doc\*.txt %DLT_VIEWER_SDK_DIR%\doc - -copy %SOURCE_DIR%\ReleaseNotes_Viewer.txt %DLT_VIEWER_SDK_DIR% - -copy %SOURCE_DIR%\README.md %DLT_VIEWER_SDK_DIR% -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %SOURCE_DIR%\LICENSE.txt %DLT_VIEWER_SDK_DIR% -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %SOURCE_DIR%\MPL.txt %DLT_VIEWER_SDK_DIR% -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %SOURCE_DIR%\qdlt\*.h %DLT_VIEWER_SDK_DIR%\sdk\include -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %BUILD_DIR%\qdlt.dll %DLT_VIEWER_SDK_DIR%\sdk\lib -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %BUILD_DIR%\qdlt.lib %DLT_VIEWER_SDK_DIR%\sdk\lib -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %SOURCE_DIR%\plugin\dummyviewerplugin %DLT_VIEWER_SDK_DIR%\sdk\src\dummyviewerplugin - -copy %SOURCE_DIR%\plugin\dummydecoderplugin %DLT_VIEWER_SDK_DIR%\sdk\src\dummydecoderplugin - -copy %SOURCE_DIR%\plugin\dummycontrolplugin %DLT_VIEWER_SDK_DIR%\sdk\src\dummycontrolplugin - -copy %SOURCE_DIR%\sdk\BuildPlugins.pro %DLT_VIEWER_SDK_DIR%\sdk\src - -copy %SOURCE_DIR%\sdk\dummydecoderplugin.pro %DLT_VIEWER_SDK_DIR%\sdk\src\dummydecoderplugin - -copy %SOURCE_DIR%\sdk\dummyviewerplugin.pro %DLT_VIEWER_SDK_DIR%\sdk\src\dummyviewerplugin -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %SOURCE_DIR%\sdk\dummycontrolplugin.pro %DLT_VIEWER_SDK_DIR%\sdk\src\dummycontrolplugin -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %SOURCE_DIR%\plugin\examples\nonverboseplugin_configuration.xml %DLT_VIEWER_SDK_DIR%\plugins\examples -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %SOURCE_DIR%\plugin\examples\filetransferplugin_configuration.xml %DLT_VIEWER_SDK_DIR%\plugins\examples -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -copy %SOURCE_DIR%\filters\* %DLT_VIEWER_SDK_DIR%\filters -if %ERRORLEVEL% NEQ 0 GOTO ERROR_HANDLER - -GOTO QUIT - -:ERROR_HANDLER -echo #################################### -echo ### ERROR occured ### -echo #################################### -exit /b 1 - - -:QUIT -echo ************************************ -echo *** SUCCESS finish *** -echo ************************************ -echo SDK installed in: %DLT_VIEWER_SDK_DIR% -exit /b 0