cleanup
This commit is contained in:
@@ -503,11 +503,8 @@ void LAWICELSerial::readSerialData()
|
|||||||
CANFrame buildFrame;
|
CANFrame buildFrame;
|
||||||
QByteArray buildData;
|
QByteArray buildData;
|
||||||
|
|
||||||
if (useSystemTime)
|
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp(0, QDateTime::currentMSecsSinceEpoch() * 1000ll));
|
||||||
{
|
if (!useSystemTime)
|
||||||
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp(0, QDateTime::currentMSecsSinceEpoch() * 1000ll));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
bool isFD = false;
|
bool isFD = false;
|
||||||
char offset;
|
char offset;
|
||||||
@@ -537,8 +534,7 @@ void LAWICELSerial::readSerialData()
|
|||||||
int dlc = mBuildLine.mid(len_index, 1).toInt();
|
int dlc = mBuildLine.mid(len_index, 1).toInt();
|
||||||
int byteCount = isFD ? (int)dlc_code_to_bytes(dlc) : dlc;
|
int byteCount = isFD ? (int)dlc_code_to_bytes(dlc) : dlc;
|
||||||
int frameStringLen = offset + byteCount * 2;
|
int frameStringLen = offset + byteCount * 2;
|
||||||
bool hasTimestamp = mBuildLine.length() > frameStringLen + 1;
|
if (mBuildLine.length() > frameStringLen + 1)
|
||||||
if (hasTimestamp)
|
|
||||||
{
|
{
|
||||||
qint64 hwTs = mBuildLine.mid(frameStringLen, 4).toInt(nullptr, 16);
|
qint64 hwTs = mBuildLine.mid(frameStringLen, 4).toInt(nullptr, 16);
|
||||||
qint64 sysMs = QDateTime::currentMSecsSinceEpoch();
|
qint64 sysMs = QDateTime::currentMSecsSinceEpoch();
|
||||||
@@ -553,10 +549,6 @@ void LAWICELSerial::readSerialData()
|
|||||||
timeBasis = sysMs - unwrappedMs;
|
timeBasis = sysMs - unwrappedMs;
|
||||||
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp(0, (timeBasis + unwrappedMs) * 1000ll));
|
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp(0, (timeBasis + unwrappedMs) * 1000ll));
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp(0, QDateTime::currentMSecsSinceEpoch() * 1000ll));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (mBuildLine[0].toLatin1())
|
switch (mBuildLine[0].toLatin1())
|
||||||
|
|||||||
Reference in New Issue
Block a user