Index: sources/canbus/caninterface.cpp =================================================================== diff -u -rb798668f16ad0967ab97e96f5f9a2cdd821e899f -r2437559b2d4cd4c2ac6a926b4f55652e55e1f616 --- sources/canbus/caninterface.cpp (.../caninterface.cpp) (revision b798668f16ad0967ab97e96f5f9a2cdd821e899f) +++ sources/canbus/caninterface.cpp (.../caninterface.cpp) (revision 2437559b2d4cd4c2ac6a926b4f55652e55e1f616) @@ -54,8 +54,10 @@ initConnections(); status(tr("Connected")); - LOG_EVENT(status()); - LOG_EVENT(QObject::tr("%1 Initialized").arg(metaObject()->className())); + QString logMessage = QString("UI,%1,%2") + .arg(tr("%1 Initialized").arg(metaObject()->className())) + .arg(status()); + LOG_EVENT(logMessage); return true; } @@ -101,6 +103,20 @@ } /*! + * \brief CanInterface::enableConsoleOut + * \details Enable or Disables the console output and logs the status + * \param vEnabled - Enalbe console output if true + */ +void CanInterface::enableConsoleOut(bool vEnabled) { + _enableConsoleOut = vEnabled; + if (_enableConsoleOut) { + LOG_EVENT_ONCE("UI," + tr("Console out CanInterface enabled")); + } else { + LOG_EVENT_ONCE("UI," + tr("Console out CanInterface disabled")); + } +} + +/*! * \brief CanInterface connections definition * \details Initializes the required signal/slot connection between this class and other objects * to be able to communicate. @@ -257,8 +273,6 @@ // coco begin validated: This code is only for debugging purposes and had been tested manually. if ( ! _enableConsoleOut ) return; - LOG_EVENT_ONCE(QObject::tr("console out CanInterface Enabled")); - const QString time = QString::fromLatin1("%1.%2 ") .arg(vFrame.timeStamp().seconds(), 10, 10, QLatin1Char(' ')) .arg(vFrame.timeStamp().microSeconds() / 100, 4, 10, QLatin1Char('0'));