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/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-"); diff --git a/dbc/dbcsignaleditor.cpp b/dbc/dbcsignaleditor.cpp index acaa55c..2d528c4 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; 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(" "); diff --git a/qt-installer-windows.qs b/qt-installer-windows.qs index 8164790..92908f7 100644 --- a/qt-installer-windows.qs +++ b/qt-installer-windows.qs @@ -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. 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