From 0ee9eacbb3e16973b0564fc9e20c1a592518b6af Mon Sep 17 00:00:00 2001 From: Andy Huska Date: Tue, 20 Sep 2022 17:08:20 -0500 Subject: [PATCH] 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. --- dbc/dbc_classes.cpp | 15 ++------------- dbc/dbc_classes.h | 3 +-- dbc/dbchandler.cpp | 6 ------ dbc/dbcsignaleditor.cpp | 6 ------ 4 files changed, 3 insertions(+), 27 deletions(-) diff --git a/dbc/dbc_classes.cpp b/dbc/dbc_classes.cpp index 2a43815..5467b4f 100644 --- a/dbc/dbc_classes.cpp +++ b/dbc/dbc_classes.cpp @@ -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; } diff --git a/dbc/dbc_classes.h b/dbc/dbc_classes.h index b093a5d..fd085c2 100644 --- a/dbc/dbc_classes.h +++ b/dbc/dbc_classes.h @@ -21,8 +21,7 @@ enum DBC_SIG_VAL_TYPE SIGNED_INT, SP_FLOAT, DP_FLOAT, - STRING, - VALUE_STRING + STRING }; enum DBC_ATTRIBUTE_VAL_TYPE diff --git a/dbc/dbchandler.cpp b/dbc/dbchandler.cpp index 3c11d33..9088bda 100644 --- a/dbc/dbchandler.cpp +++ b/dbc/dbchandler.cpp @@ -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; diff --git a/dbc/dbcsignaleditor.cpp b/dbc/dbcsignaleditor.cpp index 606ff63..b4bd6a3 100644 --- a/dbc/dbcsignaleditor.cpp +++ b/dbc/dbcsignaleditor.cpp @@ -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++)