Updated version, fixed some bugs in DBC related code.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#ifndef CONFIG
|
||||
#define CONFIG
|
||||
|
||||
#define VERSION 125
|
||||
#define VERSION 126
|
||||
|
||||
//try to keep this in sync.
|
||||
//SavvyCAN will complain if you connect a GVRET board with a revision
|
||||
|
||||
+8
-6
@@ -337,20 +337,22 @@ void DBCHandler::saveDBCFile(QString filename)
|
||||
switch (sig.valType)
|
||||
{
|
||||
case UNSIGNED_INT:
|
||||
msgOutput.append("0+");
|
||||
if (sig.intelByteOrder) msgOutput.append("0+");
|
||||
else msgOutput.append("1+");
|
||||
break;
|
||||
case SIGNED_INT:
|
||||
msgOutput.append("0-");
|
||||
if (sig.intelByteOrder) msgOutput.append("0-");
|
||||
else msgOutput.append("1-");
|
||||
break;
|
||||
case SP_FLOAT:
|
||||
msgOutput.append("1-");
|
||||
break;
|
||||
case DP_FLOAT:
|
||||
msgOutput.append("2-");
|
||||
break;
|
||||
case STRING:
|
||||
case DP_FLOAT:
|
||||
msgOutput.append("3-");
|
||||
break;
|
||||
case STRING:
|
||||
msgOutput.append("4-");
|
||||
break;
|
||||
default:
|
||||
msgOutput.append("0-");
|
||||
break;
|
||||
|
||||
+6
-6
@@ -86,7 +86,7 @@ DBCSignalEditor::DBCSignalEditor(DBCHandler *handler, QWidget *parent) :
|
||||
{
|
||||
double temp;
|
||||
bool result;
|
||||
temp = ui->txtBias->text().toDouble();
|
||||
temp = ui->txtBias->text().toDouble(&result);
|
||||
if (result) currentSignal->bias = temp;
|
||||
});
|
||||
|
||||
@@ -95,7 +95,7 @@ DBCSignalEditor::DBCSignalEditor(DBCHandler *handler, QWidget *parent) :
|
||||
{
|
||||
double temp;
|
||||
bool result;
|
||||
temp = ui->txtMaxVal->text().toDouble();
|
||||
temp = ui->txtMaxVal->text().toDouble(&result);
|
||||
if (result) currentSignal->max = temp;
|
||||
});
|
||||
|
||||
@@ -104,7 +104,7 @@ DBCSignalEditor::DBCSignalEditor(DBCHandler *handler, QWidget *parent) :
|
||||
{
|
||||
double temp;
|
||||
bool result;
|
||||
temp = ui->txtMinVal->text().toDouble();
|
||||
temp = ui->txtMinVal->text().toDouble(&result);
|
||||
if (result) currentSignal->min = temp;
|
||||
});
|
||||
connect(ui->txtScale, &QLineEdit::editingFinished,
|
||||
@@ -112,7 +112,7 @@ DBCSignalEditor::DBCSignalEditor(DBCHandler *handler, QWidget *parent) :
|
||||
{
|
||||
double temp;
|
||||
bool result;
|
||||
temp = ui->txtScale->text().toDouble();
|
||||
temp = ui->txtScale->text().toDouble(&result);
|
||||
if (result) currentSignal->factor = temp;
|
||||
});
|
||||
connect(ui->txtComment, &QLineEdit::editingFinished,
|
||||
@@ -352,10 +352,10 @@ void DBCSignalEditor::fillSignalForm(DBC_SIGNAL *sig)
|
||||
endBit = 63;
|
||||
}
|
||||
|
||||
bitpattern[startBit / 8] |= 1 << (startBit % 8);
|
||||
//bitpattern[startBit / 8] |= 1 << (startBit % 8);
|
||||
ui->bitfield->setReference(bitpattern, false);
|
||||
|
||||
for (int y = startBit + 1; y <= endBit; y++)
|
||||
for (int y = startBit; y <= endBit; y++)
|
||||
{
|
||||
int byt = y / 8;
|
||||
bitpattern[byt] |= 1 << (y % 8);
|
||||
|
||||
Reference in New Issue
Block a user