Gocator API

- Home
- Types
- Files

All Classes Files Functions Variables Typedefs Macros Modules Pages
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 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>
16 #include <GoSdk/Tools/GoProfileTools.h>
17 #include <GoSdk/Tools/GoRangeTools.h>
18 #include <GoSdk/Tools/GoSurfaceTools.h>
19
20 kBeginHeader()
21
22 typedef kObject GoToolOption;
23
24 /**
25 * @class GoTools
26 * @extends kObject
27 * @ingroup GoSdk-Tools
28 * @brief Represents a collection of tools.
29 */
30 typedef kObject GoTools;
31
32 /**
33 * Returns the current number of tools.
34 *
35 * @public @memberof GoTools
36 * @version Introduced in firmware 4.0.10.27
37 * @param tools GoTools object.
38 * @return The current tool count.
39 */
40 GoFx(kSize) GoTools_ToolCount(GoTools tools);
41
42 /**
43 * Returns a tool handle at the given index.
44 *
45 * @public @memberof GoTools
46 * @version Introduced in firmware 4.0.10.27
47 * @param tools GoTools object.
48 * @param index The index with which to retrieve a tool.
49 * @return A handle to a tool at the given index or kNULL if the index is invalid.
50 */
51 GoFx(GoTool) GoTools_ToolAt(GoTools tools, kSize index);
52
53 /**
54 * Adds a tool and returns a handle to it. NOTE: This function will always succeed,
55 * but the tool handle will be null if passed in and an error occurs.
56 *
57 * @public @memberof GoTools
58 * @version Introduced in firmware 4.0.10.27
59 * @param tools GoTools object.
60 * @param type The tool type enumerator value representing the type of tool to add.
61 * @param tool A pointer to the newly added tool.
62 * @return Operation status.
63 */
64 GoFx(kStatus) GoTools_AddTool(GoTools tools, GoToolType type, GoTool* tool);
65
66 /**
67 * Removes a tool at the given index.
68 *
69 * @public @memberof GoTools
70 * @version Introduced in firmware 4.0.10.27
71 * @param tools GoTools object.
72 * @param index The index with which to remove a tool.
73 * @return Operation status.
74 */
75 GoFx(kStatus) GoTools_RemoveTool(GoTools tools, kSize index);
76
77 /**
78 * Removes all tools in the given GoTools instance.
79 *
80 * @public @memberof GoTools
81 * @version Introduced in firmware 4.0.10.27
82 * @param tools GoTools object.
83 * @return Operation status.
84 */
85 GoFx(kStatus) GoTools_ClearTools(GoTools tools);
86
87 /**
88 * Returns an enabled measurement handle if the specified ID is valid.
89 *
90 * @public @memberof GoTools
91 * @version Introduced in firmware 4.0.10.27
92 * @param tools GoTools object.
93 * @param id The measurement ID to search for.
94 * @return A GoMeasurement object if an enabled measurement with the ID is found, otherwise kNULL.
95 */
96 GoFx(GoMeasurement) GoTools_FindMeasurementById(GoTools tools, k32u id);
97
98 /**
99 * Automatically update a given measurement to use a valid ID within the set of tools contained in the GoTools object.
100 *
101 * @public @memberof GoTools
102 * @version Introduced in firmware 4.0.10.27
103 * @param tools GoTools object.
104 * @param measurement GoMeasurement object to update.
105 * @return Operation status.
106 */
107 GoFx(kStatus) GoTools_AssignMeasurementId(GoTools tools, GoMeasurement measurement);
108
109 /**
110 * Returns the number of tool options available for the current configuration.
111 *
112 * @public @memberof GoTools
113 * @version Introduced in firmware 4.3.3.124
114 * @param tools GoTools object.
115 * @return The number of tool options available for the current configuration.
116 */
117 GoFx(kSize) GoTools_ToolOptionCount(GoTools tools);
118
119 /**
120 * Retrieves the tool option at the given index.
121 *
122 * @public @memberof GoTools
123 * @version Introduced in firmware 4.3.3.124
124 * @param tools GoTools object.
125 * @param index The index of the option list to access.
126 * @return The tool option associated with the given index.
127 */
128 GoFx(GoToolOption) GoTools_ToolOptionAt(GoTools tools, kSize index);
129
130 /**
131 * Returns the name associated with the given tool option.
132 *
133 * @public @memberof GoTools
134 * @version Introduced in firmware 4.3.3.124
135 * @param option GoToolOption object.
136 * @return The name associated with the tool option.
137 */
138 GoFx(const kChar*) GoToolOption_Name(GoToolOption option);
139
140 /**
141 * Returns the number of measurement options available for the given tool option.
142 *
143 * @public @memberof GoTools
144 * @version Introduced in firmware 4.3.3.124
145 * @param option GoToolOption object.
146 * @return The number of measurement options available for the given tool option.
147 */
148 GoFx(kSize) GoToolOption_MeasurementOptionCount(GoToolOption option);
149
150 /**
151 * Retrieves the measurement option at the given index of the tool option.
152 *
153 * @public @memberof GoTools
154 * @version Introduced in firmware 4.3.3.124
155 * @param option GoToolOption object.
156 * @param index The index of the option list to access.
157 * @return The measurement option associated with the given index.
158 */
159 GoFx(const GoMeasurementOption*) GoToolOption_MeasurementOptionAt(GoToolOption option, kSize index);
160
161 /**
162 * Adds a tool by name.
163 *
164 * @public @memberof GoTools
165 * @version Introduced in firmware 4.3.3.124
166 * @param tools GoTools object.
167 * @param optionName The name of the tool to add.
168 * @param tool A handle to the newly constructed tool. kNULL can be used.
169 * @return Operation status.
170 * @see GoTools_ToolOptionCount, GoTools_ToolOptionAt, GoToolOption_Name
171 */
172 GoFx(kStatus) GoTools_AddToolByName(GoTools tools, const kChar* optionName, GoTool* tool);
173
174 /**
175 * Adds a measurement to a tool via a string representing the type.
176 *
177 * @public @memberof GoTools
178 * @version Introduced in firmware 4.3.3.124
179 * @param tools GoTools object.
180 * @param tool The tool of which the measurement is being added.
181 * @param type The measurement type represented as a string to be added.
182 * @param name The name to assign the new measurement.
183 * @param measurement A handle to the newly added measurement. kNULL can be used.
184 * @return Operation status.
185 * @see GoTools_ToolOptionCount, GoTools_ToolOptionAt,
186 * GoToolOption_MeasurementOptionCount, GoToolOption_MeasurementOptionAt
187 */
188 GoFx(kStatus) GoTools_AddMeasurementByName(GoTools tools, GoTool tool, const kChar* type, const kChar* name, GoMeasurement* measurement);
189
190
191
192 /**
193 * @class GoScript
194 * @extends GoTool
195 * @ingroup GoSdk-Tools
196 * @brief Represents a script tool.
197 */
198 typedef GoTool GoScript;
199
200 /**
201 * Gets the code for the script.
202 *
203 * @public @memberof GoScript
204 * @version Introduced in firmware 4.0.10.27
205 * @param tool GoScript object.
206 * @param code Receives a null-terminated string containing the script code.
207 * @return Operation status.
208 */
209 GoFx(kStatus) GoScript_Code(GoScript tool, kChar** code);
210
211 /**
212 * Sets the code for the script.
213 *
214 * @public @memberof GoScript
215 * @version Introduced in firmware 4.0.10.27
216 * @param tool GoScript object.
217 * @param code The code to set.
218 * @return Operation status.
219 */
220 GoFx(kStatus) GoScript_SetCode(GoScript tool, kChar* code);
221
222 /**
223 * Adds a script output.
224 *
225 * @public @memberof GoScript
226 * @version Introduced in firmware 4.0.10.27
227 * @param tool GoScript object.
228 * @param id An ID (must not already be used by other measurements) of the script output to add.
229 * @return Operation status.
230 */
231 GoFx(kStatus) GoScript_AddOutput(GoScript tool, k32u id);
232
233 /**
234 * Removes a script output with the specific ID.
235 *
236 * @public @memberof GoScript
237 * @version Introduced in firmware 4.0.10.27
238 * @param tool GoScript object.
239 * @param id An ID of the script output to remove.
240 * @return Operation status.
241 */
242 GoFx(kStatus) GoScript_RemoveOutput(GoScript tool, k32u id);
243
244 /**
245 * Returns the count of script tool outputs.
246 *
247 * @public @memberof GoScript
248 * @version Introduced in firmware 4.0.10.27
249 * @param tool GoScript object.
250 * @return Script output count.
251 */
252 GoFx(kSize) GoScript_OutputCount(GoScript tool);
253
254 /**
255 * Returns a handle to a script output at the given index.
256 *
257 * @public @memberof GoScript
258 * @version Introduced in firmware 4.0.10.27
259 * @param tool GoScript object.
260 * @param index The index with which to return a corresponding script output.
261 * @return A GoScriptOutput object or kNULL if the index is invalid.
262 */
263 GoFx(GoScriptOutput) GoScript_OutputAt(GoScript tool, kSize index);
264
265 kEndHeader()
266 #include <GoSdk/Tools/GoTools.x.h>
267
268 #endif
GoToolType
Lists all tool types.
k32u
GoTool.h
Declares the base GoTool class.
GoMeasurement
Represents the base class for a tool measurement or script output.
GoTools::GoToolOption_Name
const kChar * GoToolOption_Name(GoToolOption option)
Returns the name associated with the given tool option.
GoScript::GoScript_AddOutput
kStatus GoScript_AddOutput(GoScript tool, k32u id)
Adds a script output.
GoTools::GoTools_AddTool
kStatus GoTools_AddTool(GoTools tools, GoToolType type, GoTool *tool)
Adds a tool and returns a handle to it.
GoTools::GoTools_ClearTools
kStatus GoTools_ClearTools(GoTools tools)
Removes all tools in the given GoTools instance.
GoExtTool.h
Declares the base GoExtTool class.
GoRangeTools.h
Declares all range tools and their related classes.
GoTools::GoTools_AddToolByName
kStatus GoTools_AddToolByName(GoTools tools, const kChar *optionName, GoTool *tool)
Adds a tool by name.
kSize
GoTools::GoTools_ToolCount
kSize GoTools_ToolCount(GoTools tools)
Returns the current number of tools.
GoScript::GoScript_RemoveOutput
kStatus GoScript_RemoveOutput(GoScript tool, k32u id)
Removes a script output with the specific ID.
kChar
GoScriptOutput
Represents a script output for a Script Tool.
GoTools::GoTools_RemoveTool
kStatus GoTools_RemoveTool(GoTools tools, kSize index)
Removes a tool at the given index.
GoScript::GoScript_OutputAt
GoScriptOutput GoScript_OutputAt(GoScript tool, kSize index)
Returns a handle to a script output at the given index.
GoSdkDef.h
Essential SDK declarations.
GoTools::GoToolOption_MeasurementOptionCount
kSize GoToolOption_MeasurementOptionCount(GoToolOption option)
Returns the number of measurement options available for the given tool option.
GoScript::GoScript_Code
kStatus GoScript_Code(GoScript tool, kChar **code)
Gets the code for the script.
GoTool
Represents the base tool class.
GoTools::GoToolOption_MeasurementOptionAt
const GoMeasurementOption * GoToolOption_MeasurementOptionAt(GoToolOption option, kSize index)
Retrieves the measurement option at the given index of the tool option.
GoTools
Represents a collection of tools.
GoScript::GoScript_SetCode
kStatus GoScript_SetCode(GoScript tool, kChar *code)
Sets the code for the script.
GoProfileTools.h
Declares all profile tools and their related classes.
GoTools::GoTools_AssignMeasurementId
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...
GoScript::GoScript_OutputCount
kSize GoScript_OutputCount(GoScript tool)
Returns the count of script tool outputs.
GoScript
Represents a script tool.
GoTools::GoTools_AddMeasurementByName
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.
GoTools::GoTools_ToolOptionCount
kSize GoTools_ToolOptionCount(GoTools tools)
Returns the number of tool options available for the current configuration.
kObject
kStatus
GoTools::GoTools_FindMeasurementById
GoMeasurement GoTools_FindMeasurementById(GoTools tools, k32u id)
Returns an enabled measurement handle if the specified ID is valid.
GoTools::GoTools_ToolOptionAt
GoToolOption GoTools_ToolOptionAt(GoTools tools, kSize index)
Retrieves the tool option at the given index.
GoTools::GoTools_ToolAt
GoTool GoTools_ToolAt(GoTools tools, kSize index)
Returns a tool handle at the given index.