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
+1 -1
View File
@@ -222,7 +222,7 @@ bool CANConManager::sendFrame(const CANFrame& pFrame)
workingFrame.isReceived = false;
if (useSystemTime)
{
workingFrame.setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch()));
workingFrame.setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch() * 1000ul));
}
else
{
+1 -1
View File
@@ -214,7 +214,7 @@ void CANserver::readNetworkData()
frame_p->setFrameType(QCanBusFrame::DataFrame);
frame_p->isReceived = true;
frame_p->setTimeStamp(QCanBusFrame::TimeStamp(0, QDateTime::currentMSecsSinceEpoch() * 1000ul));
frame_p->setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch() * 1000ul));
frame_p->setPayload(datagram.mid(dataByteLocation, length));
+2 -2
View File
@@ -685,7 +685,7 @@ void GVRetSerial::procRXChar(unsigned char c)
buildTimestamp += timeBasis;
if (useSystemTime)
{
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch()));
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch() * 1000ul));
} else {
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp(0, buildTimestamp));
}
@@ -771,7 +771,7 @@ void GVRetSerial::procRXChar(unsigned char c)
buildTimestamp += timeBasis;
if (useSystemTime)
{
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch()));
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch() * 1000ul));
} else {
buildFrame.setTimeStamp(QCanBusFrame::TimeStamp(0, buildTimestamp));
}
+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())
+1 -1
View File
@@ -302,7 +302,7 @@ void MQTT_BUS::clientMessageReceived(const QMQTT::Message& message)
frame_p->isReceived = true;
if (useSystemTime)
{
frame_p->setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch()));
frame_p->setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch() * 1000ul));
}
else frame_p->setTimeStamp(QCanBusFrame::TimeStamp(0, timeStamp));
+1 -1
View File
@@ -211,7 +211,7 @@ void SerialBusConnection::framesReceived()
frame_p->isReceived = !recFrame.hasLocalEcho();
if (useSystemTime) {
frame_p->setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch()));
frame_p->setTimeStamp(QCanBusFrame::TimeStamp::fromMicroSeconds(QDateTime::currentMSecsSinceEpoch() * 1000ul));
}
else frame_p->setTimeStamp(QCanBusFrame::TimeStamp(0, (recFrame.timeStamp().seconds() * 1000000ul + recFrame.timeStamp().microSeconds()) - timeBasis));