From 0eef77d9018cc75e439e256e6dd0da8f3c9586c8 Mon Sep 17 00:00:00 2001 From: Mark Schulte Date: Sat, 9 Nov 2019 13:31:00 -0800 Subject: [PATCH 1/6] Fix Decoding of Canalzyer ASC files * Properly decode and encode extended IDs * Properly decode and encode RTR messages --- framefileio.cpp | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/framefileio.cpp b/framefileio.cpp index 5e8d3d0..3944744 100644 --- a/framefileio.cpp +++ b/framefileio.cpp @@ -1287,14 +1287,24 @@ bool FrameFileIO::loadCanalyzerASC(QString filename, QVector* frames) if (tokens.length() > 5) { thisFrame.timestamp = static_cast(tokens[0].toDouble() * 1000000.0); - thisFrame.ID = tokens[2].toUInt(nullptr, 16); + if (tokens[2].endsWith('x')) + { + QByteArray copied_id = tokens[2]; + copied_id.chop(1); + thisFrame.ID = copied_id.toUInt(nullptr, 16); + thisFrame.extended = true; + } + else + { + thisFrame.ID = tokens[2].toUInt(nullptr, 16); + thisFrame.extended = false; + } thisFrame.len = tokens[5].toInt(); if (thisFrame.len > 8) return false; if (thisFrame.len < 0) return false; thisFrame.isReceived = tokens[3].toUpper().contains("RX"); thisFrame.bus = tokens[1].toInt(); - thisFrame.extended = (thisFrame.ID > 0x7FF); - thisFrame.remote = false; + thisFrame.remote = tokens[4] == "r"; for (int d = 6; d < (6 + static_cast(thisFrame.len)); d++) { if (tokens.count() > d) @@ -1365,16 +1375,22 @@ bool FrameFileIO::saveCanalyzerASC(QString filename, const QVector* fr outFile->write(QString::number(frames->at(c).bus + 1).toUtf8()); outFile->write(" "); if (frames->at(c).extended) + { outFile->write(QString::number(frames->at(c).ID, 16).toUpper().rightJustified(8, '0').toUtf8()); + outFile->write("x"); + } else { outFile->write(QString::number(frames->at(c).ID, 16).toUpper().rightJustified(3, '0').toUtf8()); - outFile->write(" "); + outFile->write(" "); } outFile->write(" "); - if (frames->at(c).isReceived) outFile->write("Rx D "); - else outFile->write("Tx D "); + if (frames->at(c).isReceived) outFile->write("Rx "); + else outFile->write("Tx "); + + if (frames->at(c).remote) outFile->write("r "); + else outFile->write("d "); outFile->write(QString::number(frames->at(c).len).toUtf8()); outFile->write(" "); From 902a82c3180b52da7e037af2fe3479533d9ce697 Mon Sep 17 00:00:00 2001 From: Mark Schulte Date: Thu, 5 Dec 2019 17:14:27 -0800 Subject: [PATCH 2/6] [graphing] Ignore RTR messages RTR messages will be incorrectly graphed as "0", even though it's not a real message. --- re/graphingwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/re/graphingwindow.cpp b/re/graphingwindow.cpp index 3b0d34a..d33d439 100644 --- a/re/graphingwindow.cpp +++ b/re/graphingwindow.cpp @@ -1113,7 +1113,7 @@ void GraphingWindow::createGraph(GraphParams ¶ms, bool createGraphParam) for (int i = 0; i < modelFrames->count(); i++) { CANFrame thisFrame = modelFrames->at(i); - if (thisFrame.ID == params.ID) frameCache.append(thisFrame); + if (thisFrame.ID == params.ID && thisFrame.remote == false) frameCache.append(thisFrame); } //to fix weirdness where a graph that has no data won't be able to be edited, selected, or deleted properly From 802171087184c84146565b4d0d20961d38ff23b4 Mon Sep 17 00:00:00 2001 From: Tobin Hall Date: Wed, 11 Dec 2019 11:35:20 +1300 Subject: [PATCH 3/6] Removing limitations to allow for floating point endianess --- dbc/dbc_classes.cpp | 4 ++-- dbc/dbcsignaleditor.cpp | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/dbc/dbc_classes.cpp b/dbc/dbc_classes.cpp index 04b98e8..f692f7e 100644 --- a/dbc/dbc_classes.cpp +++ b/dbc/dbc_classes.cpp @@ -79,7 +79,7 @@ bool DBC_SIGNAL::processAsText(const CANFrame &frame, QString &outString, bool o //that the bytes that make up the integer are instead treated as having made up //a 32 bit single precision float. That's evil incarnate but it is very fast and small //in terms of new code. - result = Utility::processIntegerSignal(frame.data, startBit, 32, false, false); + result = Utility::processIntegerSignal(frame.data, startBit, 32, intelByteOrder, false); endResult = (*((float *)(&result)) * factor) + bias; } else //double precision float @@ -91,7 +91,7 @@ bool DBC_SIGNAL::processAsText(const CANFrame &frame, QString &outString, bool o } //like the above, this is rotten and evil and wrong in so many ways. Force //calculation of a 64 bit integer and then cast it into a double. - result = Utility::processIntegerSignal(frame.data, 0, 64, false, false); + result = Utility::processIntegerSignal(frame.data, 0, 64, intelByteOrder, false); endResult = (*((double *)(&result)) * factor) + bias; } diff --git a/dbc/dbcsignaleditor.cpp b/dbc/dbcsignaleditor.cpp index d2b592d..1ca3c2b 100644 --- a/dbc/dbcsignaleditor.cpp +++ b/dbc/dbcsignaleditor.cpp @@ -49,8 +49,6 @@ DBCSignalEditor::DBCSignalEditor(QWidget *parent) : { if (currentSignal == nullptr) return; currentSignal->intelByteOrder = ui->cbIntelFormat->isChecked(); - if (currentSignal->valType == SP_FLOAT || currentSignal->valType == DP_FLOAT) - currentSignal->intelByteOrder = false; fillSignalForm(currentSignal); }); @@ -74,13 +72,11 @@ DBCSignalEditor::DBCSignalEditor(QWidget *parent) : break; case 2: currentSignal->valType = SP_FLOAT; - currentSignal->intelByteOrder = false; if (currentSignal->startBit > 39) currentSignal->startBit = 39; currentSignal->signalSize = 32; break; case 3: currentSignal->valType = DP_FLOAT; - currentSignal->intelByteOrder = false; currentSignal->startBit = 7; //has to be! currentSignal->signalSize = 64; break; From 9fb61507a7457898d72529be9f9d338f60ea3bd4 Mon Sep 17 00:00:00 2001 From: Tobin Hall Date: Wed, 11 Dec 2019 11:36:22 +1300 Subject: [PATCH 4/6] Adding types to allow for saving and loading of little endian floats --- dbc/dbchandler.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dbc/dbchandler.cpp b/dbc/dbchandler.cpp index e9ac4c0..e10cb87 100644 --- a/dbc/dbchandler.cpp +++ b/dbc/dbchandler.cpp @@ -465,6 +465,14 @@ DBC_SIGNAL* DBCFile::parseSignalLine(QString line, DBC_MESSAGE *msg) case 4: sig.valType = STRING; break; + case 5: //single point float in little endian + sig.valType = SP_FLOAT; + sig.intelByteOrder = true; + break; + case 6: //double point float in little endian + sig.valType = DP_FLOAT; + sig.intelByteOrder = true; + break; } sig.factor = match.captured(6 + offset).toDouble(); sig.bias = match.captured(7 + offset).toDouble(); @@ -1230,10 +1238,12 @@ void DBCFile::saveFile(QString fileName) else msgOutput.append("0-"); break; case SP_FLOAT: - msgOutput.append("2-"); + if (sig->intelByteOrder) msgOutput.append("5-"); + else msgOutput.append("2-"); break; case DP_FLOAT: - msgOutput.append("3-"); + if (sig->intelByteOrder) msgOutput.append("6-"); + else msgOutput.append("3-"); break; case STRING: msgOutput.append("4-"); From b5faf422bc372ec83420a265729e0bf8b0f6bdf6 Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Wed, 11 Dec 2019 18:36:14 -0500 Subject: [PATCH 5/6] Update QT installer for CI build It seems that the build is broken when trying to use QT5.12.3. Trying 5.13.2 instead. --- qt-installer-windows.qs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qt-installer-windows.qs b/qt-installer-windows.qs index 8164790..faf9e4b 100644 --- a/qt-installer-windows.qs +++ b/qt-installer-windows.qs @@ -14,8 +14,8 @@ // Unfortunately it is not possible to disable deps like qt.tools.qtcreator var INSTALL_COMPONENTS = [ installer.environmentVariable("PLATFORM") == "x64" ? - "qt.qt5.5123.win64_msvc2017_64" : - "qt.qt5.5123.win32_msvc2017", + "qt.qt5.5132.win64_msvc2017_64" : + "qt.qt5.5132.win32_msvc2017", ]; function Controller() { From 77a5469a2ba918785941c9694a4569763df6b88b Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Wed, 11 Dec 2019 18:44:24 -0500 Subject: [PATCH 6/6] Update qt-installer-windows.qs Previous commit was the wrong idea. This one should fix the Windows build. --- qt-installer-windows.qs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/qt-installer-windows.qs b/qt-installer-windows.qs index faf9e4b..92908f7 100644 --- a/qt-installer-windows.qs +++ b/qt-installer-windows.qs @@ -14,8 +14,8 @@ // Unfortunately it is not possible to disable deps like qt.tools.qtcreator var INSTALL_COMPONENTS = [ installer.environmentVariable("PLATFORM") == "x64" ? - "qt.qt5.5132.win64_msvc2017_64" : - "qt.qt5.5132.win32_msvc2017", + "qt.qt5.5123.win64_msvc2017_64" : + "qt.qt5.5123.win32_msvc2017", ]; function Controller() { @@ -28,6 +28,15 @@ function Controller() { }); } +Controller.prototype.DynamicTelemetryPluginFormCallback = function() { + gui.currentPageWidget().TelemetryPluginForm.statisticGroupBox.disableStatisticRadioButton.setChecked(true); + gui.clickButton(buttons.NextButton); + + //for(var key in widget.TelemetryPluginForm.statisticGroupBox){ + // console.log(key); + //} +} + Controller.prototype.WelcomePageCallback = function() { console.log("Step: " + gui.currentPageWidget()); // At least for 3.0.4 immediately clicking Next fails, so wait a bit.