Index: sources/canbus/caninterface.cpp =================================================================== diff -u -r2085b749d1d0aafe823e840f5aa0bc88a340798a -rf36dd9c29f633b54bf7f0232093ecaefa5452ca8 --- sources/canbus/caninterface.cpp (.../caninterface.cpp) (revision 2085b749d1d0aafe823e840f5aa0bc88a340798a) +++ sources/canbus/caninterface.cpp (.../caninterface.cpp) (revision f36dd9c29f633b54bf7f0232093ecaefa5452ca8) @@ -78,7 +78,7 @@ { if (_canDevice) { connect(_canDevice, SIGNAL( framesReceived()), - this , SLOT (onFrameReceive ())); + this , SLOT (onFrameReceive ())); connect(_canDevice, SIGNAL( errorOccurred(QCanBusDevice::CanBusError)), this , SLOT (onError (QCanBusDevice::CanBusError))); @@ -122,6 +122,15 @@ _canDevice->writeFrame(vFrame); } +void CanInterface::consoleout(const QCanBusFrame &vFrame, const QString &vView) +{ + const QString time = QString::fromLatin1("%1.%2 ") + .arg(vFrame.timeStamp().seconds(), 10, 10, QLatin1Char(' ')) + .arg(vFrame.timeStamp().microSeconds() / 100, 4, 10, QLatin1Char('0')); + const QString flags = frameFlags(vFrame); + qDebug() << time + flags + vView; +} + /*! * \brief CanInterface quit * \details Quit the Can Interface by disconnecting the bus and device. @@ -144,7 +153,7 @@ * \param frame Can message frame * \return Frame flag */ -static QString frameFlags(const QCanBusFrame &frame) +QString CanInterface::frameFlags(const QCanBusFrame &frame) { QString result = QLatin1String(" --- "); @@ -199,15 +208,8 @@ view = frame.toString(); } - const QString time = QString::fromLatin1("%1.%2 ") - .arg(frame.timeStamp().seconds(), 10, 10, QLatin1Char(' ')) - .arg(frame.timeStamp().microSeconds() / 100, 4, 10, QLatin1Char('0')); + //consoleout(frame, view); - const QString flags = frameFlags(frame); - - // qDebug() << time + flags + view; - // TODO : Needs to be investigated on how the messages on canBus will be received. - // may require to be moved at the end of the function, to not to be called for each message. emit didRead(frame); } }