Fix some errors created during last merge.
This commit is contained in:
+2
-1
@@ -1,6 +1,7 @@
|
||||
#include "dbc_classes.h"
|
||||
#include "dbchandler.h"
|
||||
#include "utility.h"
|
||||
#include <QtMath>
|
||||
|
||||
DBC_MESSAGE::DBC_MESSAGE()
|
||||
{
|
||||
@@ -73,7 +74,7 @@ bool DBC_SIGNAL::processAsText(const CANFrame &frame, QString &outString, bool o
|
||||
endResult = ((double)result * factor) + bias;
|
||||
result = (int64_t)endResult;
|
||||
// if factor is an integer, we don't need the possibly human-unreadable float representation
|
||||
isInteger = (factor == ceilf(factor));
|
||||
isInteger = (factor == qFloor(factor));
|
||||
}
|
||||
else if (valType == SP_FLOAT)
|
||||
{
|
||||
|
||||
+10
-9
@@ -790,22 +790,23 @@ bool FrameFileIO::loadCARBUSAnalyzerFile(QString filename, QVector<CANFrame>* fr
|
||||
if (tokens.length() > 3)
|
||||
{
|
||||
QString time = tokens[0].replace(",",".");
|
||||
|
||||
thisFrame.timestamp = static_cast<uint64_t>(time.toDouble() * 1000);
|
||||
thisFrame.ID = static_cast<uint32_t>(tokens[3].toInt(nullptr, 16));
|
||||
thisFrame.extended = (thisFrame.ID > 0x7FF);
|
||||
thisFrame.setTimeStamp(static_cast<uint64_t>(time.toDouble() * 1000));
|
||||
thisFrame.setFrameId(static_cast<uint32_t>(tokens[3].toInt(nullptr, 16)));
|
||||
thisFrame.setExtendedFrameFormat(thisFrame.frameId() > 0x7FF);
|
||||
thisFrame.isReceived = true;
|
||||
thisFrame.remote = false;
|
||||
thisFrame.setFrameType(QCanBusFrame::DataFrame);
|
||||
thisFrame.bus = 0;
|
||||
thisFrame.len = tokens[4].toInt(nullptr, 16);
|
||||
for (int d = 0; d < thisFrame.len; d++)
|
||||
int numBytes = tokens[4].toInt(nullptr, 16);
|
||||
QByteArray bytes(numBytes , 0);
|
||||
for (int d = 0; d < numBytes; d++)
|
||||
{
|
||||
if (tokens[d + 5] != "")
|
||||
{
|
||||
thisFrame.data[d] = static_cast<unsigned char>(tokens[d + 5].toInt(nullptr, 16));
|
||||
bytes[d] = static_cast<unsigned char>(tokens[d + 5].toInt(nullptr, 16));
|
||||
}
|
||||
else thisFrame.data[d] = 0;
|
||||
else bytes[d] = 0;
|
||||
}
|
||||
thisFrame.setPayload(bytes);
|
||||
frames->append(thisFrame);
|
||||
}
|
||||
else foundErrors = true;
|
||||
|
||||
Reference in New Issue
Block a user