From 802171087184c84146565b4d0d20961d38ff23b4 Mon Sep 17 00:00:00 2001 From: Tobin Hall Date: Wed, 11 Dec 2019 11:35:20 +1300 Subject: [PATCH] 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;