DvsenseDriver  1.2.1
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 TOOL_ETH
37 };
38
39 std::string DVSENSE_API to_string(ToolType type);
40
45 struct DVSENSE_API ToolInfo
46 {
47 ToolType tool_type;
48 std::string tool_name;
49 std::vector<std::string> parameter_names;
50 std::string description;
51 };
52
57 enum class DVSENSE_API ToolParameterType
58 {
59 INT,
60 FLOAT,
61 BOOL,
62 STRING,
63 ENUM
64 };
65
75 std::string DVSENSE_API ToolParameterTypeToString(ToolParameterType type);
76
84 struct DVSENSE_API BasicParameterInfo {
85 std::string name;
86 std::string description;
87 ToolParameterType type;
88 std::string toString() {
89 return "Name: " + name + " Description: " + description + " Type: " + ToolParameterTypeToString(type);
90 }
91 };
92
98 struct DVSENSE_API IntParameterInfo {
99 int min;
100 int max;
102 std::string unit;
103 std::function<bool(int&)> readValue;
104 std::function<bool(int)> writeValue;
105 std::string toString() {
106 return "Min: " + std::to_string(min) + " Max: " + std::to_string(max) + " Default: " + std::to_string(default_value) + " Unit: " + unit;
107 }
108 int constraintValue(int value) {
109 if (value < min) {
110 return min;
111 }
112 if (value > max) {
113 return max;
114 }
115 return value;
116 }
117 };
118
124 struct DVSENSE_API FloatParameterInfo {
125 float min;
126 float max;
128 std::string unit;
129 std::function<bool(float&)> readValue;
130 std::function<bool(float)> writeValue;
131 std::string toString() {
132 return "Min: " + std::to_string(min) + " Max: " + std::to_string(max) + " Default: " + std::to_string(default_value) + " Unit: " + unit;
133 }
134 float constraintValue(float value) {
135 if (value < min) {
136 return min;
137 }
138 if (value > max) {
139 return max;
140 }
141 return value;
142 }
143 };
144
150 struct DVSENSE_API BoolParameterInfo {
152 std::function<bool(bool&)> readValue;
153 std::function<bool(bool)> writeValue;
154 std::string toString() {
155 return "Default: " + std::to_string(default_value);
156 }
157 };
158
164 struct DVSENSE_API EnumParameterInfo {
165 std::vector<std::string> options;
166 std::string default_value;
167 std::function<bool(std::string&)> readValue;
168 std::function<bool(std::string)> writeValue;
169 std::string toString() {
170 return "Options: " + std::to_string(options.size()) + " Default: " + default_value;
171 }
172 };
173
174 struct DVSENSE_API StringParameterInfo {
175 std::string default_value;
176 std::function<bool(std::string&)> readValue;
177 std::function<bool(std::string)> writeValue;
178 std::string toString() {
179 return " Default: " + default_value;
180 }
181 };
182
183} // namespace dvsense
184
185
186#endif
定义 TypeUtils.hpp:9
std::string description
定义 ToolInfo.h:50
std::string DVSENSE_API to_string(ToolType type)
ToolType tool_type
定义 ToolInfo.h:47
std::vector< std::string > parameter_names
定义 ToolInfo.h:49
std::string DVSENSE_API ToolParameterTypeToString(ToolParameterType type)
将 ToolParameterType 转换为字符串。
std::string tool_name
定义 ToolInfo.h:48
工具的信息,包括类型、可以更改的参数名称和描述。
定义 ToolInfo.h:46
参数的基本信息,包括名称、描述和类型。\ 要获取详细信息,请参考 CameraTool::getParamInfo 。
定义 ToolInfo.h:84
ToolParameterType type
定义 ToolInfo.h:87
std::string toString()
定义 ToolInfo.h:88
std::string name
定义 ToolInfo.h:85
std::string description
定义 ToolInfo.h:86
布尔参数的详细信息。
定义 ToolInfo.h:150
std::string toString()
定义 ToolInfo.h:154
std::function< bool(bool &)> readValue
定义 ToolInfo.h:152
bool default_value
定义 ToolInfo.h:151
std::function< bool(bool)> writeValue
定义 ToolInfo.h:153
枚举参数的详细信息。
定义 ToolInfo.h:164
std::string toString()
定义 ToolInfo.h:169
std::vector< std::string > options
定义 ToolInfo.h:165
std::function< bool(std::string &)> readValue
定义 ToolInfo.h:167
std::function< bool(std::string)> writeValue
定义 ToolInfo.h:168
std::string default_value
定义 ToolInfo.h:166
浮点数参数的详细信息。
定义 ToolInfo.h:124
std::string unit
定义 ToolInfo.h:128
float default_value
定义 ToolInfo.h:127
std::string toString()
定义 ToolInfo.h:131
std::function< bool(float)> writeValue
定义 ToolInfo.h:130
std::function< bool(float &)> readValue
定义 ToolInfo.h:129
float max
定义 ToolInfo.h:126
float min
定义 ToolInfo.h:125
float constraintValue(float value)
定义 ToolInfo.h:134
整数参数的详细信息。
定义 ToolInfo.h:98
std::function< bool(int)> writeValue
定义 ToolInfo.h:104
int max
定义 ToolInfo.h:100
std::string toString()
定义 ToolInfo.h:105
std::function< bool(int &)> readValue
定义 ToolInfo.h:103
int min
定义 ToolInfo.h:99
std::string unit
定义 ToolInfo.h:102
int constraintValue(int value)
定义 ToolInfo.h:108
int default_value
定义 ToolInfo.h:101
定义 ToolInfo.h:174
std::string default_value
定义 ToolInfo.h:175
std::function< bool(std::string &)> readValue
定义 ToolInfo.h:176
std::string toString()
定义 ToolInfo.h:178
std::function< bool(std::string)> writeValue
定义 ToolInfo.h:177