Fixed an issue with there being no visual confirmation that intel byte mode had been changed in DBC editor, made masking work much more intuitively in graphing screen.
This commit is contained in:
@@ -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
|
||||
|
||||
+2
-1
@@ -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;
|
||||
|
||||
+14
-2
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user