Mech-Eye API 2.3.3
API reference documentation for Mech-Eye Industrial 3D Camera
Loading...
Searching...
No Matches
Parameter.h
1#pragma once
2#include <string>
3#include <memory>
4#include <map>
5#include <vector>
6#include "api_global.h"
7#include "ErrorStatus.h"
8#include "CommonTypes.h"
9
10namespace Json {
11class Value;
12}
13namespace mmind {
14
15class ZmqClientImpl;
16
17namespace eye {
18
22class MMIND_API_EXPORT Parameter
23{
24 friend class ParameterFactory;
25
26public:
39
40 virtual ~Parameter();
41
45 std::string name() const;
46
50 Type type() const;
51
55 std::string description() const;
56
60 bool isWritable() const;
61
65 bool isReadable() const;
66
67protected:
68 std::shared_ptr<class ParameterImpl> _impl;
69 Parameter(const std::string& name, const std::shared_ptr<ZmqClientImpl>& client,
70 const std::shared_ptr<Json::Value>& parameterInfo, bool needUpdateMaxAndMin = false,
71 bool isVirtual = false);
72};
73
77class MMIND_API_EXPORT IntParameter : public Parameter
78{
79public:
84
89
93 ErrorStatus getMin(int& min) const;
94
98 ErrorStatus getMax(int& max) const;
99
103 ErrorStatus getStep(int& step) const;
104
108 ErrorStatus getUnit(std::string& unit) const;
109
110protected:
111 using Parameter::Parameter;
112};
113
117class MMIND_API_EXPORT FloatParameter : public Parameter
118{
119public:
123 ErrorStatus getValue(double& value) const;
124
129
133 ErrorStatus getMin(double& min) const;
134
138 ErrorStatus getMax(double& max) const;
139
143 ErrorStatus getStep(double& step) const;
144
148 ErrorStatus getUnit(std::string& unit) const;
149
150protected:
151 using Parameter::Parameter;
152};
153
157class MMIND_API_EXPORT EnumParameter : public Parameter
158{
159public:
164
170
174 ErrorStatus getValue(std::string& valueStr) const;
175
179 ErrorStatus setValue(const std::string& value);
180
184 ErrorStatus getValues(std::map<std::string, int>& valueList) const;
185
186protected:
187 using Parameter::Parameter;
188};
189
193class MMIND_API_EXPORT BoolParameter : public Parameter
194{
195public:
200
205
206protected:
207 using Parameter::Parameter;
208};
209
213class MMIND_API_EXPORT RoiParameter : public Parameter
214{
215public:
220
225
230
231protected:
232 using Parameter::Parameter;
233};
234
238class MMIND_API_EXPORT RangeParameter : public Parameter
239{
240public:
245
250
254 ErrorStatus getMin(int& min) const;
255
259 ErrorStatus getMax(int& max) const;
260
264 ErrorStatus getStep(int& step) const;
265
269 ErrorStatus getUnit(std::string& unit) const;
270
271protected:
272 using Parameter::Parameter;
273};
274
278class MMIND_API_EXPORT FloatArrayParameter : public Parameter
279{
280public:
284 ErrorStatus getValue(std::vector<double>& value) const;
285
289 ErrorStatus setValue(const std::vector<double>& value);
290
294 ErrorStatus getMin(double& min) const;
295
299 ErrorStatus getMax(double& max) const;
300
304 ErrorStatus getMaxArraySize(int& maxSize) const;
305
309 ErrorStatus getStep(double& step) const;
310
314 ErrorStatus getUnit(std::string& unit) const;
315
316protected:
317 using Parameter::Parameter;
318};
319
320} // namespace eye
321} // namespace mmind
Represents a 2D container of data.
Definition Array2D.h:17
Represents a _Bool-type device parameter.
Definition Parameter.h:194
ErrorStatus setValue(bool value)
Sets the value of the device parameter.
ErrorStatus getValue(bool &value) const
Gets the current value of the device parameter.
Represents an _Enum-type device parameter.
Definition Parameter.h:158
ErrorStatus getValues(std::map< std::string, int > &valueList) const
Gets the list of available values of the device parameter in the form of a map.
ErrorStatus getValue(std::string &valueStr) const
Gets the current value of the device parameter in the form of a string.
ErrorStatus getValue(int &value) const
Gets the current value of the device parameter in the form of the integer value.
ErrorStatus setValue(int value)
Sets the value of the device parameter by inputting the integer value of an enumerator.
ErrorStatus setValue(const std::string &value)
Sets the value of the device parameter by inputting a string.
Represents a _FloatArray-type device parameter.
Definition Parameter.h:279
ErrorStatus getMin(double &min) const
Gets the minimum settable value of the device parameter.
ErrorStatus getMaxArraySize(int &maxSize) const
Gets the maximum settable size of the vector.
ErrorStatus getValue(std::vector< double > &value) const
Gets the current value of the device parameter.
ErrorStatus getUnit(std::string &unit) const
Gets the unit of the device parameter.
ErrorStatus getMax(double &max) const
Gets the maximum settable value of the device parameter.
ErrorStatus getStep(double &step) const
Gets the adjustment step size of the device parameter.
ErrorStatus setValue(const std::vector< double > &value)
Sets the value of the device parameter.
Represents a _Float-type device parameter.
Definition Parameter.h:118
ErrorStatus getStep(double &step) const
Gets the adjustment step size of the device parameter.
ErrorStatus setValue(double value)
Sets the value of the device parameter.
ErrorStatus getMin(double &min) const
Gets the minimum settable value of the device parameter.
ErrorStatus getValue(double &value) const
Gets the current value of the device parameter.
ErrorStatus getMax(double &max) const
Gets the maximum settable value of the device parameter.
ErrorStatus getUnit(std::string &unit) const
Gets the unit of the device parameter.
Represents an _Int-type device parameter.
Definition Parameter.h:78
ErrorStatus getUnit(std::string &unit) const
Gets the unit of the device parameter.
ErrorStatus getMax(int &max) const
Gets the maximum settable value of the device parameter.
ErrorStatus setValue(int value)
Sets the value of the device parameter.
ErrorStatus getMin(int &min) const
Gets the minimum settable value of the device parameter.
ErrorStatus getStep(int &step) const
Gets the adjustment step size of the device parameter.
ErrorStatus getValue(int &value) const
Gets the current value of the device parameter.
Represents a parameter of the device.
Definition Parameter.h:23
std::string description() const
Returns the description of the device parameter.
std::string name() const
Returns the name of the device parameter.
bool isWritable() const
Returns a Boolean value that indicates the write permission of the device parameter.
bool isReadable() const
Returns a Boolean value that indicates the read permission of the device parameter.
Type type() const
Returns the data type of the device parameter.
Type
Describes the device parameter data types.
Definition Parameter.h:30
@ _Int
Integer type.
Definition Parameter.h:31
@ _Roi
ROI type. See ROI for details.
Definition Parameter.h:35
@ _Enum
Enumeration type.
Definition Parameter.h:34
@ _Range
Range type. See Range for details.
Definition Parameter.h:36
@ _Float
Double type.
Definition Parameter.h:32
@ _Bool
Boolean type.
Definition Parameter.h:33
@ _FloatArray
Vector of double types.
Definition Parameter.h:37
Represents a _Range-type device parameter.
Definition Parameter.h:239
ErrorStatus getMax(int &max) const
Gets the maximum settable value of the device parameter.
ErrorStatus setValue(Range< int > value)
Sets the value of the device parameter.
ErrorStatus getStep(int &step) const
Gets the adjustment step size of the device parameter.
ErrorStatus getUnit(std::string &unit) const
Gets the unit of the device parameter.
ErrorStatus getValue(Range< int > &value) const
Gets the current value of the device parameter.
ErrorStatus getMin(int &min) const
Gets the minimum settable value of the device parameter.
Represents an _Roi-type device parameter.
Definition Parameter.h:214
ErrorStatus setValue(ROI value)
Sets the value of the device parameter.
ErrorStatus getValue(ROI &value) const
Gets the current value of the device parameter.
ErrorStatus getMaxRoiSize(Size &maxSize) const
Gets the maximum settable value of the device parameter.
Describes the types of errors.
Definition ErrorStatus.h:12
Describes a region of interest (ROI).
Definition CommonTypes.h:35
Describes a two-dimensional size with a width and a height.
Definition CommonTypes.h:22