Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
53e2689
DltCounter plugin added to find the missing counter messages
Renu-Priya411 Mar 18, 2025
a547947
Changes in mainwindow, qdltcontrol and dltCounter plugin
Renu-Priya411 Mar 27, 2025
51ff0b6
Dlt Counter Plugin : Used for finding the missing sequence of message…
Renu-Priya411 Jun 2, 2025
a766e56
DltCounter plugin added to find the missing counter messages
Renu-Priya411 Mar 18, 2025
d12e173
Changes in mainwindow, qdltcontrol and dltCounter plugin
Renu-Priya411 Mar 27, 2025
1b5cc92
Dlt Counter Plugin : Used for finding the missing sequence of message…
Renu-Priya411 Jun 2, 2025
b032d5f
Changes in dltcounterplugin.cpp
Renu-Priya411 Jul 1, 2025
bdfeb35
Conflicts Resolved
Renu-Priya411 Jul 9, 2025
716f09c
Conflicts Resolved
Renu-Priya411 Jul 9, 2025
545fcc7
Spacing Issue Resolved in mainwindow.h
Renu-Priya411 Jul 9, 2025
4695188
Update form.cpp
alexmucde Jul 10, 2025
c1b30f6
Merge branch 'COVESA:master' into Feature-HighLightAndJumpToMissingMe…
Renu-Priya411 Jul 31, 2025
0eebe0c
Merge branch 'COVESA:master' into Feature-HighLightAndJumpToMissingMe…
Renu-Priya411 Jul 31, 2025
ef4af07
Merge branch 'COVESA:master' into Feature-HighLightAndJumpToMissingMe…
Renu-Priya411 Aug 1, 2025
198615c
Merge branch 'COVESA:master' into Feature-HighLightAndJumpToMissingMe…
Renu-Priya411 Aug 4, 2025
56c1acb
Changes in DLTCounterPlugin.cpp
Renu-Priya411 Aug 4, 2025
1154ce7
Merge branch 'COVESA:master' into Feature-HighLightAndJumpToMissingMe…
Renu-Priya411 Aug 5, 2025
5c51ac8
Merge branch 'COVESA:master' into Feature-HighLightAndJumpToMissingMe…
Renu-Priya411 Aug 8, 2025
c3f5997
Merge branch 'COVESA:master' into Feature-HighLightAndJumpToMissingMe…
Renu-Priya411 Aug 22, 2025
8607916
Merge branch 'master' into Feature-HighLightAndJumpToMissingMessages
Renu-Priya411 Sep 25, 2025
5fc9256
Merge branch 'COVESA:master' into Feature-HighLightAndJumpToMissingMe…
Renu-Priya411 Oct 27, 2025
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
2 changes: 2 additions & 0 deletions plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ add_subdirectory(dltviewerplugin)
add_subdirectory(filetransferplugin)
add_subdirectory(nonverboseplugin)
add_subdirectory(dltsegmentationplugin)
add_subdirectory(dltcounterplugin)

option(DLT_DUMMY_PLUGINS "Build Dummy plugins" OFF)
if(DLT_DUMMY_PLUGINS)
add_subdirectory(dummycontrolplugin)
add_subdirectory(dummyviewerplugin)
add_subdirectory(dummycommandplugin)
add_subdirectory(dummydecoderplugin)
add_subdirectory(dltcounterplugin)
endif()
22 changes: 22 additions & 0 deletions plugin/dltcounterplugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Copyright (C) 2016, Jack S. Smith
#
# This file is part of COVESA DLT-Viewer project.
#
# This Source Code Form is subject to the terms of the
# Mozilla Public License (MPL), v. 2.0.
# If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# For further information see http://www.covesa.global/.
#
# List of changes:
# 01.Oct.2016, Jack Smith <jack.smith@elektrobit.com>, Original Author
#

add_library(dltcounterplugin MODULE dltcounterplugin.cpp
form.cpp)

target_link_libraries(dltcounterplugin qdlt ${QT_PREFIX}::Widgets )

add_plugin(dltcounterplugin)
271 changes: 271 additions & 0 deletions plugin/dltcounterplugin/dltcounterplugin.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,271 @@
/**
* @licence app begin@
* Copyright (C) 2011-2012 BMW AG
*
* This file is part of COVESA Project Dlt Viewer.
*
* Contributions are licensed to the COVESA Alliance under one or more
* Contribution License Agreements.
*
* \copyright
* This Source Code Form is subject to the terms of the
* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* \file dummycontrolplugin.cpp
* For further information see http://www.covesa.global/.
* @licence end@
*/

#include <QtGui>
#include <QTextStream>
#include <QTableView>
#include <QAbstractItemModel>
#include <QMessageBox>

#include "dltcounterplugin.h"

DltCounterPlugin::DltCounterPlugin()
{
form = NULL;
counterMessages = 0;
counterNonVerboseMessages = 0;
counterVerboseMessages = 0;
dltFile = 0;
dltControl = 0;
ecuList = 0;

loadingCompleteTimer = new QTimer(this);
loadingCompleteTimer->setSingleShot(true);
connect(loadingCompleteTimer, &QTimer::timeout, this, &DltCounterPlugin::dataConsolidatedMap);
}

DltCounterPlugin::~DltCounterPlugin()
{

}

