Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -r3e64d98e243484505a44d99b13826097cb6b01eb -rcbb246d6efa242f927f88ac5da518dedb2d63320 --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 3e64d98e243484505a44d99b13826097cb6b01eb) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision cbb246d6efa242f927f88ac5da518dedb2d63320) @@ -173,10 +173,10 @@ if ( gDisableUnhandledReport ) return; QString mActionIdHexString = Format::toHexString(vMessage.actionId, false, eLenMessageIDDigits); QString logMessage = tr("Unhandled Message ID (HD)") + '\n' + - QString("%1 # %2 %3") + QString("%1 # %2 %3") .arg(int(vMessage.can_id), 3, 16, QChar('0')) .arg(mActionIdHexString) - .arg(QString(vMessage.data.toHex('.'))); + .arg(QString(vMessage.data.toHex('.'))).toUpper(); LOG_DEBUG(logMessage); } @@ -643,6 +643,25 @@ } /*! + * \brief MessageInterpreter::updateUnhandledMessages + * \return this method is converting the general settings messages/unhandled group of settings to the message interpreter specific map structure. + * it is done for performance to keep the lookup table shorter and faster. + * This method is called by the chain of events when Application controller is done reading the settings and emits it didSettingsDone, + * which Message dispatcher is listening to will call this function in its signal handler slot. + */ +void MessageInterpreter::updateUnhandledMessages() +{ + qDebug() << _Settings.groups("messages/unhandled"); + for(const auto group: _Settings.groups("messages/unhandled")) { + qDebug() << _Settings.keys(group); + bool ok; + quint16 id = QString(group).toUInt(&ok,16); + if (!ok) continue; + _messageList[ id ] = _Settings.keys(group); + } +} + +/*! * \brief MessageInterpreter::logUnhandledMessage * \details Search in the list of the unhandled messages and tries to extract the data and log it. * \param vMessage - the received message.