Gocator Development Kit
 All Classes Files Functions Variables Typedefs Friends Modules Pages
GdkParamInfo.h
Go to the documentation of this file.
1 /**
2 * @file GdkParamInfo.h
3 * @brief Declares the GdkParamInfo class.
4 *
5 * Copyright (C) 2015-2022 by LMI Technologies Inc. All rights reserved.
6 */
7 #ifndef GDK_EXT_PARAM_INFO_H
8 #define GDK_EXT_PARAM_INFO_H
9 
10 #include <Gdk/GdkDef.h>
11 
12 /**
13 * Represents the schema of a configurable parameter.
14 *
15 * @class GdkParamInfo
16 * @extends kObject
17 * @ingroup Gdk-Config
18 */
19 typedef kObject GdkParamInfo;
21 
22 /**
23 * @struct GdkParamType
24 * @extends kValue
25 * @ingroup Gdk-Config
26 * @brief Type of a parameter.
27 */
28 typedef k32s GdkParamType;
29 
30 /** @relates GdkParamType @{ */
31 #define GDK_PARAM_TYPE_UNKNOWN (-1) ///< Not yet set.
32 #define GDK_PARAM_TYPE_INT (0) ///< Integer.
33 #define GDK_PARAM_TYPE_FLOAT (1) ///< Float.
34 #define GDK_PARAM_TYPE_BOOL (2) ///< Boolean.
35 #define GDK_PARAM_TYPE_STRING (3) ///< String.
36 #define GDK_PARAM_TYPE_PROFILE_REGION (4) ///< Profile region.
37 #define GDK_PARAM_TYPE_SURFACE_REGION (5) ///< Surface region 3D.
38 #define GDK_PARAM_TYPE_SURFACE_REGION_2D (6) ///< Surface 2D region (X and Y).
39 #define GDK_PARAM_TYPE_GEOMETRIC_FEATURE (7) ///< A set of geometric features
40 #define GDK_PARAM_TYPE_MEASUREMENT (8) ///< Measurement (future)
41 #define GDK_PARAM_TYPE_DATA_INPUT (9) ///< Data Input
42 #define GDK_PARAM_TYPE_POINT_SET_REGION (10) ///< Point set region
43 /** @} */
44 
45 /**
46 * Returns the parameter type.
47 *
48 * @public @memberof GdkParamInfo
49 * @param info Info object.
50 * @return Parameter type.
51 */
52 GdkFx(GdkParamType) GdkParamInfo_Type(GdkParamInfo info);
53 
54 /**
55 * Returns whether the info object is of type input data set.
56 *
57 * @public @memberof GdkParamInfo
58 * @param info Info object.
59 * @return kTRUE if so, kFALSE if not.
60 */
62 
63 /**
64 * Sets the name of the parameter.
65 *
66 * @public @memberof GdkParamInfo
67 * @param info Info object.
68 * @param name Parameter name.
69 * @return Operation status.
70 */
71 GdkFx(kStatus) GdkParamInfo_SetName(GdkParamInfo info, const kChar* name);
72 
73 /**
74 * Returns the name of the parameter.
75 *
76 * @public @memberof GdkParamInfo
77 * @param info Info object.
78 * @return Parameter name.
79 */
80 GdkFx(const kChar*) GdkParamInfo_Name(GdkParamInfo info);
81 
82 /**
83 * Sets a parameter to be optional or not. This is only used for backward
84 * compatibility with auto versioning.
85 *
86 * @public @memberof GdkParamInfo
87 * @param info Info object.
88 * @param optional Whether or not parameter is optional.
89 * @return Operation status.
90 */
92 
93 /**
94 * Returns whether or not the parameter is optional.
95 *
96 * @public @memberof GdkParamInfo
97 * @param info Info object.
98 * @return Is optional.
99 */
101 
102 /**
103 * Sets the display label of the parameter.
104 *
105 * @public @memberof GdkParamInfo
106 * @param info Info object.
107 * @param label Parameter label.
108 * @return Operation status.
109 */
110 GdkFx(kStatus) GdkParamInfo_SetLabel(GdkParamInfo info, const kChar* label);
111 
112 /**
113 * Returns the display label of the parameter.
114 *
115 * @public @memberof GdkParamInfo
116 * @param info Info object.
117 * @return Parameter label.
118 */
119 GdkFx(const kChar*) GdkParamInfo_Label(GdkParamInfo info);
120 
121 /**
122 * Sets the units of the parameter.
123 *
124 * It is optional to specify the units.
125 *
126 * @public @memberof GdkParamInfo
127 * @param info Info object.
128 * @param units Parameter units.
129 * @return Operation status.
130 */
131 GdkFx(kStatus) GdkParamInfo_SetUnits(GdkParamInfo info, const kChar* units);
132 
133 /**
134 * Returns the units of the parameter.
135 *
136 * @public @memberof GdkParamInfo
137 * @param info Info object.
138 * @return Parameter units (empty string if not set).
139 */
140 GdkFx(const kChar*) GdkParamInfo_Units(GdkParamInfo info);
141 
142 /**
143 * Returns the number of options for the parameter.
144 *
145 * @public @memberof GdkParamInfo
146 * @param info Info object.
147 * @return Number of options.
148 */
150 
151 /**
152 * Returns the option name at a specified index.
153 *
154 * @public @memberof GdkParamInfo
155 * @param info Info object.
156 * @param index Option index.
157 * @return Option name.
158 */
159 GdkFx(const kChar*) GdkParamInfo_OptionNameAt(GdkParamInfo info, kSize index);
160 
161 /**
162 * Remove the option at a specified index.
163 *
164 * @public @memberof GdkParamInfo
165 * @param info Info object.
166 * @param index Option index.
167 * @return Operation status.
168 */
170 
171 /**
172 * Clears all options for the parameter.
173 *
174 * @public @memberof GdkParamInfo
175 * @param info Info object.
176 * @return Operation status.
177 */
179 
180 /**
181 * Sets the minimum value for an integer parameter.
182 *
183 * @public @memberof GdkParamInfo
184 * @param info Info object.
185 * @param min Minimum value.
186 * @return Operation status.
187 */
189 
190 /**
191 * Returns the minimum value for an integer parameter.
192 *
193 * @public @memberof GdkParamInfo
194 * @param info Info object.
195 * @return Minimum value.
196 */
198 
199 /**
200 * Sets the maximum value for an integer parameter.
201 *
202 * @public @memberof GdkParamInfo
203 * @param info Info object.
204 * @param max Maximum value.
205 * @return Operation status.
206 */
208 
209 /**
210 * Returns the maximum value for an integer parameter.
211 *
212 * @public @memberof GdkParamInfo
213 * @param info Info object.
214 * @return Maximum value.
215 */
217 
218 /**
219 * Add an option for an integer parameter.
220 *
221 * @public @memberof GdkParamInfo
222 * @param info Info object.
223 * @param option Option value.
224 * @param name Option name.
225 * @return Operation status.
226 */
227 GdkFx(kStatus) GdkParamInfo_AddOptionInt(GdkParamInfo info, k32s option, const kChar* name);
228 
229 /**
230 * Returns the option at a specified index for an integer parameter.
231 *
232 * @public @memberof GdkParamInfo
233 * @param info Info object.
234 * @param index Option index.
235 * @return Option value.
236 */
237 GdkFx(k32s) GdkParamInfo_OptionAtInt(GdkParamInfo info, kSize index);
238 
239 /**
240 * Sets the minimum value for a decimal parameter.
241 *
242 * @public @memberof GdkParamInfo
243 * @param info Info object.
244 * @param min Minimum value.
245 * @return Operation status.
246 */
248 
249 /**
250 * Returns the minimum value for a decimal parameter.
251 *
252 * @public @memberof GdkParamInfo
253 * @param info Info object.
254 * @return Minimum value.
255 */
257 
258 /**
259 * Sets the maximum value for a decimal parameter.
260 *
261 * @public @memberof GdkParamInfo
262 * @param info Info object.
263 * @param max Maximum value.
264 * @return Operation status.
265 */
267 
268 /**
269 * Returns the maximum value for a decimal parameter.
270 *
271 * @public @memberof GdkParamInfo
272 * @param info Info object.
273 * @return Maximum value.
274 */
276 
277 /**
278 * Add an option for an float parameter.
279 *
280 * @public @memberof GdkParamInfo
281 * @param info Info object.
282 * @param option Option value.
283 * @param name Option name.
284 * @return Operation status.
285 */
286 GdkFx(kStatus) GdkParamInfo_AddOptionFloat(GdkParamInfo info, k64f option, const kChar* name);
287 
288 /**
289 * Returns the option at a specified index for an float parameter.
290 *
291 * @public @memberof GdkParamInfo
292 * @param info Info object.
293 * @param index Option index.
294 * @return Option value.
295 */
297 
298 /**
299 * Assign the default value of the parameter to sue when refreshing the parameter.
300 *
301 * @public @memberof GdkParamInfo
302 * @param info Info object.
303 * @param value Pointer to default value to assign.
304 * @return Operation status.
305 */
306 GdkFx(kStatus) GdkParamInfo_SetDefault(GdkParamInfo info, const void* value);
307 
308 /**
309 * Enables Z angle support for the surface region passed.
310 *
311 * @public @memberof GdkParamInfo
312 * @param info Info object - expected to be a parameter of type GDK_PARAM_TYPE_SURFACE_REGION.
313 * @return Operation status.
314 */
316 
317 /**
318 * If the parameter is a Multiple Data Type Input, add an accepted data type.
319 *
320 * @public @memberof GdkParamInfo
321 * @param info Info object.
322 * @param type GdkDataType to add.
323 * @return Operation status.
324 */
326 
327 /**
328 * Adds the source perspective of the data to list of source perspectives
329 * This is only applicable to parameters of type DataInput and will automatically
330 * have GDK_DATA_SOURCE_TOP added for parameters of this type.
331 *
332 * For live profile sensors with n-buddy configuration, if the source data from
333 * one of the buddies is required, the device's index added to GDK_DATA_SOURCE_DEVICE_BASE
334 * would have to be specified to be able to retrieve the corresponding data from that device.
335 * For example, if the source data from the second buddy in a 3 sensor buddy configuration
336 * is desired, add its device index of 2 to GDK_DATA_SOURCE_DEVICE_BASE = 102 to be used as
337 * the data source value for that device.
338 *
339 * @public @memberof GdkParamInfo
340 * @param info Info object.
341 * @param source Enumeration of data source:
342 * GDK_DATA_SOURCE_NONE
343 * GDK_DATA_SOURCE_TOP
344 * GDK_DATA_SOURCE_BOTTOM
345 * GDK_DATA_SOURCE_TOP_LEFT
346 * GDK_DATA_SOURCE_TOP_RIGHT
347 * GDK_DATA_SOURCE_TOP_BOTTOM
348 * GDK_DATA_SOURCE_LEFT_RIGHT
349 * GDK_DATA_SOURCE_DEVICE_BASE + device index
350 * @return Operation status.
351 */
353 
354 /**
355 * Returns the list of source perspectives of the data.
356 *
357 * @public @memberof GdkParamInfo
358 * @param info Info object.
359 * @return List of source perspectives set for this info object
360 */
362 
363 /**
364 * Removes the source from the list of source perspectives.
365 * If there are multiple matching sources, it will remove them all.
366 *
367 * @public @memberof GdkParamInfo
368 * @param info Info object.
369 * @param source Enumeration of data source:
370 * GDK_DATA_SOURCE_NONE
371 * GDK_DATA_SOURCE_TOP
372 * GDK_DATA_SOURCE_BOTTOM
373 * GDK_DATA_SOURCE_TOP_LEFT
374 * GDK_DATA_SOURCE_TOP_RIGHT
375 * GDK_DATA_SOURCE_TOP_BOTTOM
376 * GDK_DATA_SOURCE_LEFT_RIGHT
377 * @return Operation status.
378 */
380 
381 /**
382 * Sets the input parameter to be allowed to be set to None (no argument selected).
383 * Default value is kTRUE.
384 * Setting to kFALSE means there must exist a valid input to which this parameter
385 * can be set. This parameter cannot be set to nothing, otherwise an error is generated.
386 *
387 * @public @memberof GdkParamInfo
388 * @param info Info object.
389 * @param flag Flag indicating parameter can be set to none (kTRUE) or not (kFALSE)
390 * @return Operation status.
391 */
393 
394 /**
395 * Returns whether the input parameter can be set to None or requires an actual data input.
396 *
397 * @public @memberof GdkParamInfo
398 * @param info Info object.
399 * @return kTRUE if can be none, kFALSE if not.
400 */
402 
403 
404 //// Deprecated API functions
405 
406 /**
407 * [Deprecated] Use GdkParamInfo_SetConfigOptional() instead.
408 *
409 * @deprecated
410 * @public @memberof GdkParamInfo
411 * @param info Info object.
412 * @param optional Whether or not parameter is optional.
413 * @return Operation status.
414 */
416 
417 /**
418 * [Deprecated] Use GdkParamInfo_ConfigOptional() instead.
419 *
420 * @deprecated
421 * @public @memberof GdkParamInfo
422 * @param info Info object.
423 * @return Is optional.
424 */
426 
427 #include <Gdk/Config/GdkParamInfo.x.h>
428 
429 #endif
Essential Gdk declarations.
kStatus GdkParamInfo_AddOptionInt(GdkParamInfo info, k32s option, const kChar *name)
Add an option for an integer parameter.
k64f GdkParamInfo_MaxFloat(GdkParamInfo info)
Returns the maximum value for a decimal parameter.
kSize GdkParamInfo_OptionCount(GdkParamInfo info)
Returns the number of options for the parameter.
Definition: GdkCfgInterfaces.h:14
kStatus GdkParamInfo_ClearOptions(GdkParamInfo info)
Clears all options for the parameter.
kStatus GdkParamInfo_SetUnits(GdkParamInfo info, const kChar *units)
Sets the units of the parameter.
kStatus GdkParamInfo_EnableSurfaceRegionZAngle(GdkParamInfo info)
Enables Z angle support for the surface region passed.
const kChar * GdkParamInfo_Name(GdkParamInfo info)
Returns the name of the parameter.
kStatus GdkParamInfo_AddSource(GdkParamInfo info, GdkDataSource source)
Adds the source perspective of the data to list of source perspectives This is only applicable to par...
k32s GdkParamInfo_OptionAtInt(GdkParamInfo info, kSize index)
Returns the option at a specified index for an integer parameter.
kStatus GdkParamInfo_SetMaxInt(GdkParamInfo info, k32s max)
Sets the maximum value for an integer parameter.
#define kDeclareClassEx(PREFIX, SYMBOL, BASE)
Represents the schema of a configurable parameter.
Represents a data source selection.
kStatus GdkParamInfo_RemoveOption(GdkParamInfo info, kSize index)
Remove the option at a specified index.
const kChar * GdkParamInfo_Label(GdkParamInfo info)
Returns the display label of the parameter.
const kChar * GdkParamInfo_Units(GdkParamInfo info)
Returns the units of the parameter.
kArrayList GdkParamInfo_Sources(GdkParamInfo info)
Returns the list of source perspectives of the data.
kStatus GdkParamInfo_AddDataType(GdkParamInfo info, GdkDataType type)
If the parameter is a Multiple Data Type Input, add an accepted data type.
kStatus GdkParamInfo_SetMinFloat(GdkParamInfo info, k64f min)
Sets the minimum value for a decimal parameter.
kStatus GdkParamInfo_SetMinInt(GdkParamInfo info, k32s min)
Sets the minimum value for an integer parameter.
kStatus GdkParamInfo_SetLabel(GdkParamInfo info, const kChar *label)
Sets the display label of the parameter.
kStatus GdkParamInfo_SetNoneAllowed(GdkParamInfo info, kBool flag)
Sets the input parameter to be allowed to be set to None (no argument selected).
const kChar * GdkParamInfo_OptionNameAt(GdkParamInfo info, kSize index)
Returns the option name at a specified index.
kStatus GdkParamInfo_SetDefault(GdkParamInfo info, const void *value)
Assign the default value of the parameter to sue when refreshing the parameter.
kBool GdkParamInfo_IsOptional(GdkParamInfo info)
[Deprecated] Use GdkParamInfo_ConfigOptional() instead.
k64f GdkParamInfo_OptionAtFloat(GdkParamInfo info, kSize index)
Returns the option at a specified index for an float parameter.
k64f GdkParamInfo_MinFloat(GdkParamInfo info)
Returns the minimum value for a decimal parameter.
kStatus GdkParamInfo_SetConfigOptional(GdkParamInfo info, kBool optional)
Sets a parameter to be optional or not.
kStatus GdkParamInfo_SetName(GdkParamInfo info, const kChar *name)
Sets the name of the parameter.
GdkParamType GdkParamInfo_Type(GdkParamInfo info)
Returns the parameter type.
kStatus GdkParamInfo_SetMaxFloat(GdkParamInfo info, k64f max)
Sets the maximum value for a decimal parameter.
k32s GdkParamInfo_MinInt(GdkParamInfo info)
Returns the minimum value for an integer parameter.
k32s GdkParamInfo_MaxInt(GdkParamInfo info)
Returns the maximum value for an integer parameter.
Represents data type. No longer used as a bitmask. Note that generic data types will have their msb s...
kBool GdkParamInfo_ConfigOptional(GdkParamInfo info)
Returns whether or not the parameter is optional.
kBool GdkParamInfo_NoneAllowed(GdkParamInfo info)
Returns whether the input parameter can be set to None or requires an actual data input...
kBool GdkParamInfo_IsInputData(GdkParamInfo info)
Returns whether the info object is of type input data set.
Type of a parameter.
kStatus GdkParamInfo_AddOptionFloat(GdkParamInfo info, k64f option, const kChar *name)
Add an option for an float parameter.
kStatus GdkParamInfo_RemoveSource(GdkParamInfo info, GdkDataSource source)
Removes the source from the list of source perspectives.
kStatus GdkParamInfo_SetIsOptional(GdkParamInfo info, kBool optional)
[Deprecated] Use GdkParamInfo_SetConfigOptional() instead.