Mech-Eye API Reference 2.1.4-alpha
API reference documentation for Mech-Eye 3D Laser Profiler
All Classes Functions Variables 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 mmind {
11
12namespace eye {
13
18{
19public:
20
24 enum Type {
32 };
33
34 MMIND_API_EXPORT virtual ~Parameter();
35
39 MMIND_API_EXPORT std::string name() const;
40
44 MMIND_API_EXPORT Type type() const;
45
49 MMIND_API_EXPORT std::string description() const;
50
54 MMIND_API_EXPORT bool isWritable() const;
55
59 MMIND_API_EXPORT bool isReadable() const;
60
61protected:
62 std::shared_ptr<class ParameterImpl> _impl;
63 bool _needUpdateMaxAndMin;
64 Parameter(const std::string& name, const std::shared_ptr<class ParameterImpl>& impl,
65 bool needUpdateMaxAndMin = false);
66
67private:
68 const std::string _name;
69 friend class ParameterFactory;
70};
71
75class IntParameter : public Parameter
76{
77public:
78
82 MMIND_API_EXPORT ErrorStatus getValue(int& value) const;
83
87 MMIND_API_EXPORT ErrorStatus setValue(int value);
88
92 MMIND_API_EXPORT ErrorStatus getMin(int& min) const;
93
97 MMIND_API_EXPORT ErrorStatus getMax(int& max) const;
98
102 MMIND_API_EXPORT ErrorStatus getStep(int& step) const;
103
107 MMIND_API_EXPORT ErrorStatus getUnit(std::string& unit) const;
108
109protected:
110 using Parameter::Parameter;
111};
112
117{
118public:
119
123 MMIND_API_EXPORT ErrorStatus getValue(double& value) const;
124
128 MMIND_API_EXPORT ErrorStatus setValue(double value);
129
133 MMIND_API_EXPORT ErrorStatus getMin(double& min) const;
134
138 MMIND_API_EXPORT ErrorStatus getMax(double& max) const;
139
143 MMIND_API_EXPORT ErrorStatus getStep(double& step) const;
144
148 MMIND_API_EXPORT ErrorStatus getUnit(std::string& unit) const;
149
150protected:
151 using Parameter::Parameter;
152};
153
158{
159public:
160
164 MMIND_API_EXPORT ErrorStatus getValue(int& value) const;
165
169 MMIND_API_EXPORT ErrorStatus setValue(int value);
170
174 MMIND_API_EXPORT ErrorStatus getValue(std::string& value) const;
175
179 MMIND_API_EXPORT ErrorStatus setValue(const std::string& value);
180
184 MMIND_API_EXPORT ErrorStatus getValues(std::map<std::string, int>& valueList) const;
185
186protected:
187 using Parameter::Parameter;
188};
189
194{
195public:
196
200 MMIND_API_EXPORT ErrorStatus getValue(bool& value) const;
201
205 MMIND_API_EXPORT ErrorStatus setValue(bool value);
206
207protected:
208 using Parameter::Parameter;
209};
210
215{
216public:
217
221 MMIND_API_EXPORT ErrorStatus getValue(ROI& value) const;
222
226 MMIND_API_EXPORT ErrorStatus setValue(ROI value);
227
231 MMIND_API_EXPORT ErrorStatus getMaxRoiSize(Size& maxSize) const;
232
233protected:
234 using Parameter::Parameter;
235};
236
241{
242public:
243
247 MMIND_API_EXPORT ErrorStatus getValue(Range<int>& value) const;
248
252 MMIND_API_EXPORT ErrorStatus setValue(Range<int> value);
253
257 MMIND_API_EXPORT ErrorStatus getMin(int& min) const;
258
262 MMIND_API_EXPORT ErrorStatus getMax(int& max) const;
263
267 MMIND_API_EXPORT ErrorStatus getStep(int& step) const;
268
272 MMIND_API_EXPORT ErrorStatus getUnit(std::string& unit) const;
273
274protected:
275 using Parameter::Parameter;
276};
277
282{
283public:
284
288 MMIND_API_EXPORT ErrorStatus getValue(std::vector<double>& value) const;
289
293 MMIND_API_EXPORT ErrorStatus setValue(const std::vector<double>& value);
294
298 MMIND_API_EXPORT ErrorStatus getMin(double& min) const;
299
303 MMIND_API_EXPORT ErrorStatus getMax(double& max) const;
304
308 MMIND_API_EXPORT ErrorStatus getMaxArraySize(int& maxSize) const;
309
313 MMIND_API_EXPORT ErrorStatus getStep(double& step) const;
314
318 MMIND_API_EXPORT ErrorStatus getUnit(std::string& unit) const;
319
320protected:
321 using Parameter::Parameter;
322};
323
324} // namespace eye
325} // namespace mmind
Represents a _Bool-type device parameter.
Definition Parameter.h:194
MMIND_API_EXPORT ErrorStatus setValue(bool value)
Sets the value of the device parameter.
MMIND_API_EXPORT ErrorStatus getValue(bool &value) const
Gets the current value of the device parameter.
Represents an _Enum-type device parameter.
Definition Parameter.h:158
MMIND_API_EXPORT ErrorStatus setValue(const std::string &value)
Sets the value of the device parameter by inputting a string.
MMIND_API_EXPORT ErrorStatus getValue(std::string &value) const
Gets the current value of the device parameter in the form of a string.
MMIND_API_EXPORT ErrorStatus setValue(int value)
Sets the value of the device parameter by inputting the integer value of an enumerator.
MMIND_API_EXPORT ErrorStatus getValue(int &value) const
Gets the current value of the device parameter in the form of the integer value of the enumerator.
MMIND_API_EXPORT 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.
Represents a _FloatArray-type device parameter.
Definition Parameter.h:282
MMIND_API_EXPORT ErrorStatus getMaxArraySize(int &maxSize) const
Gets the maximum settable size of the vector.
MMIND_API_EXPORT ErrorStatus getMax(double &max) const
Gets the maximum settable value of the device parameter.
MMIND_API_EXPORT ErrorStatus getMin(double &min) const
Gets the minimum settable value of the device parameter.
MMIND_API_EXPORT ErrorStatus getUnit(std::string &unit) const
Gets the unit of the device parameter.
MMIND_API_EXPORT ErrorStatus getValue(std::vector< double > &value) const
Gets the current value of the device parameter.
MMIND_API_EXPORT ErrorStatus getStep(double &step) const
Gets the adjustment step size of the device parameter.
MMIND_API_EXPORT ErrorStatus setValue(const std::vector< double > &value)
Sets the value of the device parameter.
Represents a _Float-type device parameter.
Definition Parameter.h:117
MMIND_API_EXPORT ErrorStatus getStep(double &step) const
Gets the adjustment step size of the device parameter.
MMIND_API_EXPORT ErrorStatus getMax(double &max) const
Gets the maximum settable value of the device parameter.
MMIND_API_EXPORT ErrorStatus getMin(double &min) const
Gets the minimum settable value of the device parameter.
MMIND_API_EXPORT ErrorStatus getValue(double &value) const
Gets the current value of the device parameter.
MMIND_API_EXPORT ErrorStatus getUnit(std::string &unit) const
Gets the unit of the device parameter.
MMIND_API_EXPORT ErrorStatus setValue(double value)
Sets the value of the device parameter.
Represents an _Int-type device parameter.
Definition Parameter.h:76
MMIND_API_EXPORT ErrorStatus setValue(int value)
Sets the value of the device parameter.
MMIND_API_EXPORT ErrorStatus getStep(int &step) const
Gets the adjustment step size of the device parameter.
MMIND_API_EXPORT ErrorStatus getMin(int &min) const
Gets the minimum settable value of the device parameter.
MMIND_API_EXPORT ErrorStatus getMax(int &max) const
Gets the maximum settable value of the device parameter.
MMIND_API_EXPORT ErrorStatus getUnit(std::string &unit) const
Gets the unit of the device parameter.
MMIND_API_EXPORT ErrorStatus getValue(int &value) const
Gets the current value of the device parameter.
Represents a parameter of the device.
Definition Parameter.h:18
MMIND_API_EXPORT Type type() const
Returns the data type of the device parameter.
MMIND_API_EXPORT bool isWritable() const
Returns a Boolean value that indicates the write permission of the device parameter.
MMIND_API_EXPORT bool isReadable() const
Returns a Boolean value that indicates the read permission of the device parameter.
MMIND_API_EXPORT std::string name() const
Returns the name of the device parameter.
Type
The device parameter data types.
Definition Parameter.h:24
@ _Int
Integer type.
Definition Parameter.h:25
@ _Roi
ROI type. See ROI for details.
Definition Parameter.h:29
@ _Enum
Enumeration type.
Definition Parameter.h:28
@ _Range
Range type. See Range for details.
Definition Parameter.h:30
@ _Float
Double type.
Definition Parameter.h:26
@ _Bool
Boolean type.
Definition Parameter.h:27
@ _FloatArray
Vector of double types.
Definition Parameter.h:31
MMIND_API_EXPORT std::string description() const
Returns the description of the device parameter.
Represents a _Range-type device parameter.
Definition Parameter.h:241
MMIND_API_EXPORT ErrorStatus getMax(int &max) const
Gets the maximum settable value of the device parameter.
MMIND_API_EXPORT ErrorStatus getUnit(std::string &unit) const
Gets the unit of the device parameter.
MMIND_API_EXPORT ErrorStatus setValue(Range< int > value)
Sets the value of the device parameter.
MMIND_API_EXPORT ErrorStatus getValue(Range< int > &value) const
Gets the current value of the device parameter.
MMIND_API_EXPORT ErrorStatus getMin(int &min) const
Gets the minimum settable value of the device parameter.
MMIND_API_EXPORT ErrorStatus getStep(int &step) const
Gets the adjustment step size of the device parameter.
Represents an _Roi-type device parameter.
Definition Parameter.h:215
MMIND_API_EXPORT ErrorStatus getMaxRoiSize(Size &maxSize) const
Gets the maximum settable value of the device parameter.
MMIND_API_EXPORT ErrorStatus getValue(ROI &value) const
Gets the current value of the device parameter.
MMIND_API_EXPORT ErrorStatus setValue(ROI value)
Sets the value of the device parameter.
The types of errors.
Definition ErrorStatus.h:11
A region of interest.
Definition CommonTypes.h:35
A value range.
Definition CommonTypes.h:11
A size with a width and a height.
Definition CommonTypes.h:22