Mech-Eye API 2.2.2
API reference documentation for Mech-Eye 3D Laser Profiler
All Classes Functions Variables Typedefs Enumerations Enumerator Pages
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:
30 enum Type {
38 };
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};
72
76class MMIND_API_EXPORT IntParameter : public Parameter
77{
78public:
82 ErrorStatus getValue(int& value) const;
83
88
92 ErrorStatus getMin(int& min) const;
93
97 ErrorStatus getMax(int& max) const;
98
102 ErrorStatus getStep(int& step) const;
103
107 ErrorStatus getUnit(std::string& unit) const;
108
109protected:
110 using Parameter::Parameter;
111};
112
116class MMIND_API_EXPORT FloatParameter : public Parameter
117{
118public:
122 ErrorStatus getValue(double& value) const;
123
127 ErrorStatus setValue(double value);
128
132 ErrorStatus getMin(double& min) const;
133
137 ErrorStatus getMax(double& max) const;
138
142 ErrorStatus getStep(double& step) const;
143
147 ErrorStatus getUnit(std::string& unit) const;
148
149protected:
150 using Parameter::Parameter;
151};
152
156class MMIND_API_EXPORT EnumParameter : public Parameter
157{
158public:
162 ErrorStatus getValue(int& value) const;
163
169
173 ErrorStatus getValue(std::string& valueStr) const;
174
178 ErrorStatus setValue(const std::string& value);
179
183 ErrorStatus getValues(std::map<std::string, int>& valueList) const;
184
185protected:
186 using Parameter::Parameter;
187};
188
192class MMIND_API_EXPORT BoolParameter : public Parameter
193{
194public:
198 ErrorStatus getValue(bool& value) const;
199
204
205protected:
206 using Parameter::Parameter;
207};
208
212class MMIND_API_EXPORT RoiParameter : public Parameter
213{
214public:
218 ErrorStatus getValue(ROI& value) const;
219
224
229
230protected:
231 using Parameter::Parameter;
232};
233
237class MMIND_API_EXPORT RangeParameter : public Parameter
238{
239public:
244
249
253 ErrorStatus getMin(int& min) const;
254
258 ErrorStatus getMax(int& max) const;
259
263 ErrorStatus getStep(int& step) const;
264
268 ErrorStatus getUnit(std::string& unit) const;
269
270protected:
271 using Parameter::Parameter;
272};
273
277class MMIND_API_EXPORT FloatArrayParameter : public Parameter
278{
279public:
283 ErrorStatus getValue(std::vector<double>& value) const;
284
288 ErrorStatus setValue(const std::vector<double>& value);
289
293 ErrorStatus getMin(double& min) const;
294
298 ErrorStatus getMax(double& max) const;
299
303 ErrorStatus getMaxArraySize(int& maxSize) const;
304
308 ErrorStatus getStep(double& step) const;
309
313 ErrorStatus getUnit(std::string& unit) const;
314
315protected:
316 using Parameter::Parameter;
317};
318
319} // namespace eye
320} // namespace mmind
Represents a _Bool-type device parameter.
Definition Parameter.h:193
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:157
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:278
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:117
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:77
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:238
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:213
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 value range.
Definition CommonTypes.h:11
Describes a size with a width and a height.
Definition CommonTypes.h:22