43 #ifndef _MLAB_SCITOS_FUNCTION_BLOCK_ERROR_MEMORY_H_ 44 #define _MLAB_SCITOS_FUNCTION_BLOCK_ERROR_MEMORY_H_ 48 namespace mira {
namespace robot {
68 template <
typename Reflector>
74 r.member(
"ErrorCode",
code,
"");
75 r.member(
"ErrorName",
name,
"");
76 r.member(
"ErrorData",
data,
"");
99 template <
typename Reflector>
102 r.member(
"Node",
node,
"");
112 template <
typename Reflector>
119 r.member(
"ErrorList",
errors,
"");
148 template <
typename Reflector>
153 r.roproperty(
"ErrorCount",
155 "Number of errors in error memory");
156 r.roproperty(
"LastErrorTime",
158 "The time of the last error in local time.");
160 std::string methodPrefix;
161 if (mRPCPrefix.size() > 0)
162 methodPrefix = mRPCPrefix+
"_";
164 r.method((methodPrefix+
"getErrorInfo").c_str(),
166 "Read out a single error from the error memory.",
167 "index",
"Error index", 0);
168 r.method((methodPrefix+
"readoutErrorMemory").c_str(),
170 "Readout the error memory.");
171 r.method((methodPrefix+
"exportErrorMemoryToFile").c_str(),
173 "Readout the error memory and export to a json file.",
174 "filename",
"Report file name",
"report.json");
175 r.method((methodPrefix+
"clearErrorMemory").c_str(),
177 "Clear the error memory.");
196 void addErrorCode(uint32 code,
const std::string& name);
199 std::string mRPCPrefix;
200 std::map<uint32, std::string> mErrorCodes;
std::vector< ErrorInfo > errors
Definition: ErrorMemory.h:125
virtual ~ErrorMemory()
Definition: ErrorMemory.h:145
ErrorMemory(const std::string &rpcPrefix)
Definition: ErrorMemory.h:139
ModuleInfo moduleInfo
Definition: ErrorMemory.h:124
ErrorInfo()
Definition: ErrorMemory.h:62
uint32 code
Definition: ErrorMemory.h:81
#define MIRA_REFLECT_BASE(reflector, BaseClass)
std::string reportTimeStr
Definition: ErrorMemory.h:123
Information for one error in the error memory.
Definition: ErrorMemory.h:60
Time reportTime
Definition: ErrorMemory.h:122
void addErrorCode(uint32 code, const std::string &name)
void exportErrorMemoryToFile(const std::string &path)
void reflect(Reflector &r)
Definition: ErrorMemory.h:69
uint32 serialNumber
Definition: ErrorMemory.h:91
uint32 data[8]
Definition: ErrorMemory.h:83
ErrorInfo getErrorInfo(uint32 idx) const
uint32 timeUnix
Definition: ErrorMemory.h:79
std::string timeLocal
Definition: ErrorMemory.h:80
ErrorMemory()
Definition: ErrorMemory.h:134
#define MIRA_OBJECT(classIdentifier)
Report readoutErrorMemory() const
uint32 functionBlockID
ID of the function block.
Definition: FunctionBlock.h:84
ModuleInfo()
Definition: ErrorMemory.h:94
Definition: FunctionBlock.h:53
uint32 getErrorCount() const
uint32 hardwareVersion
Definition: ErrorMemory.h:89
uint32 softwareVersion
Definition: ErrorMemory.h:90
Basic module information (versions, etc.) for an error report.
Definition: ErrorMemory.h:87
Base class for different SCITOS CAN function blocks.
std::string name
Definition: ErrorMemory.h:82
Definition: ErrorMemory.h:52
An error report.
Definition: ErrorMemory.h:111
void reflect(Reflector &r)
Definition: ErrorMemory.h:113
void reflect(Reflector &r)
Definition: ErrorMemory.h:100
uint32 productID
Definition: ErrorMemory.h:92
void reflect(Reflector &r)
Reflect for serialization.
Definition: ErrorMemory.h:149
uint8 node
Definition: ErrorMemory.h:88
Time getLastErrorTime() const