Updated version, fixed some bugs in DBC related code.

This commit is contained in:
Collin Kidder
2015-07-20 19:54:45 -04:00
parent 39c49d8002
commit 10fc01f15e
3 changed files with 15 additions and 13 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef CONFIG #ifndef CONFIG
#define CONFIG #define CONFIG
#define VERSION 125 #define VERSION 126
//try to keep this in sync. //try to keep this in sync.
//SavvyCAN will complain if you connect a GVRET board with a revision //SavvyCAN will complain if you connect a GVRET board with a revision
+8 -6
View File
@@ -337,20 +337,22 @@ void DBCHandler::saveDBCFile(QString filename)
switch (sig.valType) switch (sig.valType)
{ {
case UNSIGNED_INT: case UNSIGNED_INT:
msgOutput.append("0+"); if (sig.intelByteOrder) msgOutput.append("0+");
else msgOutput.append("1+");
break; break;
case SIGNED_INT: case SIGNED_INT:
msgOutput.append("0-"); if (sig.intelByteOrder) msgOutput.append("0-");
else msgOutput.append("1-");
break; break;
case SP_FLOAT: case SP_FLOAT:
msgOutput.append("1-");
break;
case DP_FLOAT:
msgOutput.append("2-"); msgOutput.append("2-");
break; break;
case STRING: case DP_FLOAT:
msgOutput.append("3-"); msgOutput.append("3-");
break; break;
case STRING:
msgOutput.append("4-");
break;
default: default:
msgOutput.append("0-"); msgOutput.append("0-");
break; break;
+6 -6
View File
@@ -86,7 +86,7 @@ DBCSignalEditor::DBCSignalEditor(DBCHandler *handler, QWidget *parent) :
{ {
double temp; double temp;
bool result; bool result;
temp = ui->txtBias->text().toDouble(); temp = ui->txtBias->text().toDouble(&result);
if (result) currentSignal->bias = temp; if (result) currentSignal->bias = temp;
}); });
@@ -95,7 +95,7 @@ DBCSignalEditor::DBCSignalEditor(DBCHandler *handler, QWidget *parent) :
{ {
double temp; double temp;
bool result; bool result;
temp = ui->txtMaxVal->text().toDouble(); temp = ui->txtMaxVal->text().toDouble(&result);
if (result) currentSignal->max = temp; if (result) currentSignal->max = temp;
}); });
@@ -104,7 +104,7 @@ DBCSignalEditor::DBCSignalEditor(DBCHandler *handler, QWidget *parent) :
{ {
double temp; double temp;
bool result; bool result;
temp = ui->txtMinVal->text().toDouble(); temp = ui->txtMinVal->text().toDouble(&result);
if (result) currentSignal->min = temp; if (result) currentSignal->min = temp;
}); });
connect(ui->txtScale, &QLineEdit::editingFinished, connect(ui->txtScale, &QLineEdit::editingFinished,
@@ -112,7 +112,7 @@ DBCSignalEditor::DBCSignalEditor(DBCHandler *handler, QWidget *parent) :
{ {
double temp; double temp;
bool result; bool result;
temp = ui->txtScale->text().toDouble(); temp = ui->txtScale->text().toDouble(&result);
if (result) currentSignal->factor = temp; if (result) currentSignal->factor = temp;
}); });
connect(ui->txtComment, &QLineEdit::editingFinished, connect(ui->txtComment, &QLineEdit::editingFinished,
@@ -352,10 +352,10 @@ void DBCSignalEditor::fillSignalForm(DBC_SIGNAL *sig)
endBit = 63; endBit = 63;
} }
bitpattern[startBit / 8] |= 1 << (startBit % 8); //bitpattern[startBit / 8] |= 1 << (startBit % 8);
ui->bitfield->setReference(bitpattern, false); ui->bitfield->setReference(bitpattern, false);
for (int y = startBit + 1; y <= endBit; y++) for (int y = startBit; y <= endBit; y++)
{ {
int byt = y / 8; int byt = y / 8;
bitpattern[byt] |= 1 << (y % 8); bitpattern[byt] |= 1 << (y % 8);