From 92176bbe9241a30a9f998e255f62e15a7d182769 Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Tue, 21 Jul 2015 18:32:20 -0400 Subject: [PATCH] Intel vs Motorola format was backwards in the program. This has been corrected. Any older DBC files saved by this program will need to be updated to compensate. --- dbchandler.cpp | 6 +++--- dbcsignaleditor.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dbchandler.cpp b/dbchandler.cpp index 8330134..3fbe60e 100644 --- a/dbchandler.cpp +++ b/dbchandler.cpp @@ -519,7 +519,7 @@ QString DBCHandler::processSignal(const CANFrame &frame, const DBC_SIGNAL &sig) startBit = sig.startBit; startByte = startBit / 8; bitWithinByteStart = startBit % 8; - if (sig.intelByteOrder) + if (!sig.intelByteOrder) { bitWithinByteStart = 7 - bitWithinByteStart; startBit = (startByte * 8) + bitWithinByteStart; @@ -539,7 +539,7 @@ QString DBCHandler::processSignal(const CANFrame &frame, const DBC_SIGNAL &sig) bitsToGo = sig.signalSize - 1; multiplier = 1; - if (sig.intelByteOrder) + if (!sig.intelByteOrder) { for (int y = startByte; y < endByte; y++) multiplier *= 256; } @@ -563,7 +563,7 @@ QString DBCHandler::processSignal(const CANFrame &frame, const DBC_SIGNAL &sig) result += processByte(frame.data[b], sBit, eBit) * multiplier; //add to multiplier - if (!sig.intelByteOrder) + if (sig.intelByteOrder) multiplier = multiplier << 8; else multiplier = multiplier >> 8; diff --git a/dbcsignaleditor.cpp b/dbcsignaleditor.cpp index 3f78be2..387850d 100644 --- a/dbcsignaleditor.cpp +++ b/dbcsignaleditor.cpp @@ -340,7 +340,7 @@ void DBCSignalEditor::fillSignalForm(DBC_SIGNAL *sig) startBit = sig->startBit; startByte = startBit / 8; bitWithinByteStart = startBit % 8; - if (sig->intelByteOrder) + if (!sig->intelByteOrder) { bitWithinByteStart = 7 - bitWithinByteStart; startBit = (startByte * 8) + bitWithinByteStart;