Gocator API
GoTools.h
Go to the documentation of this file.
1 /**
2  * @file GoTools.h
3  * @brief Declares the GoTool classes.
4  *
5  * @internal
6  * Copyright (C) 2016-2019 by LMI Technologies Inc.
7  * Licensed under the MIT License.
8  * Redistributed files must retain the above copyright notice.
9  */
10 #ifndef GO_TOOLS_H
11 #define GO_TOOLS_H
12 
13 #include <GoSdk/GoSdkDef.h>
14 #include <GoSdk/Tools/GoTool.h>
15 #include <GoSdk/Tools/GoExtTool.h>
19 
20 typedef kObject GoToolOption;
21 
22 /**
23  * @class GoTools
24  * @extends kObject
25  * @ingroup GoSdk-Tools
26  * @brief Represents a collection of tools.
27  */
28 typedef kObject GoTools;
29 
30 /**
31  * Returns the current number of tools.
32  *
33  * @public @memberof GoTools
34  * @version Introduced in firmware 4.0.10.27
35  * @param tools GoTools object.
36  * @return The current tool count.
37  */
38 GoFx(kSize) GoTools_ToolCount(GoTools tools);
39 
40 /**
41  * Returns a tool handle at the given index.
42  *
43  * @public @memberof GoTools
44  * @version Introduced in firmware 4.0.10.27
45  * @param tools GoTools object.
46  * @param index The index with which to retrieve a tool.
47  * @return A handle to a tool at the given index or kNULL if the index is invalid.
48  */
49 GoFx(GoTool) GoTools_ToolAt(GoTools tools, kSize index);
50 
51 /**
52 * Moves a tool to another position in the array
53 *
54 * @public @memberof GoTools
55 * @version Introduced in firmware 4.7.9.77
56 * @param tools GoTools object.
57 * @param index The index with which tool to move around.
58 * @param newIndex The new index at which the tool will be moved too
59 * @return Operation status
60 */
61 GoFx(kStatus) GoTools_MoveTool(GoTools tools, kSize index, kSize newIndex);
62 
63 /**
64  * Adds a tool and returns a handle to it. NOTE: This function will always succeed,
65  * but the tool handle will be null if passed in and an error occurs.
66  *
67  * DEPRECATED: this API is deprecated as of 4.7.11.72. Use the
68  * GoTools_AddToolByName() API instead.
69  *
70  * @deprecated
71  * @public @memberof GoTools
72  * @version Introduced in firmware 4.0.10.27
73  * @param tools GoTools object.
74  * @param type The tool type enumerator value representing the type of tool to add.
75  * @param tool A pointer to the newly added tool.
76  * @return Operation status.
77  */
78 GoFx(kStatus) GoTools_AddTool(GoTools tools, GoToolType type, GoTool* tool);
79 
80 /**
81  * Removes a tool at the given index.
82  *
83  * @public @memberof GoTools
84  * @version Introduced in firmware 4.0.10.27
85  * @param tools GoTools object.
86  * @param index The index with which to remove a tool.
87  * @return Operation status.
88  */
89 GoFx(kStatus) GoTools_RemoveTool(GoTools tools, kSize index);
90 
91 /**
92  * Removes all tools in the given GoTools instance.
93  *
94  * @public @memberof GoTools
95  * @version Introduced in firmware 4.0.10.27
96  * @param tools GoTools object.
97  * @return Operation status.
98  */
100 
101 /**
102  * Returns an enabled measurement handle if the specified ID is valid.
103  *
104  * @public @memberof GoTools
105  * @version Introduced in firmware 4.0.10.27
106  * @param tools GoTools object.
107  * @param id The measurement ID to search for.
108  * @return A GoMeasurement object if an enabled measurement with the ID is found, otherwise kNULL.
109  */
111 
112 /**
113  * Automatically update a given measurement to use a valid ID within the set of tools contained in the GoTools object.
114  *
115  * @public @memberof GoTools
116  * @version Introduced in firmware 4.0.10.27
117  * @param tools GoTools object.
118  * @param measurement GoMeasurement object to update.
119  * @return Operation status.
120  */
121 GoFx(kStatus) GoTools_AssignMeasurementId(GoTools tools, GoMeasurement measurement);
122 
123 /**
124  * Returns the number of tool options available for the current configuration.
125  *
126  * @public @memberof GoTools
127  * @version Introduced in firmware 4.3.3.124
128  * @param tools GoTools object.
129  * @return The number of tool options available for the current configuration.
130  */
132 
133 /**
134  * Retrieves the tool option at the given index.
135  *
136  * @public @memberof GoTools
137  * @version Introduced in firmware 4.3.3.124
138  * @param tools GoTools object.
139  * @param index The index of the option list to access.
140  * @return The tool option associated with the given index.
141  */
142 GoFx(GoToolOption) GoTools_ToolOptionAt(GoTools tools, kSize index);
143 
144 /**
145  * Returns the name associated with the given tool option.
146  *
147  * @public @memberof GoTools
148  * @version Introduced in firmware 4.3.3.124
149  * @param option GoToolOption object.
150  * @return The name associated with the tool option.
151  */
152 GoFx(const kChar*) GoToolOption_Name(GoToolOption option);
153 
154 /**
155  * Returns the number of measurement options available for the given tool option.
156  *
157  * @public @memberof GoTools
158  * @version Introduced in firmware 4.3.3.124
159  * @param option GoToolOption object.
160  * @return The number of measurement options available for the given tool option.
161  */
163 
164 /**
165  * Retrieves the measurement option at the given index of the tool option.
166  *
167  * @public @memberof GoTools
168  * @version Introduced in firmware 4.3.3.124
169  * @param option GoToolOption object.
170  * @param index The index of the option list to access.
171  * @return The measurement option associated with the given index.
172  */
173 GoFx(const GoMeasurementOption*) GoToolOption_MeasurementOptionAt(GoToolOption option, kSize index);
174 
175 /**
176 * Returns the number of feature options available for the given tool option.
177 *
178 * @public @memberof GoTools
179 * @version Introduced in firmware 4.6.3.27
180 * @param option GoToolOption object.
181 * @return The number of feature options available for the given tool option.
182 */
184 
185 /**
186 * Retrieves the feature option at the given index of the tool option.
187 *
188 * @public @memberof GoTools
189 * @version Introduced in firmware 4.6.3.27
190 * @param option GoToolOption object.
191 * @param index The index of the option list to access.
192 * @return The feature option associated with the given index.
193 */
194 GoFx(const GoFeatureOption*) GoToolOption_FeatureOptionAt(GoToolOption option, kSize index);
195 
196 /**
197 * Returns the number of tool data output options available for the given tool option.
198 *
199 * @public @memberof GoTools
200 * @version Introduced in firmware 4.7.3.97
201 * @param option GoToolOption object.
202 * @return The number of tool data output options available for the given tool option.
203 */
205 
206 /**
207 * Retrieves the tool data output option at the given index of the tool option.
208 *
209 * @public @memberof GoTools
210 * @version Introduced in firmware 4.7.3.97
211 * @param option GoToolOption object.
212 * @param index The index of the option list to access.
213 * @return The tool data output option associated with the given index.
214 */
215 GoFx(const GoToolDataOutputOption*) GoToolOption_ToolDataOutputOptionAt(GoToolOption option, kSize index);
216 
217 /**
218  * Adds a tool by name.
219  *
220  * @public @memberof GoTools
221  * @version Introduced in firmware 4.3.3.124
222  * @param tools GoTools object.
223  * @param optionName The name of the tool to add.
224  * @param tool A handle to the newly constructed tool. kNULL can be used.
225  * @return Operation status.
226  * @see GoTools_ToolOptionCount, GoTools_ToolOptionAt, GoToolOption_Name
227  */
228 GoFx(kStatus) GoTools_AddToolByName(GoTools tools, const kChar* optionName, GoTool* tool);
229 
230 /**
231  * Adds a measurement to a tool via a string representing the type.
232  *
233  * @public @memberof GoTools
234  * @version Introduced in firmware 4.3.3.124
235  * @param tools GoTools object.
236  * @param tool The tool of which the measurement is being added.
237  * @param type The measurement type represented as a string to be added.
238  * @param name The name to assign the new measurement.
239  * @param measurement A handle to the newly added measurement. kNULL can be used.
240  * @return Operation status.
241  * @see GoTools_ToolOptionCount, GoTools_ToolOptionAt,
242  * GoToolOption_MeasurementOptionCount, GoToolOption_MeasurementOptionAt
243  */
244 GoFx(kStatus) GoTools_AddMeasurementByName(GoTools tools, GoTool tool, const kChar* type, const kChar* name, GoMeasurement* measurement);
245 
246 /**
247  * @class GoScript
248  * @extends GoTool
249  * @ingroup GoSdk-Tools
250  * @brief Represents a script tool.
251  */
252 typedef GoTool GoScript;
253 
254 /**
255  * Gets the code for the script.
256  *
257  * @public @memberof GoScript
258  * @version Introduced in firmware 4.0.10.27
259  * @param tool GoScript object.
260  * @param code Receives a null-terminated string containing the script code.
261  * @return Operation status.
262  */
263 GoFx(kStatus) GoScript_Code(GoScript tool, kChar** code);
264 
265 /**
266  * Sets the code for the script.
267  *
268  * @public @memberof GoScript
269  * @version Introduced in firmware 4.0.10.27
270  * @param tool GoScript object.
271  * @param code The code to set.
272  * @return Operation status.
273  */
274 GoFx(kStatus) GoScript_SetCode(GoScript tool, kChar* code);
275 
276 /**
277  * Adds a script output.
278  *
279  * @public @memberof GoScript
280  * @version Introduced in firmware 4.0.10.27
281  * @param tool GoScript object.
282  * @param id An ID (must not already be used by other measurements) of the script output to add.
283  * @return Operation status.
284  */
285 GoFx(kStatus) GoScript_AddOutput(GoScript tool, k32u id);
286 
287 /**
288  * Removes a script output with the specific ID.
289  *
290  * @public @memberof GoScript
291  * @version Introduced in firmware 4.0.10.27
292  * @param tool GoScript object.
293  * @param id An ID of the script output to remove.
294  * @return Operation status.
295  */
297 
298 /**
299  * Returns the count of script tool outputs.
300  *
301  * @public @memberof GoScript
302  * @version Introduced in firmware 4.0.10.27
303  * @param tool GoScript object.
304  * @return Script output count.
305  */
307 
308 /**
309  * Returns a handle to a script output at the given index.
310  *
311  * @public @memberof GoScript
312  * @version Introduced in firmware 4.0.10.27
313  * @param tool GoScript object.
314  * @param index The index with which to return a corresponding script output.
315  * @return A GoScriptOutput object or kNULL if the index is invalid.
316  */
318 
319 #include <GoSdk/Tools/GoTools.x.h>
320 
321 #endif
Lists all tool types.
Declares the base GoTool class.
kStatus GoTools_MoveTool(GoTools tools, kSize index, kSize newIndex)
Moves a tool to another position in the array.
Represents the base class for a tool measurement or script output.
const kChar * GoToolOption_Name(GoToolOption option)
Returns the name associated with the given tool option.
kStatus GoScript_AddOutput(GoScript tool, k32u id)
Adds a script output.
kStatus GoTools_AddTool(GoTools tools, GoToolType type, GoTool *tool)
Adds a tool and returns a handle to it.
const GoFeatureOption * GoToolOption_FeatureOptionAt(GoToolOption option, kSize index)
Retrieves the feature option at the given index of the tool option.
kStatus GoTools_ClearTools(GoTools tools)
Removes all tools in the given GoTools instance.
Declares the base GoExtTool class.
Declares all range tools and their related classes.
kStatus GoTools_AddToolByName(GoTools tools, const kChar *optionName, GoTool *tool)
Adds a tool by name.
kSize GoTools_ToolCount(GoTools tools)
Returns the current number of tools.
kStatus GoScript_RemoveOutput(GoScript tool, k32u id)
Removes a script output with the specific ID.
Represents a script output for a Script Tool.
kStatus GoTools_RemoveTool(GoTools tools, kSize index)
Removes a tool at the given index.
Declares all surface tools and their related classes.
GoScriptOutput GoScript_OutputAt(GoScript tool, kSize index)
Returns a handle to a script output at the given index.
Essential SDK declarations.
kSize GoToolOption_MeasurementOptionCount(GoToolOption option)
Returns the number of measurement options available for the given tool option.
kStatus GoScript_Code(GoScript tool, kChar **code)
Gets the code for the script.
Represents the base tool class.
const GoMeasurementOption * GoToolOption_MeasurementOptionAt(GoToolOption option, kSize index)
Retrieves the measurement option at the given index of the tool option.
Represents a collection of tools.
kStatus GoScript_SetCode(GoScript tool, kChar *code)
Sets the code for the script.
kSize GoToolOption_FeatureOptionCount(GoToolOption option)
Returns the number of feature options available for the given tool option.
Declares all profile tools and their related classes.
kStatus GoTools_AssignMeasurementId(GoTools tools, GoMeasurement measurement)
Automatically update a given measurement to use a valid ID within the set of tools contained in the G...
kSize GoScript_OutputCount(GoScript tool)
Returns the count of script tool outputs.
Represents a script tool.
kStatus GoTools_AddMeasurementByName(GoTools tools, GoTool tool, const kChar *type, const kChar *name, GoMeasurement *measurement)
Adds a measurement to a tool via a string representing the type.
kSize GoTools_ToolOptionCount(GoTools tools)
Returns the number of tool options available for the current configuration.
GoMeasurement GoTools_FindMeasurementById(GoTools tools, k32u id)
Returns an enabled measurement handle if the specified ID is valid.
GoToolOption GoTools_ToolOptionAt(GoTools tools, kSize index)
Retrieves the tool option at the given index.
const GoToolDataOutputOption * GoToolOption_ToolDataOutputOptionAt(GoToolOption option, kSize index)
Retrieves the tool data output option at the given index of the tool option.
GoTool GoTools_ToolAt(GoTools tools, kSize index)
Returns a tool handle at the given index.
kSize GoToolOption_ToolDataOutputOptionCount(GoToolOption option)
Returns the number of tool data output options available for the given tool option.