Mech-Eye API 2.6.0
API reference documentation for Mech-Eye 3D Laser Profiler
Loading...
Searching...
No Matches
ProfilerHandEyeErrorStatus.h
1#pragma once
2#include <string>
3#include <unordered_map>
4#include "api_global.h"
5
6namespace mmind {
7namespace eye {
8class MMIND_API_EXPORT ProfilerHandEyeErrorStatus
9{
10public:
11 enum ErrorCode {
12 MMIND_STATUS_SUCCESS = 0, //< Success.
13
14 // error code for truss robot calibration
15 MMIND_STATUS_INVALID_MATCHED_POINTS_COUNT = -1,
16 MMIND_STATUS_INVALID_POINTS_COUNT_CONFIG_PAIR = -2,
17
18 // error code for checking validity
19 MMIND_STATUS_INVALID_PARAM = -3,
20 MMIND_STATUS_EMPTY_PARAMS = -4,
21 MMIND_STATUS_INVALID_ROTATION_MATRIX = -5,
22
23 };
24
25 enum ErrorSource { System, Robot, Profiler };
26
27 ProfilerHandEyeErrorStatus() = default;
28 ProfilerHandEyeErrorStatus(ErrorCode code);
29 ProfilerHandEyeErrorStatus(ErrorCode code, ErrorSource source, const std::string& paraName);
30 bool isOK() const;
31 void setErrorCodeAndDescription(const ErrorCode& code);
32 void setErrorCodeAndDescription(const ErrorCode& code, const std::string& paraName);
33 std::string getErrorDescription() const;
34 ErrorCode getErrorCode() const;
35 ErrorSource getErrorSource() const;
36
37private:
38 static const std::unordered_map<ErrorCode, std::string> _errorInfoMap;
39 ErrorSource _errorSource = System;
40 ErrorCode _errorCode = MMIND_STATUS_SUCCESS;
41 std::string _errorDescription = "Success";
42};
43} // namespace eye
44} // namespace mmind