19 m_ethManager(ethManager),m_infobasic(infobasic), m_extra(extra), m_nv(nv), m_rd(rd)
33 getSourceOfMessage(dnginfo.
baseInfo);
34 getSeverityOfError(dnginfo.
baseInfo);
36 dnginfo.
baseMessage = std::string(eoerror_code2string(m_infobasic->properties.code));
38 eOmn_info_extraformat_t extraf =
static_cast<eOmn_info_extraformat_t
>EOMN_INFO_PROPERTIES_FLAGS_get_extraformat(m_infobasic->properties.flags);
41 if(eomn_info_extraformat_verbal == extraf)
43 dnginfo.
extraMessage.append((NULL == m_extra) ? (
"no extra info despite we are in verbal mode") : ((
const char *)m_extra));
52 dnginfo.
param64 = m_infobasic->properties.par64;
53 dnginfo.
param16 = m_infobasic->properties.par16;
54 dnginfo.
errorCode = m_infobasic->properties.code;
59 std::unique_ptr<DefaultParser> parser_ptr;
61 eOerror_category_t category = eoerror_code2category(m_infobasic->properties.code);
64 case eoerror_category_Config: parser_ptr = std::make_unique<ConfigParser>(dnginfo, entityNameProvider);
break;
66 case eoerror_category_MotionControl: parser_ptr = std::make_unique<MotionControlParser>(dnginfo, entityNameProvider);
break;
68 case eoerror_category_HardWare: parser_ptr = std::make_unique<HwErrorParser>(dnginfo, entityNameProvider);
break;
70 case eoerror_category_System: parser_ptr = std::make_unique<SysParser>(dnginfo, entityNameProvider);
break;
72 case eoerror_category_ETHmonitor: parser_ptr = std::make_unique<EthMonitorParser>(dnginfo, entityNameProvider);
break;
74 case eoerror_category_Skin: parser_ptr = std::make_unique<SkinParser>(dnginfo, entityNameProvider);
break;
76 case eoerror_category_InertialSensor: parser_ptr = std::make_unique<InertialSensorParser>(dnginfo, entityNameProvider);
break;
78 case eoerror_category_AnalogSensor: parser_ptr = std::make_unique<AnalogSensorParser>(dnginfo, entityNameProvider);
break;
80 default: parser_ptr = std::make_unique<DefaultParser>(dnginfo, entityNameProvider);
break;
83 parser_ptr->parseInfo();
92 void InfoFormatter::getSourceOfMessage(
EmbeddedInfo &info)
94 const char *
const sourcenames[] =
102 eOmn_info_source_t source =
static_cast<eOmn_info_source_t
>EOMN_INFO_PROPERTIES_FLAGS_get_source(m_infobasic->properties.flags);
104 info.sourceCANBoardAddr = EOMN_INFO_PROPERTIES_FLAGS_get_address(m_infobasic->properties.flags);
106 info.sourceCANPortStr = std::string(((source > eomn_info_source_can2) ? (sourcenames[3]) : (sourcenames[source])));
112 void InfoFormatter::getTimeOfInfo(
TimeOfInfo &timeOfInfo)
114 timeOfInfo.
sec = m_infobasic->timestamp / 1000000;
115 timeOfInfo.
msec = (m_infobasic->timestamp % 1000000) / 1000;
116 timeOfInfo.
usec = m_infobasic->timestamp % 1000;
122 char ipinfo[20] = {0};
123 eo_common_ipv4addr_to_string(eo_nv_GetIP(m_nv), ipinfo,
sizeof(ipinfo));
124 info.sourceBoardIpAddrStr.clear();
125 info.sourceBoardIpAddrStr.append(ipinfo);
128 void InfoFormatter::getSeverityOfError(
EmbeddedInfo &info)
130 eOmn_info_type_t type =
static_cast<eOmn_info_type_t
>EOMN_INFO_PROPERTIES_FLAGS_get_type(m_infobasic->properties.flags);
153 if(m_MC_ethRes ==
nullptr)
std::string sourceBoardName
Diagnostic::TimeOfInfo timeOfInfo
eOipv4addr_t sourceBoardIpAddr
Diagnostic::EmbeddedInfo baseInfo
EntityNameProvider()=delete
bool getAxisName(uint32_t entityId, std::string &axisName)
virtual bool getEntityName(uint32_t entityId, std::string &entityName)
IethResource * getInterface(eOipv4addr_t ipv4, eOprotID32_t id32)
const string & getName(eOipv4addr_t ipv4)