Mech-Eye API 2.4.0
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:
41
42 virtual ~Parameter();
43
47 std::string name() const;
48
52 Type type() const;
53
57 std::string description() const;
58
62 bool isWritable() const;
63
67 bool isReadable() const;
68
69protected:
70 std::shared_ptr<class ParameterImpl> _impl;
71 Parameter(const std::string& name, const std::shared_ptr<ZmqClientImpl>& client,
72 const std::shared_ptr<Json::Value>& parameterInfo, bool needUpdateMaxAndMin = false,
73 bool isVirtual = false);
74};
75
79class MMIND_API_EXPORT IntParameter : public Parameter
80{
81public:
86
91
95 ErrorStatus getMin(int& min) const;
96
100 ErrorStatus getMax(int& max) const;
101
105 ErrorStatus getStep(int& step) const;
106
110 ErrorStatus getUnit(std::string& unit) const;
111
112protected:
113 using Parameter::Parameter;
114};
115
119class MMIND_API_EXPORT FloatParameter : public Parameter
120{
121public:
125 ErrorStatus getValue(double& value) const;
126
131
135 ErrorStatus getMin(double& min) const;
136
140 ErrorStatus getMax(double& max) const;
141
145 ErrorStatus getStep(double& step) const;
146
150 ErrorStatus getUnit(std::string& unit) const;
151
152protected:
153 using Parameter::Parameter;
154};
155
159class MMIND_API_EXPORT EnumParameter : public Parameter
160{
161public:
166
172
176 ErrorStatus getValue(std::string& valueStr) const;
177
181 ErrorStatus setValue(const std::string& value);
182
186 ErrorStatus getValues(std::map<std::string, int>& valueList) const;
187
188protected:
189 using Parameter::Parameter;
190};
191
195class MMIND_API_EXPORT BoolParameter : public Parameter
196{
197public:
202
207
208protected:
209 using Parameter::Parameter;
210};
211
215class MMIND_API_EXPORT RoiParameter : public Parameter
216{
217public:
222
227
232
233protected:
234 using Parameter::Parameter;
235};
236
240class MMIND_API_EXPORT ProfileRoiParameter : public Parameter
241{
242public:
247
252
257
262
263protected:
264 using Parameter::Parameter;
265};
266
270class MMIND_API_EXPORT RoiArrayParameter : public Parameter
271{
272public:
276 ErrorStatus getValue(std::vector<ROI>& value) const;
277
278protected:
279 using Parameter::Parameter;
280};
281
285class MMIND_API_EXPORT RangeParameter : public Parameter
286{
287public:
292
297
301 ErrorStatus getMin(int& min) const;
302
306 ErrorStatus getMax(int& max) const;
307
311 ErrorStatus getStep(int& step) const;
312
316 ErrorStatus getUnit(std::string& unit) const;
317
318protected:
319 using Parameter::Parameter;
320};
321
325class MMIND_API_EXPORT FloatArrayParameter : public Parameter
326{
327public:
331 ErrorStatus getValue(std::vector<double>& value) const;
332
336 ErrorStatus setValue(const std::vector<double>& value);
337
341 ErrorStatus getMin(double& min) const;
342
346 ErrorStatus getMax(double& max) const;
347
351 ErrorStatus getMaxArraySize(int& maxSize) const;
352
356 ErrorStatus getStep(double& step) const;
357
361 ErrorStatus getUnit(std::string& unit) const;
362
363protected:
364 using Parameter::Parameter;
365};
366
367} // namespace eye
368} // namespace mmind
Represents a 2D container of data.
Definition Array2D.h:17
Represents a _Bool-type device parameter.
Definition Parameter.h:196
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:160
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:326
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:120
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:80
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
@ _RoiArray
Vector of ROI types.
Definition Parameter.h:38
@ _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 an _ProfileRoi-type device parameter.
Definition Parameter.h:241
ErrorStatus getMinRoiSize(SizeF &minSize) const
Gets the minimum settable value of the device parameter.
ErrorStatus getValue(ProfileROI &value) const
Gets the current value of the device parameter.
ErrorStatus getMaxRoiSize(SizeF &maxSize) const
Gets the maximum settable value of the device parameter.
ErrorStatus setValue(ProfileROI value)
Sets the value of the device parameter.
Represents a _Range-type device parameter.
Definition Parameter.h:286
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 _RoiArray-type device parameter.
Definition Parameter.h:271
ErrorStatus getValue(std::vector< ROI > &value) const
Gets the current value of the device parameter.
Represents an _Roi-type device parameter.
Definition Parameter.h:216
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 the region of interest (ROI) of a laser profiler.
Definition CommonTypes.h:74
Describes a region of interest (ROI).
Definition CommonTypes.h:56
Describes a two-dimensional size with a width and a height using double-precision floating-point numb...
Definition CommonTypes.h:43
Describes a two-dimensional size with a width and a height.
Definition CommonTypes.h:29