using proper method

This commit is contained in:
alessandro negrin
2025-03-29 17:10:50 +01:00
parent 2f70a608e3
commit 4905794926
7 changed files with 74 additions and 12 deletions
+3 -3
View File
@@ -493,7 +493,7 @@ void LAWICELSerial::readSerialData()
if (useSystemTime)
{
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch()));
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch() * 1000ul));
}
else
{
@@ -502,13 +502,13 @@ void LAWICELSerial::readSerialData()
{
//Four bytes after the end of the data bytes.
buildTimestamp = mBuildLine.mid(5 + mBuildLine.mid(4, 1).toInt() * 2, 4).toInt(nullptr, 16) * 1000l;
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp(0, buildTimestamp));
}
else
{
//Default to system time if timestamps are disabled.
buildTimestamp = QDateTime::currentMSecsSinceEpoch() * 1000l;
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch() * 1000ul));
}
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp(0, buildTimestamp));
}
switch (mBuildLine[0].toLatin1())