Mech-Eye API 2.2.0
API reference documentation for Mech-Eye Industrial 3D Camera
All Classes Functions Variables Enumerations Enumerator Pages
ErrorStatus.h
1#pragma once
2#include <string>
3#include <iostream>
4
5namespace mmind {
6
7namespace eye {
12{
16 enum ErrorCode {
19 -1,
23 -3,
29 -5,
32 -6,
34 -7,
37 -8,
40 -9,
43 -100,
46 -101,
48
52
54
56 };
60 ErrorStatus() = default;
61
65 ErrorStatus(ErrorCode code, const std::string& message)
66 : errorCode(code), errorDescription(message)
67 {
68 }
69
73 bool isOK() const { return errorCode == MMIND_STATUS_SUCCESS; }
74
79
83 std::string errorDescription;
84};
85
89inline void showError(const mmind::eye::ErrorStatus& status)
90{
91 if (status.isOK())
92 return;
93 std::cout << "Error Code : " << status.errorCode
94 << ", Error Description: " << status.errorDescription << std::endl;
95}
96
97} // namespace eye
98
99} // namespace mmind
Describes the types of errors.
Definition ErrorStatus.h:12
ErrorCode
Describes the error codes.
Definition ErrorStatus.h:16
@ MMIND_STATUS_SUCCESS
Success.
Definition ErrorStatus.h:17
@ MMIND_STATUS_NO_DATA_ERROR
The image data is empty. Some error may have occurred on the device.
Definition ErrorStatus.h:31
@ MMIND_STATUS_DEVICE_OFFLINE
Device is offline. Network issue may be present.
Definition ErrorStatus.h:21
@ MMIND_STATUS_INVALID_CALLBACKFUNC
The registered callback function is invalid.
Definition ErrorStatus.h:51
@ MMIND_HANDEYE_CALIBRATION_POSES_INSUFFICIENT
Error: insufficient calibration poses.
Definition ErrorStatus.h:45
@ MMIND_STATUS_REPLY_WITH_ERROR
There are errors in the reply from device.
Definition ErrorStatus.h:55
@ MMIND_HANDEYE_CALIBRATION_PATTERN_IMAGE_ERROR
Definition ErrorStatus.h:42
@ MMIND_STATUS_ACQUISITION_TRIGGER_WAIT
Data acquisition has not been started.
Definition ErrorStatus.h:47
@ MMIND_STATUS_RESPONSE_PARSE_ERROR
It is error to parse the response from device.
Definition ErrorStatus.h:53
ErrorStatus()=default
Default constructor.
std::string errorDescription
Definition ErrorStatus.h:83
bool isOK() const
Returns true if the operation succeeds.
Definition ErrorStatus.h:73
ErrorStatus(ErrorCode code, const std::string &message)
Constructor.
Definition ErrorStatus.h:65