realized that the value list was already supported so reverted
my custom code. The issue that made me go down this path is related to the little endian checkbox mysteriously and inconsistently unchecking and therefore interpreting enum values wrong...would really like to find this.
This commit is contained in:
+2
-13
@@ -137,17 +137,6 @@ bool DBC_SIGNAL::processAsText(const CANFrame &frame, QString &outString, bool o
|
||||
cachedValue = outString;
|
||||
return true;
|
||||
}
|
||||
else if(valType == VALUE_STRING)
|
||||
{
|
||||
result = Utility::processIntegerSignal(frame.payload(), startBit, signalSize, intelByteOrder, isSigned);
|
||||
|
||||
if(!getValueString(result, outString))
|
||||
{
|
||||
outString = "Signal string value is undefined";
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (valType == SIGNED_INT) isSigned = true;
|
||||
if (valType == SIGNED_INT || valType == UNSIGNED_INT)
|
||||
@@ -240,7 +229,7 @@ bool DBC_SIGNAL::processAsInt(const CANFrame &frame, int32_t &outValue)
|
||||
int32_t result = 0;
|
||||
bool isSigned = false;
|
||||
|
||||
if (valType == STRING || valType == VALUE_STRING || valType == SP_FLOAT || valType == DP_FLOAT)
|
||||
if (valType == STRING || valType == SP_FLOAT || valType == DP_FLOAT)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -273,7 +262,7 @@ bool DBC_SIGNAL::processAsDouble(const CANFrame &frame, double &outValue)
|
||||
bool isSigned = false;
|
||||
double endResult;
|
||||
|
||||
if (valType == STRING || valType == VALUE_STRING)
|
||||
if (valType == STRING)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
+1
-2
@@ -21,8 +21,7 @@ enum DBC_SIG_VAL_TYPE
|
||||
SIGNED_INT,
|
||||
SP_FLOAT,
|
||||
DP_FLOAT,
|
||||
STRING,
|
||||
VALUE_STRING
|
||||
STRING
|
||||
};
|
||||
|
||||
enum DBC_ATTRIBUTE_VAL_TYPE
|
||||
|
||||
@@ -576,9 +576,6 @@ DBC_SIGNAL* DBCFile::parseSignalLine(QString line, DBC_MESSAGE *msg)
|
||||
sig.valType = DP_FLOAT;
|
||||
sig.intelByteOrder = true;
|
||||
break;
|
||||
case 7: //double point float in little endian
|
||||
sig.valType = VALUE_STRING;
|
||||
break;
|
||||
}
|
||||
sig.factor = match.captured(6 + offset).toDouble();
|
||||
sig.bias = match.captured(7 + offset).toDouble();
|
||||
@@ -1449,9 +1446,6 @@ bool DBCFile::saveFile(QString fileName)
|
||||
case STRING:
|
||||
msgOutput.append("4-");
|
||||
break;
|
||||
case VALUE_STRING:
|
||||
msgOutput.append("7-");
|
||||
break;
|
||||
default:
|
||||
msgOutput.append("0-");
|
||||
break;
|
||||
|
||||
@@ -86,9 +86,6 @@ DBCSignalEditor::DBCSignalEditor(QWidget *parent) :
|
||||
case 4:
|
||||
currentSignal->valType = STRING;
|
||||
break;
|
||||
case 5:
|
||||
currentSignal->valType = VALUE_STRING;
|
||||
break;
|
||||
}
|
||||
dbcFile->setDirtyFlag();
|
||||
fillSignalForm(currentSignal);
|
||||
@@ -581,9 +578,6 @@ void DBCSignalEditor::fillSignalForm(DBC_SIGNAL *sig)
|
||||
case STRING:
|
||||
ui->comboType->setCurrentIndex(4);
|
||||
break;
|
||||
case VALUE_STRING:
|
||||
ui->comboType->setCurrentIndex(5);
|
||||
break;
|
||||
}
|
||||
|
||||
for (int i = 0; i < ui->comboReceiver->count(); i++)
|
||||
|
||||
Reference in New Issue
Block a user