Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -r5f69bb944ed9b2186528f726def2630544bd0de6 -r7f61f6da0818d40aed3ef528ae498ea3f619ae07 --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 5f69bb944ed9b2186528f726def2630544bd0de6) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 7f61f6da0818d40aed3ef528ae498ea3f619ae07) @@ -469,7 +469,7 @@ case Gui::GuiActionType::ID_HDUsageInfoRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_HDUsageInfoRsp ); break; case Gui::GuiActionType::ID_AdjustInstitutionalRecordRsp : ok = notify(vMessage, vData, Gui::GuiActionType::ID_AdjustInstitutionalRecordRsp ); break; // ----- States - case Gui::GuiActionType::ID_HDOperationModeData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_HDOperationModeData ); break; + case Gui::GuiActionType::ID_TDOpModeData : ok = notify(vMessage, vData, Gui::GuiActionType::ID_TDOpModeData ); break; case Gui::GuiActionType::ID_PreTreatmentStates : ok = notify(vMessage, vData, Gui::GuiActionType::ID_PreTreatmentStates ); break; case Gui::GuiActionType::ID_TreatmentStates : ok = notify(vMessage, vData, Gui::GuiActionType::ID_TreatmentStates ); break; case Gui::GuiActionType::ID_PostTreatmentStates : ok = notify(vMessage, vData, Gui::GuiActionType::ID_PostTreatmentStates ); break; @@ -579,7 +579,7 @@ vData.clear(); switch (vMessage.actionId) { // notice we are in receive mode case Gui::GuiActionType::ID_Acknow : ok = true; /* TODO : implement notify<>() */ break; - LOG_APPED(QString("DG,CheckIn," + QVariant(vData).toStringList().join(','))); break; + LOG_APPED(QString("DD,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; @@ -724,24 +724,25 @@ */ bool MessageInterpreter::logUnhandledMessage(const Message &vMessage) const { bool ok = false; - quint16 id = vMessage.actionId; - QString logString = QString("%1,").arg(id,4,16); - if (_messageList.contains(id)) { + quint16 msg_id = vMessage.actionId; + QString logString = QString("%1,").arg(msg_id,4,16); + QString can_id; + QString item = ""; + + identifySource(vMessage.can_id, &can_id); // Message Can Channel. + logString += can_id + ","; + // qDebug() << __FUNCTION__ << logString; + + if (_messageList.contains(msg_id)) { ok = true; - QStringList items = _messageList[id]; + QStringList items = _messageList[msg_id]; int index = 0; for ( int i = 0; i < items.count(); i++ ) { - QString item = items[i]; - if (i == 0) { - QString ID; - switch (identifySource(vMessage.can_id, &ID)) { - 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; - } + item = items[i]; + if (i == 0) { // Message Name/Identifier + logString += "~" + item; } - else { + else { // Message payload data if ( item == "F32" ) { Types::F32 param; if (! GetValue(vMessage.data, index, param )) logString += ",?"; @@ -784,12 +785,12 @@ } } } - LOG_APPED(logString); } else { if ( gDisableUnhandledReport ) { // if the unhandled message error has been disabled, return. - LOG_DEBUG(QString("Undefined unhandled message [%1]").arg(id, 0, 16)); + LOG_DEBUG(QString("Undefined unhandled message [%1]").arg(msg_id, 0, 16)); } } + LOG_APPED(logString + item); return ok; }