iCub-main
Loading...
Searching...
No Matches
diagnosticLowLevelFormatter_hid.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT)
3 * All rights reserved.
4 *
5 * This software may be modified and distributed under the terms of the
6 * BSD-3-Clause license. See the accompanying LICENSE file for details.
7 */
8
9
10#ifndef __diagnosticLowLevelFormatter_hid_h__
11#define __diagnosticLowLevelFormatter_hid_h__
12
13#include <string>
14#include <string_view>
15#include <memory>
16#include <array>
17#include <yarp/os/LogStream.h>
18#include <yarp/os/Log.h>
20#include "EoError.h"
21
22#include "IethResource.h"
23
24
25namespace Diagnostic {
26 namespace LowLevel {
27 class DefaultParser;
28 class ConfigParser;
29 class MotionControlParser;
30 class SkinParser;
31 class HwErrorParser;
32 class SysParser;
33 class EthMonitorParser;
34 class InertialSensorParser;
35 class AnalogSensorParser;
36 class AuxEmbeddedInfo;
37 class EntityNameProvider;
38 }
39}
40
41constexpr int diagstr_lenght = 64;
42typedef char diagstr[diagstr_lenght];
43
44//In this class the Info formatter and the parsers collect the embedded diagnostic Info.
45//Only the info contained in Diagnostic::EmbeddedInfo baseInfo are usefull for the user level.
47{
48public:
50 eOipv4addr_t sourceBoardIpAddr; // is the ipv4 address, in eOipv4addr_t, of the board that sends the diagnostic information
51 eOerror_code_t errorCode; // this is the error code sent by the board;
52 std::string baseMessage; //this is the base message string without any parameter
53 std::string extraMessage;// in some case, the board can send an extra string
54 uint64_t param64; // the 64 bits paramter sent by the board
55 uint16_t param16; //the 16 bits parameter sent by the board
56
57public:
59};
60
61
62//This class has the goal to provide the name of an entity (axis, sensors, etc) to the parsers.
64{
65public:
66 EntityNameProvider(eOipv4addr_t boardAddr, eth::TheEthManager* ethManager);
71private:
72 eth::TheEthManager* m_ethManager;
73 eth::IethResource* m_MC_ethRes;
74public:
75 bool getAxisName(uint32_t entityId, std::string &axisName);
76 bool getEncoderTypeName(uint32_t jomoId, eOmc_position_t pos, std::string &encoderTypeName);
77};
78
79
80
98
110
111
113{
114public:
120
121 void parseInfo();
122
123private:
124std::string motorStatusBitsToString(eOmc_motorFaultState_t motorstatus);
125};
126
138
152
154{
155public:
157 SysParser() = delete;
161
162 void parseInfo();
163
164private:
165void canMask2canBoardsStr(uint16_t canmask, diagstr canboardsstr);
166void getCanMonitorInfo(eOmn_serv_category_t &serv_category, diagstr boardsOnCan1, diagstr boardsOnCan2);
167void getCanMonitorInfoWithTime(eOmn_serv_category_t &serv_category, diagstr boardsOnCan1, diagstr boardsOnCan2, uint32_t &time);
168};
169
170
183
195
207
208
209
210#endif //__diagnosticLowLevelFormatter_hid_h__
AnalogSensorParser(Diagnostic::LowLevel::AnalogSensorParser &&parser)=delete
AnalogSensorParser(const Diagnostic::LowLevel::AnalogSensorParser &parser)=delete
ConfigParser(const Diagnostic::LowLevel::ConfigParser &parser)=delete
ConfigParser(Diagnostic::LowLevel::ConfigParser &&parser)=delete
DefaultParser(const Diagnostic::LowLevel::DefaultParser &parser)=delete
DefaultParser(Diagnostic::LowLevel::DefaultParser &&parser)=delete
Diagnostic::LowLevel::EntityNameProvider & m_entityNameProvider
Diagnostic::LowLevel::AuxEmbeddedInfo & m_dnginfo
EntityNameProvider(const Diagnostic::LowLevel::EntityNameProvider &EntityNameProvider)
bool getEncoderTypeName(uint32_t jomoId, eOmc_position_t pos, std::string &encoderTypeName)
EntityNameProvider(const Diagnostic::LowLevel::EntityNameProvider &&EntityNameProvider)
bool getAxisName(uint32_t entityId, std::string &axisName)
EthMonitorParser(const Diagnostic::LowLevel::EthMonitorParser &parser)=delete
EthMonitorParser(Diagnostic::LowLevel::EthMonitorParser &&parser)=delete
HwErrorParser(Diagnostic::LowLevel::HwErrorParser &&parser)=delete
HwErrorParser(const Diagnostic::LowLevel::HwErrorParser &parser)=delete
InertialSensorParser(const Diagnostic::LowLevel::InertialSensorParser &parser)=delete
InertialSensorParser(Diagnostic::LowLevel::InertialSensorParser &&parser)=delete
MotionControlParser(const Diagnostic::LowLevel::MotionControlParser &parser)=delete
MotionControlParser(Diagnostic::LowLevel::MotionControlParser &&parser)=delete
SkinParser(Diagnostic::LowLevel::SkinParser &&parser)=delete
SkinParser(const Diagnostic::LowLevel::SkinParser &parser)=delete
SysParser(const Diagnostic::LowLevel::SysParser &parser)=delete
SysParser(Diagnostic::LowLevel::SysParser &&parser)=delete
char diagstr[diagstr_lenght]
constexpr int diagstr_lenght
degrees time
Definition sine.m:5