Index: sources/canbus/MessageInterpreter.h =================================================================== diff -u -r95a840fc93f1a2cd65732d835fad2aca0f03f28e -r2ef03b2ce51b4dc507f66e9671953a8e0824bde9 --- sources/canbus/MessageInterpreter.h (.../MessageInterpreter.h) (revision 95a840fc93f1a2cd65732d835fad2aca0f03f28e) +++ sources/canbus/MessageInterpreter.h (.../MessageInterpreter.h) (revision 2ef03b2ce51b4dc507f66e9671953a8e0824bde9) @@ -1,15 +1,15 @@ /*! * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * Copyright (c) 2020-2024 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * - * \file MessageInterpreter.h - * \author (last) Peter Lucia - * \date (last) 15-Oct-2020 - * \author (original) Behrouz NematiPour - * \date (original) 26-Aug-2020 + * \file MessageInterpreter.h + * \author (last) Behrouz NematiPour + * \date (last) 13-Oct-2022 + * \author (original) Behrouz NematiPour + * \date (original) 26-Aug-2020 * */ #pragma once @@ -32,7 +32,7 @@ * \brief The MessageInterpreter class * \details This the class that interprets the messages to/from frames. * UI only understands GuiActionType and QVariantList data types - * And CANBUS only understands QCanBusFrame with Hex values in QByteArrays + * And CANBus only understands QCanBusFrame with Hex values in QByteArrays * This is the class which interpret this data to/from. * This class is converting the data of messages to frames regarding the Message ID from values to array of bytes * or converting the payload of frames from data of messages regarding the Message ID from array of bytes to values. \n @@ -50,44 +50,45 @@ friend class ::tst_logging; friend class ::tst_models; + // 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 {}; + bool isType (const Message &vMessage, Gui::GuiActionType vType) const; bool isPayloadLenValid (const Message &vMessage, Gui::GuiActionType vType) const; bool isValidMessage (const Message &vMessage, Gui::GuiActionType vType) const; void logInvalidLength (const Gui::GuiActionType &vActionId); void printUnhandled (const Message &vMessage ) const; - void logReceivedMessage (const Model::MAbstract &vModel); bool interpretMessage_HD (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; bool interpretMessage_DG (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; // ----- Debug bool canbusFaultCountData (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; - // ----- Events - // ----- - HD - bool alarmStatus (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; - bool alarmTriggered (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; - bool alarmCleared (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; - - // ----- - DG - // ----- Adjustments - bool adjustUltrafiltrationState (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; bool adjustUltrafiltrationEdit (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; bool adjustUltrafiltrationConfirm (const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; template bool notify (const Message &vMessage, QVariantList &vData, Gui::GuiActionType vIdCheck) __attribute_warn_unused_result__; + bool logUnhandledMessage (const Message &vMessage) const; + public: explicit MessageInterpreter(QObject *parent = nullptr); // interpret the data into GUI understandable Actions/Data - bool interpretMessage(const Message &vMessage, QVariantList &vData) __attribute_warn_unused_result__; - bool interpretMessage(const Gui::GuiActionType &vActionId, const QVariantList &vData, QByteArray &vPayload) __attribute_warn_unused_result__; + 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); + signals: ACTION_RECEIVE_SIGNALS };