Fix UDS interpretation of read by ID, Fix up display issues with

interpreted messages on main screen.
This commit is contained in:
Collin Kidder
2020-09-21 22:04:28 -04:00
parent 3fa9f14651
commit 18e20a2ee2
4 changed files with 20 additions and 11 deletions
+5 -5
View File
@@ -512,13 +512,13 @@ QString UDS_HANDLER::getDetailedMessageAnalysis(const UDS_MESSAGE &msg)
if (dataLen > 3)
{
int routineID;
routineID = (data[1] * 256 + data[2]);
routineID = (data[2] * 256 + data[3]);
buildString.append("\nRoutine ID: " + Utility::formatHexNum(routineID));
}
if (dataLen > 4)
{
buildString.append("\nParameter bytes to routine: ");
for (int i = 3; i < dataLen; i++)
for (int i = 4; i < dataLen; i++)
{
buildString.append(Utility::formatHexNum(data[i]) + " ");
}
@@ -529,13 +529,13 @@ QString UDS_HANDLER::getDetailedMessageAnalysis(const UDS_MESSAGE &msg)
if (dataLen > 2)
{
int routineID;
routineID = (data[1] * 256 + data[2]);
routineID = (data[2] * 256 + data[3]);
buildString.append("\nRoutine ID: " + Utility::formatHexNum(routineID));
}
if (dataLen > 3)
if (dataLen > 4)
{
buildString.append("\nBytes returned by routine: ");
for (int i = 3; i < dataLen; i++)
for (int i = 4; i < dataLen; i++)
{
buildString.append(Utility::formatHexNum(data[i]) + " ");
}
+2 -2
View File
@@ -463,8 +463,8 @@ QVariant CANFrameModel::data(const QModelIndex &index, int role) const
DBC_MESSAGE *msg = dbcHandler->findMessage(thisFrame);
if (msg != nullptr)
{
tempString.append(" <Interpreted>\n");
tempString.append(msg->name + "\n" + msg->comment + "\n");
tempString.append(" <" + msg->name + ">\n");
if (msg->comment.length() > 1) tempString.append(msg->comment + "\n");
for (int j = 0; j < msg->sigHandler->getCount(); j++)
{
QString sigString;
+4 -1
View File
@@ -55,8 +55,11 @@ QListWidgetItem * FilterUtility::createFilterItem(int32_t id, QListWidget* paren
QListWidgetItem *thisItem = new QListWidgetItem(parent);
QString filterItemName = Utility::formatCANID(id);
//Note, there are multiple filter labeling preferences. There is one in main settings to globally
//enable or disable them all. Then each loaded DBC file also can be selected on/off
//Both must be enabled for you to see labeling.
if (settings.value("Main/FilterLabeling", false).toBool())
{
{
// Filter labeling (show interpreted frame names next to the CAN addr ID)
MatchingCriteria_t matchingCriteria;
DBC_MESSAGE *msg = dbcHandler->findMessageForFilter(id,&matchingCriteria);
+9 -3
View File
@@ -51,9 +51,15 @@ MainWindow::MainWindow(QWidget *parent) :
readSettings();
//QHeaderView *verticalHeader = ui->canFramesView->verticalHeader();
//verticalHeader->setSectionResizeMode(QHeaderView::Fixed);
//verticalHeader->setDefaultSectionSize(10);
QHeaderView *verticalHeader = ui->canFramesView->verticalHeader();
verticalHeader->setSectionResizeMode(QHeaderView::Fixed);
QSettings settings;
int fontSize = settings.value("Main/FontSize", 9).toUInt();
QFont sysFont = QFont(); //get default font
sysFont.setPointSize(fontSize);
verticalHeader->setDefaultSectionSize(sysFont.pixelSize());
ui->canFramesView->setFont(sysFont);
QHeaderView *HorzHdr = ui->canFramesView->horizontalHeader();
HorzHdr->setStretchLastSection(true); //causes the data column to automatically fill the tableview
connect(HorzHdr, SIGNAL(sectionClicked(int)), this, SLOT(headerClicked(int)));