QString DltCounterPlugin::name()
{
return QString("DLT Counter Plugin");
}

QString DltCounterPlugin::pluginVersion(){
return DLT_COUNTER_PLUGIN_VERSION;
}

QString DltCounterPlugin::pluginInterfaceVersion(){
return PLUGIN_INTERFACE_VERSION;
}

QString DltCounterPlugin::description()
{
return QString();
}

QString DltCounterPlugin::error()
{
return QString();
}

bool DltCounterPlugin::loadConfig(QString /*filename */ )
{
return true;
}

bool DltCounterPlugin::saveConfig(QString /* filename */)
{
return true;
}

QStringList DltCounterPlugin::infoConfig()
{
return QStringList();
}

QWidget* DltCounterPlugin::initViewer()
{
form = new DltCounter::Form(this);
return form;
}

bool DltCounterPlugin::initControl(QDltControl *control)
{
dltControl = control;

return true;
}

bool DltCounterPlugin::initConnections(QStringList list)
{
ecuList = new QStringList(list);
// form->setConnections(list);

return false;
}

bool DltCounterPlugin::controlMsg(int , QDltMsg &)
{
return false;
}

void DltCounterPlugin::updateCounters(int ,int )
{

}

bool DltCounterPlugin::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
return true;
}

bool DltCounterPlugin::autoscrollStateChanged(bool enabled)
{
// form->autoscrollStateChanged(enabled);

return true;
}

void DltCounterPlugin::initMessageDecoder(QDltMessageDecoder* pMessageDecoder)
{
Q_UNUSED(pMessageDecoder);
}

// The tableview has been parsed to another global variable to access for pre-indexing
void DltCounterPlugin::initMainTableView(QTableView* pTableView)
{
// Q_UNUSED(pTableView);
if (!pTableView) {
qWarning() << "Main TableView pointer is null!";
return;
}

m_mainTableView = pTableView;

}

// The index has been collected in the QHash map in prior for faster scroll back
// to the mainwindow to find the previous or next message to the missing message.
void DltCounterPlugin::buildTableIndex()
{
if (!m_mainTableView || !m_mainTableView->model()) return;

QAbstractItemModel *model = m_mainTableView->model();
const int ctidColumn = 6;
const int counterColumn = 3;

ctidCounterRowMap.clear();

for (int row = 0; row < model->rowCount(); ++row) {
QString ctid = model->index(row, ctidColumn).data().toString();
int counter = model->index(row, counterColumn).data().toInt();
ctidCounterRowMap[ctid][counter] = row;
}
}

// The function will scroll back in the mainWindow to either previous or next message
// The function access the tableview as model and then match to the context id and counter
// value received. It utilises the QHash map which has been filled in buildTableIndex
void DltCounterPlugin::scrollToCounterInMainTable(const QString &ctid, int counter){

if (!m_mainTableView) return;

QAbstractItemModel* model = m_mainTableView->model();
if(!model) return;

const QHash<int, int> &counterMap = ctidCounterRowMap.value(ctid);
int row = counterMap.value(counter);
QModelIndex index = model->index(row, 0);
if (!index.isValid()) {
QMessageBox::warning(nullptr, "Invalid Index", "Index is not valid.");
return;
}

m_mainTableView->scrollTo(index, QAbstractItemView::PositionAtCenter);
m_mainTableView->clearSelection();
m_mainTableView->selectRow(row);
m_mainTableView->setFocus();
}

void DltCounterPlugin::configurationChanged()
{}

void DltCounterPlugin::selectedIdxMsg(int , QDltMsg &) {

}

void DltCounterPlugin::selectedIdxMsgDecoded(int , QDltMsg &){

}

void DltCounterPlugin::initFileStart(QDltFile *file){

clearAll();
dltFile = file;
}

// The counter data and the context IDs in the log file are accessed
// The data is saved to QList
void DltCounterPlugin::initMsg(int, QDltMsg &msg){

QString name = msg.getCtid();
nameList.append(name);

unsigned char count = msg.getMessageCounter();
countList.append(count);
}

// The data which are separated as QList, it will be merged to a QMap.
// The consolidatedMap will be accessed by counter push button and export push button.
void DltCounterPlugin::dataConsolidatedMap() {

for (int i = 0; i < nameList.size() && i < countList.size(); ++i) {
QString name = nameList[i];
int count = static_cast<int>(countList[i]);

consolidatedMap[name].insert(count);
}
}

void DltCounterPlugin::initMsgDecoded(int , QDltMsg &){

}

//Consolidated data and pre collection of index occurs after the file has been
// completed finished initialising.
void DltCounterPlugin::initFileFinish(){
dataConsolidatedMap();
buildTableIndex();
}

void DltCounterPlugin::updateFileStart(){

}

void DltCounterPlugin::updateMsg(int , QDltMsg &){

}

void DltCounterPlugin::updateMsgDecoded(int , QDltMsg &){

}

//Consolidated data and pre collection of index occurs after the file has been
// completed finished initialising.
void DltCounterPlugin::updateFileFinish(){
dataConsolidatedMap();
buildTableIndex();

}

#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Q_EXPORT_PLUGIN2(dummycontrolplugin, DummyControlPlugin);
#endif
Loading