Index: denali.pro.user =================================================================== diff -u -rf61c0aebdb0768f44883696c3a55bf26e7156489 -r0b8e00869ef81ef0a834c03c13049f4c281870d2 --- denali.pro.user (.../denali.pro.user) (revision f61c0aebdb0768f44883696c3a55bf26e7156489) +++ denali.pro.user (.../denali.pro.user) (revision 0b8e00869ef81ef0a834c03c13049f4c281870d2) @@ -1,6 +1,6 @@ - + EnvironmentId Index: sources/canbus/MessageDispatcher.cpp =================================================================== diff -u -r93b6bd48e2aec1fca4f2b5b79dcefffa49e9ce16 -r0b8e00869ef81ef0a834c03c13049f4c281870d2 --- sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision 93b6bd48e2aec1fca4f2b5b79dcefffa49e9ce16) +++ sources/canbus/MessageDispatcher.cpp (.../MessageDispatcher.cpp) (revision 0b8e00869ef81ef0a834c03c13049f4c281870d2) @@ -503,8 +503,8 @@ } QByteArray mData; - - if (! _interpreter.interpretMessage(vActionId, vData, mData)) { + Can_Id canid; + if (! _interpreter.interpretMessage(vActionId, vData, mData, canid)) { LOG_DEBUG(QString("Incorrect Message, can't be interpreted, %1").arg(Format::toHexString(vActionId))); // TODO : LogInfo Improvement return; } @@ -534,9 +534,9 @@ // since it does not need Re-Acknow // and this is the sequence number which will be used // to remove the message from the Acknow list. - emit didAcknowTransmit(eChlid_UI_HD, vSequence, frameList); + emit didAcknowTransmit(canid, vSequence, frameList); } - framesTransmit(eChlid_UI_HD, frameList); + framesTransmit(canid, frameList); } /*! Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -r2cee3c28bf7565eeb55dcb033961fe6962f11d16 -r0b8e00869ef81ef0a834c03c13049f4c281870d2 --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 2cee3c28bf7565eeb55dcb033961fe6962f11d16) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 0b8e00869ef81ef0a834c03c13049f4c281870d2) @@ -33,6 +33,7 @@ // like the notify method of received messages #define INTERPRET_RECEIVED_MESSAGE(vMODEL) \ if ( ! length ) { logInvalidLength(vActionId); return false; } \ + vCanId = vMODEL::canid(); \ vPayload = Format::fromVariant(vData); \ LOG_EVENT(vMODEL::toString(vData)); \ DEBUG_RECEIVE_SIGNAL(0, typeid(vMODEL).name()) @@ -41,6 +42,7 @@ // same later improvements apply to this MACRO as well. #define INTERPRET_RECVD_MT_MESSAGE(vMODEL) \ if ( length ) { logInvalidLength(vActionId); return false; } \ + vCanId = vMODEL::canid(); \ vPayload = Format::fromVariant(vData); \ LOG_EVENT(vMODEL::toString(vData)); \ DEBUG_RECEIVE_SIGNAL(0, typeid(vMODEL).name()) @@ -202,11 +204,11 @@ * \return true if the vActionId is valid. * This return value will be used later for error handling. */ -bool MessageInterpreter::interpretMessage(const Gui::GuiActionType &vActionId, const QVariantList &vData, QByteArray &vPayload) +bool MessageInterpreter::interpretMessage(const Gui::GuiActionType &vActionId, const QVariantList &vData, QByteArray &vPayload, Can_Id &vCanId) { bool ok = true; QString mSenderID = "UI,"; - + vCanId = Can::Can_Id::eChlid_UI_HD; vPayload.clear(); int length = vData.length(); Index: sources/canbus/MessageInterpreter.h =================================================================== diff -u -rf1e100d1368bfd132d88e09680f833dc53b4d0b0 -r0b8e00869ef81ef0a834c03c13049f4c281870d2 --- sources/canbus/MessageInterpreter.h (.../MessageInterpreter.h) (revision f1e100d1368bfd132d88e09680f833dc53b4d0b0) +++ sources/canbus/MessageInterpreter.h (.../MessageInterpreter.h) (revision 0b8e00869ef81ef0a834c03c13049f4c281870d2) @@ -77,7 +77,7 @@ // 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 Gui::GuiActionType &vActionId, const QVariantList &vData, QByteArray &vPayload, Can_Id &vCanId) __attribute_warn_unused_result__; signals: ACTION_RECEIVE_SIGNALS Index: sources/model/hd/adjustment/MTreatmentAdjustRequests.h =================================================================== diff -u -r25e7d601d795c1622dd4c6e437b3dce91a676e83 -r0b8e00869ef81ef0a834c03c13049f4c281870d2 --- sources/model/hd/adjustment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision 25e7d601d795c1622dd4c6e437b3dce91a676e83) +++ sources/model/hd/adjustment/MTreatmentAdjustRequests.h (.../MTreatmentAdjustRequests.h) (revision 0b8e00869ef81ef0a834c03c13049f4c281870d2) @@ -20,7 +20,7 @@ //project #include "GuiGlobals.h" - +#include "MessageGlobals.h" using namespace Gui; namespace Model { @@ -47,6 +47,15 @@ QString senderID = "UI,"; return QString(senderID + vStringPrefix + "," + vParameters.toStringList().join(',')); } + +public: + /*! + * \brief canid returns the default channel id of the message. + * it can be modified by the specific message which inherits the MModel. + * \return Can::Can_Id + */ + static Can::Can_Id canid () { return Can::Can_Id::eChlid_UI_HD; } + }; /*! @@ -473,6 +482,7 @@ */ class MAdjustVersionsReq : public MModel { public: + // coco begin validated : Has been validated manually. // This object is used statically for now, kept the logic for later usage. QString toString() { @@ -482,6 +492,8 @@ static QString toString(const QVariantList &vParameters) { return MModel::toString("Version", vParameters); } + + static Can::Can_Id canid () { return Can::eChlid_UI_Sync; } }; //// ---------- Alarms