Index: denali.pro.user =================================================================== diff -u -r3e64d98e243484505a44d99b13826097cb6b01eb -rcbb246d6efa242f927f88ac5da518dedb2d63320 --- denali.pro.user (.../denali.pro.user) (revision 3e64d98e243484505a44d99b13826097cb6b01eb) +++ denali.pro.user (.../denali.pro.user) (revision cbb246d6efa242f927f88ac5da518dedb2d63320) @@ -1,6 +1,6 @@ - + EnvironmentId Index: resources/images/Logo d-blue.png =================================================================== diff -u Binary files differ Index: resources/settings/messages/unhandled.conf =================================================================== diff -u --- resources/settings/messages/unhandled.conf (revision 0) +++ resources/settings/messages/unhandled.conf (revision cbb246d6efa242f927f88ac5da518dedb2d63320) @@ -0,0 +1,27 @@ +# How To: +# For this file to work as Unhandled Messges definition, it needs to be in the +# /home/root/.config/ of the device or if it is being used on the VM it has to be in the +# /home/denali/Projects/application/resources/settings/ of the VM. +# the groups are the message ids +# formatted in the hex and has to have the 0x and has to be in 2bytes format. +# the keys in order are: +# 1 - the message short name to be used in log. +# 2 - varable number of parameters type +# 3 - any value for a key will be ignored for now. +# message [0x4900] as an example has value for the two keys (parameter type) it has which will be ignore. + +[0x6A00] +FluidLeak +U32 + +[0x6C00] +BloodLeak +U32 +U32 + +[0x4900] +TxStopPrg +U32=Timeout (secs) +U32=Timeout countdown (secs) + + Index: sources/ApplicationController.cpp =================================================================== diff -u -r3e64d98e243484505a44d99b13826097cb6b01eb -rcbb246d6efa242f927f88ac5da518dedb2d63320 --- sources/ApplicationController.cpp (.../ApplicationController.cpp) (revision 3e64d98e243484505a44d99b13826097cb6b01eb) +++ sources/ApplicationController.cpp (.../ApplicationController.cpp) (revision cbb246d6efa242f927f88ac5da518dedb2d63320) @@ -500,6 +500,7 @@ void ApplicationController::onSettingsUpdate() { onActionReceive(SettingsData()); + emit didSettingsDone(); } Index: sources/ApplicationController.h =================================================================== diff -u -raa8f2c87c14c68d1fda6da2540d47144990a596c -rcbb246d6efa242f927f88ac5da518dedb2d63320 --- sources/ApplicationController.h (.../ApplicationController.h) (revision aa8f2c87c14c68d1fda6da2540d47144990a596c) +++ sources/ApplicationController.h (.../ApplicationController.h) (revision cbb246d6efa242f927f88ac5da518dedb2d63320) @@ -129,8 +129,12 @@ * and does not need a thread by itself */ void didSettingsInit (QPrivateSignal); + /*! + * \brief didSettingsDone + * \details This signal will be emitted when the settings are read and ready to be used. + */ + void didSettingsDone (); - // Device Signal/Slots DEVICE_APP_BRIDGE_DEFINITION_LIST Index: sources/canbus/MessageDispatcher.cpp =================================================================== diff -u -r3e64d98e243484505a44d99b13826097cb6b01eb -rcbb246d6efa242f927f88ac5da518dedb2d63320 --- sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision 3e64d98e243484505a44d99b13826097cb6b01eb) +++ sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision cbb246d6efa242f927f88ac5da518dedb2d63320) @@ -103,6 +103,10 @@ connect(&_MessageAcknowModel , SIGNAL(didFailedTransmit( Sequence )), this , SLOT( onFailedTransmit( Sequence ))); + // Application Settings are ready + connect(&_ApplicationController, SIGNAL(didSettingsDone ()), + this , SLOT( onSettingsDone ())); + // ---- Signal/Slots ADJUST_TRANSMT_MODEL_BRIDGE_CONNECTIONS(_ApplicationController) ACTION_RECEIVE_MODEL_BRIDGE_CONNECTIONS(_interpreter ) @@ -218,6 +222,15 @@ actionTransmit(vActionId, vData); } +/*! + * \brief MessageDispatcher::onSettingsDone + * \details The slot to handle didSettingsDone signal of the ApplicationController + */ +void MessageDispatcher::onSettingsDone() +{ + _interpreter.updateUnhandledMessages(); +} + // ---------------------------------------------------------------------------------------------------- /*! Index: sources/canbus/MessageDispatcher.h =================================================================== diff -u -rfc329c788fe9453983072bee937ccbc95b4ed6e4 -rcbb246d6efa242f927f88ac5da518dedb2d63320 --- sources/canbus/MessageDispatcher.h (.../MessageDispatcher.h) (revision fc329c788fe9453983072bee937ccbc95b4ed6e4) +++ sources/canbus/MessageDispatcher.h (.../MessageDispatcher.h) (revision cbb246d6efa242f927f88ac5da518dedb2d63320) @@ -250,6 +250,8 @@ // An Action has been requested to be transmitted. void onActionTransmit (GuiActionType vActionId, const QVariantList &vData); + void onSettingsDone (); + // ---- Signal/Slots ADJUST_TRANSMT_MODEL_BRIDGE_DEFINITIONS_NOEMIT ACTION_RECEIVE_MODEL_BRIDGE_DEFINITIONS 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. Index: sources/canbus/MessageInterpreter.h =================================================================== diff -u -rfc329c788fe9453983072bee937ccbc95b4ed6e4 -rcbb246d6efa242f927f88ac5da518dedb2d63320 --- sources/canbus/MessageInterpreter.h (.../MessageInterpreter.h) (revision fc329c788fe9453983072bee937ccbc95b4ed6e4) +++ sources/canbus/MessageInterpreter.h (.../MessageInterpreter.h) (revision cbb246d6efa242f927f88ac5da518dedb2d63320) @@ -52,12 +52,7 @@ // list of the unhandled messages with their definition to be able to log them like the ones which are not unhandled and have models. // it is the quickest to add them to support the V&V team. - QMap _messageList { - // /*QString("0x6A00").toUInt(0,16)*/ - { 0x6A00 , { "FluidLeak","U32" }}, - { 0x6C00 , { "BloodLeak","U32","U32" }}, - { 0x4900 , { "TxStopPrg","U32","U32" }}, - }; + QMap _messageList {}; bool isType (const Message &vMessage, Gui::GuiActionType vType) const; bool isPayloadLenValid (const Message &vMessage, Gui::GuiActionType vType) const; @@ -90,6 +85,8 @@ bool interpretMessage(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; bool interpretMessage(const Gui::GuiActionType &vActionId, const QVariantList &vData, QByteArray &vPayload, Can_Id &vCanId) __attribute_warn_unused_result__; + void updateUnhandledMessages(); + static Can_Source identifySource (Can_Id vCanId, QString *vText = nullptr); static Can_Id identifyDestination(Can_Id vCanId, QString *vText = nullptr); Index: sources/storage/StorageGlobals.cpp =================================================================== diff -u -r3f555c49ddd2c983f469709e3c001d0e76159248 -rcbb246d6efa242f927f88ac5da518dedb2d63320 --- sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision 3f555c49ddd2c983f469709e3c001d0e76159248) +++ sources/storage/StorageGlobals.cpp (.../StorageGlobals.cpp) (revision cbb246d6efa242f927f88ac5da518dedb2d63320) @@ -59,7 +59,6 @@ const char *Settings_Path_Name = "/home/denali/Projects/application/resources/settings/"; #endif - // Scripts #ifdef BUILD_FOR_TARGET const char *Scripts_Path_Name = "/home/root/scripts/"; Fisheye: Tag cbb246d6efa242f927f88ac5da518dedb2d63320 refers to a dead (removed) revision in file `ui_build_history.log'. Fisheye: No comparison available. Pass `N' to diff?