diff --git a/config.h b/config.h index ae266f9..82fb440 100644 --- a/config.h +++ b/config.h @@ -1,7 +1,7 @@ #ifndef CONFIG #define CONFIG -#define VERSION 122 +#define VERSION 123 //try to keep this in sync. //SavvyCAN will complain if you connect a GVRET board with a revision diff --git a/dbcsignaleditor.cpp b/dbcsignaleditor.cpp index aae51f9..f3afc0e 100644 --- a/dbcsignaleditor.cpp +++ b/dbcsignaleditor.cpp @@ -51,6 +51,7 @@ DBCSignalEditor::DBCSignalEditor(DBCHandler *handler, QWidget *parent) : [=]() { currentSignal->intelByteOrder = ui->cbIntelFormat->isChecked(); + fillSignalForm(currentSignal); }); connect(ui->comboReceiver, &QComboBox::currentTextChanged, @@ -255,7 +256,7 @@ void DBCSignalEditor::addNewSignal() DBC_SIGNAL newSig; newSig.name = newName; newSig.bias = 0.0; - newSig.factor = 0.0; + newSig.factor = 1.0; newSig.intelByteOrder = true; newSig.max = 0.0; newSig.min = 0.0; diff --git a/graphingwindow.cpp b/graphingwindow.cpp index 4aad980..4b8d9fc 100644 --- a/graphingwindow.cpp +++ b/graphingwindow.cpp @@ -426,14 +426,20 @@ void GraphingWindow::createGraph(GraphParams ¶ms, bool createGraphParam) int tempValInt; int numBytes = (params.endByte - params.startByte) + 1; int shiftRef = 1 << (numBytes * 8); + uint64_t maskShifter; + uint8_t tempByte; for (int j = 0; j < numEntries; j++) { tempValInt = 0; int expon = 1; + maskShifter = params.mask; for (int c = 0; c < numBytes; c++) { - tempValInt += (frameCache[j * params.stride].data[params.endByte - c] * expon); + tempByte = frameCache[j * params.stride].data[params.endByte - c]; + tempByte &= maskShifter; + tempValInt += (tempByte * expon); expon *= 256; + maskShifter = maskShifter >> 8; } tempValInt &= params.mask; @@ -467,14 +473,20 @@ void GraphingWindow::createGraph(GraphParams ¶ms, bool createGraphParam) int tempValInt; int numBytes = (params.startByte - params.endByte) + 1; int shiftRef = 1 << (numBytes * 8); + uint64_t maskShifter; + uint8_t tempByte; for (int j = 0; j < numEntries; j++) { tempValInt = 0; int expon = 1; + maskShifter = params.mask; for (int c = 0; c < numBytes; c++) { - tempValInt += frameCache[j * params.stride].data[params.endByte + c] * expon; + tempByte = frameCache[j * params.stride].data[params.endByte + c]; + tempByte &= maskShifter; + tempValInt += tempByte * expon; expon *= 256; + maskShifter = maskShifter >> 8; } tempValInt &= params.mask;