DvsenseDriver  1.1.4
The SDK for dvsense products.
载入中...
搜索中...
未找到
ToolInfo.h
1#ifndef __TOOLINFO_H__
2#define __TOOLINFO_H__
3
4#include <vector>
5#include <string>
6#include <functional>
7
8#ifdef _WIN32
9 #ifdef DVSENSE_HAL_EXPORTS
10 #define DVSENSE_API __declspec(dllexport)
11 #else
12 #define DVSENSE_API __declspec(dllimport)
13 #endif
14#else
15#define DVSENSE_API
16#endif // _WIN32
17
18
19namespace dvsense
20{
26 enum class DVSENSE_API ToolType
27 {
28 TOOL_BIAS,
29 TOOL_TRIGGER_IN,
30 TOOL_SYNC,
31 TOOL_ANTI_FLICKER,
32 TOOL_EVENT_TRAIL_FILTER,
33 TOOL_EVENT_RATE_CONTROL,
34 TOOL_ROI,
35 TOOL_APS_CTRL
36 };
37
38 std::string DVSENSE_API to_string(ToolType type);
39
44 struct DVSENSE_API ToolInfo
45 {
46 ToolType tool_type;
47 std::string tool_name;
48 std::vector<std::string> parameter_names;
49 std::string description;
50 };
51
56 enum class DVSENSE_API ToolParameterType
57 {
58 INT,
59 FLOAT,
60 BOOL,
61 STRING,
62 ENUM
63 };
64
74 std::string DVSENSE_API ToolParameterTypeToString(ToolParameterType type);
75
83 struct DVSENSE_API BasicParameterInfo {
84 std::string name;
85 std::string description;
86 ToolParameterType type;
87 std::string toString() {
88 return "Name: " + name + " Description: " + description + " Type: " + ToolParameterTypeToString(type);
89 }
90 };
91
97 struct DVSENSE_API IntParameterInfo {
98 int min;
99 int max;
101 std::string unit;
102 std::function<bool(int&)> readValue;
103 std::function<bool(int)> writeValue;
104 std::string toString() {
105 return "Min: " + std::to_string(min) + " Max: " + std::to_string(max) + " Default: " + std::to_string(default_value) + " Unit: " + unit;
106 }
107 int constraintValue(int value) {
108 if (value < min) {
109 return min;
110 }
111 if (value > max) {
112 return max;
113 }
114 return value;
115 }
116 };
117
123 struct DVSENSE_API FloatParameterInfo {
124 float min;
125 float max;
127 std::string unit;
128 std::function<bool(float&)> readValue;
129 std::function<bool(float)> writeValue;
130 std::string toString() {
131 return "Min: " + std::to_string(min) + " Max: " + std::to_string(max) + " Default: " + std::to_string(default_value) + " Unit: " + unit;
132 }
133 float constraintValue(float value) {
134 if (value < min) {
135 return min;
136 }
137 if (value > max) {
138 return max;
139 }
140 return value;
141 }
142 };
143
149 struct DVSENSE_API BoolParameterInfo {
151 std::function<bool(bool&)> readValue;
152 std::function<bool(bool)> writeValue;
153 std::string toString() {
154 return "Default: " + std::to_string(default_value);
155 }
156 };
157
163 struct DVSENSE_API EnumParameterInfo {
164 std::vector<std::string> options;
165 std::string default_value;
166 std::function<bool(std::string&)> readValue;
167 std::function<bool(std::string)> writeValue;
168 std::string toString() {
169 return "Options: " + std::to_string(options.size()) + " Default: " + default_value;
170 }
171 };
172
173} // namespace dvsense
174
175
176#endif
定义 TypeUtils.hpp:9
std::string description
定义 ToolInfo.h:49
std::string DVSENSE_API to_string(ToolType type)
ToolType tool_type
定义 ToolInfo.h:46
std::vector< std::string > parameter_names
定义 ToolInfo.h:48
std::string DVSENSE_API ToolParameterTypeToString(ToolParameterType type)
将 ToolParameterType 转换为字符串。
std::string tool_name
定义 ToolInfo.h:47
工具的信息,包括类型、可以更改的参数名称和描述。
定义 ToolInfo.h:45
参数的基本信息,包括名称、描述和类型。\ 要获取详细信息,请参考 CameraTool::getParamInfo 。
定义 ToolInfo.h:83
ToolParameterType type
定义 ToolInfo.h:86
std::string toString()
定义 ToolInfo.h:87
std::string name
定义 ToolInfo.h:84
std::string description
定义 ToolInfo.h:85
布尔参数的详细信息。
定义 ToolInfo.h:149
std::string toString()
定义 ToolInfo.h:153
std::function< bool(bool &)> readValue
定义 ToolInfo.h:151
bool default_value
定义 ToolInfo.h:150
std::function< bool(bool)> writeValue
定义 ToolInfo.h:152
枚举参数的详细信息。
定义 ToolInfo.h:163
std::string toString()
定义 ToolInfo.h:168
std::vector< std::string > options
定义 ToolInfo.h:164
std::function< bool(std::string &)> readValue
定义 ToolInfo.h:166
std::function< bool(std::string)> writeValue
定义 ToolInfo.h:167
std::string default_value
定义 ToolInfo.h:165
浮点数参数的详细信息。
定义 ToolInfo.h:123
std::string unit
定义 ToolInfo.h:127
float default_value
定义 ToolInfo.h:126
std::string toString()
定义 ToolInfo.h:130
std::function< bool(float)> writeValue
定义 ToolInfo.h:129
std::function< bool(float &)> readValue
定义 ToolInfo.h:128
float max
定义 ToolInfo.h:125
float min
定义 ToolInfo.h:124
float constraintValue(float value)
定义 ToolInfo.h:133
整数参数的详细信息。
定义 ToolInfo.h:97
std::function< bool(int)> writeValue
定义 ToolInfo.h:103
int max
定义 ToolInfo.h:99
std::string toString()
定义 ToolInfo.h:104
std::function< bool(int &)> readValue
定义 ToolInfo.h:102
int min
定义 ToolInfo.h:98
std::string unit
定义 ToolInfo.h:101
int constraintValue(int value)
定义 ToolInfo.h:107
int default_value
定义 ToolInfo.h:100