Index: denali.pro.user =================================================================== diff -u -r5b218add81c16675a4f54e3ebe6054790c343f91 -rba662b0a7772c952a1947c93f623d8907f2c7278 --- denali.pro.user (.../denali.pro.user) (revision 5b218add81c16675a4f54e3ebe6054790c343f91) +++ denali.pro.user (.../denali.pro.user) (revision ba662b0a7772c952a1947c93f623d8907f2c7278) @@ -1,6 +1,6 @@ - + EnvironmentId Index: en_US.udic =================================================================== diff -u -r0552e825eebff72cbfd7f4f2fbb74b46c80f1e21 -rba662b0a7772c952a1947c93f623d8907f2c7278 --- en_US.udic (.../en_US.udic) (revision 0552e825eebff72cbfd7f4f2fbb74b46c80f1e21) +++ en_US.udic (.../en_US.udic) (revision ba662b0a7772c952a1947c93f623d8907f2c7278) @@ -203,3 +203,5 @@ reconnection FALLTHROUGH UIHistory +POSTDone +POSTItem Index: sources/canbus/FrameInterface.cpp =================================================================== diff -u -r526875e8db8cf0c97f5cd8aa90564e41d42f5fde -rba662b0a7772c952a1947c93f623d8907f2c7278 --- sources/canbus/FrameInterface.cpp (.../FrameInterface.cpp) (revision 526875e8db8cf0c97f5cd8aa90564e41d42f5fde) +++ sources/canbus/FrameInterface.cpp (.../FrameInterface.cpp) (revision ba662b0a7772c952a1947c93f623d8907f2c7278) @@ -183,8 +183,8 @@ } else { channelGroup = ChannelGroup::eChannel_Ignores; } - debugChannel = true; - ok = gEnableDialinUnhandled; + debugChannel = ! gEnableDialinUnhandled; // if debug channel is true, the raw can message in logged in the service log. + ok = gEnableDialinUnhandled; // if ok is true then it will be interpreted as unhandled messages. break; case eChlid_HD_DG : Index: sources/canbus/MessageGlobals.h =================================================================== diff -u -r4884b4cb65e55661249c78901b5e0b724cb21b36 -rba662b0a7772c952a1947c93f623d8907f2c7278 --- sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision 4884b4cb65e55661249c78901b5e0b724cb21b36) +++ sources/canbus/MessageGlobals.h (.../MessageGlobals.h) (revision ba662b0a7772c952a1947c93f623d8907f2c7278) @@ -335,6 +335,7 @@ eCan_Unknown = -1, eCan_HD = 0, eCan_DG = 1, + eCan_DI = 2, }; /*! Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -r5c00f3c6c0a0363be1e9ffe747110c4c34c6174a -rba662b0a7772c952a1947c93f623d8907f2c7278 --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 5c00f3c6c0a0363be1e9ffe747110c4c34c6174a) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision ba662b0a7772c952a1947c93f623d8907f2c7278) @@ -25,6 +25,7 @@ using namespace Can; using namespace Model; +#define DISABLE_CHECKIN_LOG 0 #define DEBUG_SIGNAL(vID, vMODEL) // qDebug() << vID << vMODEL; @@ -169,8 +170,8 @@ */ void MessageInterpreter::printUnhandled(const Message &vMessage) const { - if ( logUnhandledMessage(vMessage)) return; - if ( gDisableUnhandledReport ) return; + if ( logUnhandledMessage(vMessage)) return; // the message is defined as unhandled and can still be handled and logged, return. + if ( gDisableUnhandledReport ) return; // if the unhandled message error has been disabled, return. QString mActionIdHexString = Format::toHexString(vMessage.actionId, false, eLenMessageIDDigits); QString logMessage = tr("Unhandled Message ID (HD)") + '\n' + QString("%1 # %2 %3") @@ -226,8 +227,9 @@ if ( length ) { // this message has a variable length vPayload = Format::fromVariant(vData[0]); } - // DEBUG: +#if DISABLE_CHECKIN_LOG == 0 LOG_EVENT_UI(QString("CheckIn")); +#endif break; case Gui::GuiActionType::ID_RawData: // len: 255, can have any len @@ -321,6 +323,15 @@ if (vText) *vText = "DG"; return Can_Source::eCan_DG; + 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 + if (vText) *vText = "DI"; + return Can_Source::eCan_DI; + default: if (vText) *vText = "XX"; return Can_Source::eCan_Unknown; @@ -349,6 +360,15 @@ if (vText) *vText = "DG"; return Can_Id::eChlid_UI_DG; + 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 + if (vText) *vText = "DI"; + return Can_Id::eChlid_UI_Sync; + default: if (vText) *vText = "XX"; return Can_Id::eChlid_UI_Sync; @@ -359,6 +379,11 @@ * \brief MessageInterpreter::interpretMessage * \details This method will call appropriate message interpreter * for received messages from HD or DG regarding the Can_Id. + * This function checks to identify the source of the message. + * if it is from HD or DG then checks the standard handled messages with strongly typed models. + * we still have a chance in each HD/DG interpreter to log the unhandled messages. + * if the source is none of the HD or DG it doesn't go to the individual interpreters, + * and the message will identified as unhandled immediately. * \param vCan_Id - The Channel Id of the CANBus frame. * \param vMessage - The complete message of type Message which needs to be interpreted. * \param vActionId - The ActionId of GuiActionType which will be extracted from vMessage. @@ -375,7 +400,7 @@ 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; - default : logUnhandledMessage(vMessage ); break; // ok is still false. + default : printUnhandled (vMessage ); break; // ok is false, the individual interpreters for ?HD/DG should not be called, and it should be done here. } return ok; } @@ -399,18 +424,18 @@ vData.clear(); switch (vMessage.actionId) { // notice we are in receive mode // ----- Debug - case Gui::GuiActionType::ID_CANBusFaultCount : ok = canbusFaultCountData (vMessage, vData); break; // TODO : implement notify<>() + case Gui::GuiActionType::ID_CANBusFaultCount : ok = canbusFaultCountData (vMessage, vData); /* TODO : implement notify<>() */ break; case Gui::GuiActionType::ID_HDDebugText : ok = notify(vMessage, vData, Gui::GuiActionType::ID_HDDebugText ); break; case Gui::GuiActionType::ID_HDGeneralEvent : ok = notify(vMessage, vData, Gui::GuiActionType::ID_HDGeneralEvent ); break; // ----- Events - case Gui::GuiActionType::ID_Acknow : ok = true; break; // TODO : implement notify<>() + case Gui::GuiActionType::ID_Acknow : ok = true; /* TODO : implement notify<>() */ break; case Gui::GuiActionType::ID_PowerOff : ok = notify(vMessage, vData, Gui::GuiActionType::ID_PowerOff ); break; - case Gui::GuiActionType::ID_ShuttingDown : ok = true; LOG_EVENT("HD,ShuttingDown"); break; // TODO : implement notify<>() + case Gui::GuiActionType::ID_ShuttingDown : ok = true; LOG_EVENT("HD,ShuttingDown"); /* TODO : implement notify<>() */ break; // ----- POST case Gui::GuiActionType::ID_HDPostSingleResultData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_HDPostSingleResultData ); break; - case Gui::GuiActionType::ID_HDPostFinalResultData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_HDPostFinalResultData ); break; + case Gui::GuiActionType::ID_HDPostFinalResultData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_HDPostFinalResultData ); break; // ----- Settings case Gui::GuiActionType::ID_AdjustVersionsHDReq : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustVersionsHDReq ); break; @@ -489,8 +514,8 @@ case Gui::GuiActionType::ID_AdjustChemicalConfirmRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustChemicalConfirmRsp ); break; // these need to be standard and use notify as well - case Gui::GuiActionType::ID_AdjustUltrafiltrationEditRsp : ok = adjustUltrafiltrationEdit (vMessage, vData); break; // TODO : implement notify<>() - case Gui::GuiActionType::ID_AdjustUltrafiltrationConfirmRsp : ok = adjustUltrafiltrationConfirm (vMessage, vData); break; // TODO : implement notify<>() + case Gui::GuiActionType::ID_AdjustUltrafiltrationEditRsp : ok = adjustUltrafiltrationEdit (vMessage, vData); /* TODO : implement notify<>() */ break; + case Gui::GuiActionType::ID_AdjustUltrafiltrationConfirmRsp : ok = adjustUltrafiltrationConfirm (vMessage, vData); /* TODO : implement notify<>() */ break; // ----- Alarms case Gui::GuiActionType::ID_AlarmStatus : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AlarmStatus ); break; @@ -504,7 +529,7 @@ // unhandled messages: these will only be logged as received message // there has nothing been defined for these messages. - default : printUnhandled(vMessage); break; + default : printUnhandled (vMessage ); break; } return ok; @@ -528,11 +553,9 @@ bool ok = false; vData.clear(); switch (vMessage.actionId) { // notice we are in receive mode - case Gui::GuiActionType::ID_Acknow : ok = true; break; // TODO : implement notify<>() - case Gui::GuiActionType::ID_DGCheckIn: // TODO : implement notify<>() - ok = true; - LOG_EVENT(QString("DG,CheckIn," + QVariant(vData).toStringList().join(','))); - break; + case Gui::GuiActionType::ID_Acknow : ok = true; /* TODO : implement notify<>() */ break; + case Gui::GuiActionType::ID_DGCheckIn : ok = true; /* TODO : implement notify<>() */ + LOG_EVENT(QString("DG,CheckIn," + QVariant(vData).toStringList().join(','))); break; // ----- POST case Gui::GuiActionType::ID_DGPostSingleResultData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGPostSingleResultData ); break; case Gui::GuiActionType::ID_DGPostFinalResultData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_DGPostFinalResultData ); break; @@ -566,7 +589,7 @@ // unhandled messages: these will only be logged as received message // there has nothing been defined for these messages. - default : printUnhandled(vMessage); break; + default : printUnhandled (vMessage ); break; } return ok; @@ -687,10 +710,12 @@ for ( int i = 0; i < items.count(); i++ ) { QString item = items[i]; if (i == 0) { - switch (identifySource(vMessage.can_id)) { - case Can_Source::eCan_HD: logString = "HD,~" + item; break; - case Can_Source::eCan_DG: logString = "DG,~" + item; break; - default : logString = "XX,~" + item; break; + 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_DI: logString = ID + ",~" + item; break; + default : logString = ID + ",~" + item; break; } } else {