Implemented the signal viewer and enabled it in the menu.

This commit is contained in:
Collin Kidder
2019-04-15 20:56:39 -04:00
parent 7c49c59197
commit c12031158e
6 changed files with 123 additions and 33 deletions
+4 -4
View File
@@ -36,7 +36,7 @@ s 5 47 46 45 44 43 42 41 40
So, the bits are 12, 11, 10, 9, 8, 23, 22, 21. Yes, that's confusing. They now go in reverse value order too.
Bit 12 is worth 128, 11 is worth 64, etc until bit 21 is worth 1.
*/
bool DBC_SIGNAL::processAsText(const CANFrame &frame, QString &outString)
bool DBC_SIGNAL::processAsText(const CANFrame &frame, QString &outString, bool outputName)
{
int64_t result = 0;
bool isSigned = false;
@@ -95,16 +95,16 @@ bool DBC_SIGNAL::processAsText(const CANFrame &frame, QString &outString)
endResult = (*((double *)(&result)) * factor) + bias;
}
outString = makePrettyOutput(endResult, result);
outString = makePrettyOutput(endResult, result, outputName);
cachedValue = endResult;
return true;
}
QString DBC_SIGNAL::makePrettyOutput(double floatVal, int64_t intVal)
QString DBC_SIGNAL::makePrettyOutput(double floatVal, int64_t intVal, bool outputName)
{
QString outputString;
outputString = name + ": ";
if (outputName) outputString = name + ": ";
if (valList.count() > 0) //if this is a value list type then look it up and display the proper string
{