Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -ra58f91b077c8131bea3dbde0fc338adb113fc9f3 --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision a58f91b077c8131bea3dbde0fc338adb113fc9f3) @@ -75,11 +75,11 @@ if ( ! isValidMessage(vMessage, vIdCheck) ) return ok; ok = tModel.fromByteArray(vMessage.data); tModel.toVariantList(vData); - // disabled coco begin validated : Tested manually. This code will never go false + // This code will never go false // because the isValidMessage is catching errors. // only is checking here for developer safety if logic has changed. if ( ! ok ) return false; - // disabled coco end + emit didActionReceive(tModel.data()); LOG_APPED_MSG(vIdCheck, tModel.toString()); DEBUG_SIGNAL(vIdCheck, typeid(TModel).name()) @@ -197,7 +197,7 @@ { bool ok = true; if (vCanId == Can::Can_Id::eChlid_NONE ) - vCanId = Can::Can_Id::eChlid_UI_HD ; + vCanId = Can::Can_Id::eChlid_UI_TD ; vPayload.clear(); int length = vData.length(); @@ -274,15 +274,13 @@ case Gui::GuiActionType::ID_AlarmSilenceReq : INTERPRET_TRANSMIT_MESSAGE(AlarmSilenceRequestData ); break; case Gui::GuiActionType::ID_AlarmUserActionReq : INTERPRET_TRANSMIT_MESSAGE(AlarmUserActionRequestData ); break; case Gui::GuiActionType::ID_AlarmVolumeSetReq : INTERPRET_TRANSMIT_MESSAGE(AdjustHDAlarmVolumeRequestData ); break; - // disabled coco begin validated: Manually tested. This model class is a placeholder for the message 63(0x3F00) and there is no use case for this now. - case Gui::GuiActionType::ID_AlarmClearedConditionReq : INTERPRET_TRANSMIT_MESSAGE(AlarmClearedConditionRequestData ); break; + // This model class is a placeholder for the message 63(0x3F00) and there is no use case for this now. case Gui::GuiActionType::ID_AlarmActiveListReq : INTERPRET_TRSMT_MT_MESSAGE(AlarmActiveListRequestData ); break; case Gui::GuiActionType::ID_AlarmTriggered : INTERPRET_TRANSMIT_MESSAGE(AlarmTriggeredRequestData ); break; // HD reset in service mode case Gui::GuiActionType::ID_ResetHDInServiceModeReq : INTERPRET_TRSMT_MT_MESSAGE(AdjustHDResetInSrvcRequestData ); break; - // disabled coco end default: QString mActionIdHexString = Format::toHexString(vActionId); LOG_DEBUG(tr("Unknown transmit Message with ID '%1'").arg(mActionIdHexString)); @@ -301,26 +299,35 @@ Can_Source MessageInterpreter::identifySource(Can_Id vCanId, QString *vText) { switch (vCanId) { - case eChlid_HD_DG : // 0x008, ///< HD => DG - case eChlid_HD_UI : // 0x020, ///< HD => UI - case eChlid_HD_Alarm: // 0x001, ///< HD alarm broadcast - case eChlid_HD_Sync : // 0x040, ///< HD sync broadcast - if (vText) *vText = "HD"; - return Can_Source::eCan_HD; + case eChlid_TD_DD : + case eChlid_TD_UI : + case eChlid_TD_Alarm: + case eChlid_TD_Sync : + if (vText) *vText = "TD"; + return Can_Source::eCan_TD; - case eChlid_DG_HD : // 0x010, ///< DG => HD - case eChlid_DG_UI : // 0x070, ///< DG => UI - case eChlid_DG_Alarm: // 0x002, ///< DG alarm broadcast - case eChlid_DG_Sync : // 0x080, ///< DG sync broadcast - if (vText) *vText = "DG"; - return Can_Source::eCan_DG; + case eChlid_DD_TD : + //case eChlid_DD_UI : // has duplicate value as eChlid_DD_Sync + case eChlid_DD_Alarm: + case eChlid_DD_Sync : + if (vText) *vText = "DD"; + return Can_Source::eCan_DD; - case eDialin_HD : // 0x400, ///< dialin => HD - case eHD_Dialin : // 0x401, ///< HD => dialin - case eDialin_DG : // 0x402, ///< dialin => DG - case eDG_Dialin : // 0x403, ///< DG => dialin - case eDialin_UI : // 0x404, ///< dialin => UI - case eUI_Dialin : // 0x405, ///< UI => dialin + case eChlid_DD_FP : + //case eChlid_FP_UI : + case eChlid_FP_Alarm: + case eChlid_FP_Sync : + if (vText) *vText = "FP"; + return Can_Source::eCan_FP; + + case eDialin_TD : + case eTD_Dialin : + case eDialin_DD : + case eDD_Dialin : + case eDialin_FP : + case eFP_Dialin : + case eDialin_UI : + case eUI_Dialin : if (vText) *vText = "DI"; return Can_Source::eCan_DI; @@ -332,32 +339,45 @@ /*! * \brief MessageInterpreter::identifyDestination - * \details Identifies the destination of the message regarding the channel id for the acknowledges + * \details Identifies the destination of the message regarding the channel id for the ACKNOWLEDGES * \return the destination of the message in enum * \sa can::Can_Source * \sa can::Can_Id */ Can_Id MessageInterpreter::identifyDestination(Can_Id vCanId, QString *vText) { + //// + //TODO: let's decide if UI should ack anything other than direct recieved message ( [ TD, DD ] => UI ) + //// switch (vCanId) { - case eChlid_HD_UI : // 0x020, ///< HD => UI - case eChlid_HD_Alarm: // 0x001, ///< HD alarm broadcast - case eChlid_HD_Sync : // 0x040, ///< HD sync broadcast - if (vText) *vText = "HD"; - return Can_Id::eChlid_UI_HD; + case eChlid_TD_UI : + case eChlid_TD_Alarm: + case eChlid_TD_Sync : + if (vText) *vText = "TD"; + return Can_Id::eChlid_UI_TD; - case eChlid_DG_UI : // 0x070, ///< DG => UI - case eChlid_DG_Alarm: // 0x002, ///< DG alarm broadcast - case eChlid_DG_Sync : // 0x080, ///< DG sync broadcast - if (vText) *vText = "DG"; - return Can_Id::eChlid_UI_DG; + //case eChlid_DD_UI : // has duplicate value as eChlid_DD_Sync + case eChlid_DD_Alarm: + case eChlid_DD_Sync : + if (vText) *vText = "DD"; + return Can_Id::eChlid_UI_DD; - case eDialin_HD : // 0x400, ///< dialin => HD - case eHD_Dialin : // 0x401, ///< HD => dialin - case eDialin_DG : // 0x402, ///< dialin => DG - case eDG_Dialin : // 0x403, ///< DG => dialin - case eDialin_UI : // 0x404, ///< dialin => UI - case eUI_Dialin : // 0x405, ///< UI => dialin + // FP is not designed to directly communicate with UI + //case eChlid_DD_FP : + //case eChlid_FP_UI : + //case eChlid_FP_Alarm: + //case eChlid_FP_Sync : + // if (vText) *vText = "FP"; + // return Can_Id::eChlid_UI_Sync; + + case eDialin_TD : + case eTD_Dialin : + case eDialin_DD : + case eDD_Dialin : + case eDialin_FP : + case eFP_Dialin : + case eDialin_UI : + case eUI_Dialin : if (vText) *vText = "DI"; return Can_Id::eChlid_UI_Sync; @@ -391,8 +411,8 @@ if ( ! gLogUnhandledOnly ) { switch (identifySource(vMessage.can_id)) { - case Can_Source::eCan_HD: ok = interpretMessage_HD(vMessage, vData); break; - case Can_Source::eCan_DG: ok = interpretMessage_DG(vMessage, vData); break; + case Can_Source::eCan_TD: ok = interpretMessage_HD(vMessage, vData); break; + case Can_Source::eCan_DD: ok = interpretMessage_DG(vMessage, vData); break; default : printUnhandled (vMessage ); break; // ok is false, the individual interpreters for ?HD/DG should not be called, and it should be done here. } } @@ -522,10 +542,8 @@ case Gui::GuiActionType::ID_AlarmTriggered : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AlarmTriggered ); break; case Gui::GuiActionType::ID_AlarmCleared : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AlarmCleared ); break; case Gui::GuiActionType::ID_AlarmVolumeSetRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AlarmVolumeSetRsp ); break; - // disabled coco begin validated: Manually tested. This model class is a placeholder for the message 63(0x3F00) and there is no use case for this now. - case Gui::GuiActionType::ID_AlarmClearedConditionRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AlarmClearedConditionRsp ); break; + // This model class is a placeholder for the message 63(0x3F00) and there is no use case for this now. case Gui::GuiActionType::ID_AlarmActiveListRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AlarmActiveListRsp ); break; - // disabled coco end // unhandled messages: these will only be logged as received message // there has nothing been defined for these messages. @@ -614,9 +632,8 @@ int index = 0; Types::U32 mCanBUSFaultCount; ok = GetValue(vMessage.data, index, mCanBUSFaultCount); - // disabled coco begin validated : developer safety if for any reason length of CanBUSFaultCount set to 0 + // developer safety if for any reason length of CanBUSFaultCount set to 0 if (ok) { - // disabled coco end vData += mCanBUSFaultCount.value; } return ok; @@ -711,8 +728,8 @@ if (i == 0) { QString ID; switch (identifySource(vMessage.can_id, &ID)) { - case Can_Source::eCan_HD: logString += ID + ",~" + item; break; - case Can_Source::eCan_DG: logString += ID + ",~" + item; break; + case Can_Source::eCan_TD: logString += ID + ",~" + item; break; + case Can_Source::eCan_DD: logString += ID + ",~" + item; break; case Can_Source::eCan_DI: logString += ID + ",~" + item; break; default : logString += ID + ",~" + item; break; }