Mech-Eye API 2.2.1
API reference documentation for Mech-Eye 3D Laser Profiler
All Classes Functions Variables Typedefs 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 -10,
45
47
51
53 };
57 ErrorStatus() = default;
58
62 ErrorStatus(ErrorCode code, const std::string& message)
63 : errorCode(code), errorDescription(message)
64 {
65 }
66
70 bool isOK() const { return errorCode == MMIND_STATUS_SUCCESS; }
71
76
80 std::string errorDescription;
81};
82
86inline void showError(const mmind::eye::ErrorStatus& status)
87{
88 if (status.isOK())
89 return;
90 std::cout << "Error Code : " << status.errorCode
91 << ", Error Description: " << status.errorDescription << std::endl;
92}
93
94} // namespace eye
95
96} // 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:50
@ MMIND_STATUS_REPLY_WITH_ERROR
There are errors in the reply from device.
Definition ErrorStatus.h:44
@ MMIND_HANDEYE_CALIBRATION_EXECUTION_ERROR
An error occurred while executing the hand-eye calibration.
Definition ErrorStatus.h:42
@ MMIND_STATUS_ACQUISITION_TRIGGER_WAIT
Data acquisition has not been started.
Definition ErrorStatus.h:46
@ MMIND_STATUS_RESPONSE_PARSE_ERROR
It is error to parse the response from device.
Definition ErrorStatus.h:52
ErrorStatus()=default
Default constructor.
std::string errorDescription
Definition ErrorStatus.h:80
bool isOK() const
Returns true if the operation succeeds.
Definition ErrorStatus.h:70
ErrorStatus(ErrorCode code, const std::string &message)
Constructor.
Definition ErrorStatus.h:62