Gocator API
 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) 2015 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>
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  */
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 GoFx(kSize) GoTools_ToolOptionCount(GoTools tools);
110 GoFx(GoToolOption) GoTools_ToolOptionAt(GoTools tools, kSize index);
111 
112 GoFx(const kChar*) GoToolOption_Name(GoToolOption option);
113 GoFx(kSize) GoToolOption_MeasurementOptionCount(GoToolOption option);
114 GoFx(GoMeasurementOption*) GoToolOption_MeasurementOptionAt(GoToolOption option, kSize index);
115 
116 GoFx(kStatus) GoTools_AddToolByName(GoTools tools, const kChar* optionName, GoTool* tool);
117 GoFx(kStatus) GoTools_AddMeasurementByName(GoTools tools, GoTool tool, const kChar* type, GoMeasurement* measurement);
118 
119 
120 
121 /**
122  * @class GoScript
123  * @extends GoTool
124  * @ingroup GoSdk-Tools
125  * @brief Represents a script tool.
126  */
127 typedef GoTool GoScript;
128 
129 /**
130  * Gets the code for the script.
131  *
132  * @public @memberof GoScript
133  * @version Introduced in firmware 4.0.10.27
134  * @param tool GoScript object.
135  * @param code Receives a null-terminated string containing the script code.
136  * @return Operation status.
137  */
138 GoFx(kStatus) GoScript_Code(GoScript tool, kChar** code);
139 
140 /**
141  * Sets the code for the script.
142  *
143  * @public @memberof GoScript
144  * @version Introduced in firmware 4.0.10.27
145  * @param tool GoScript object.
146  * @param code The code to set.
147  * @return Operation status.
148  */
149 GoFx(kStatus) GoScript_SetCode(GoScript tool, kChar* code);
150 
151 /**
152  * Adds a script output.
153  *
154  * @public @memberof GoScript
155  * @version Introduced in firmware 4.0.10.27
156  * @param tool GoScript object.
157  * @param id An ID(must not already be used by other measurements) of the script output to add.
158  * @return Operation status.
159  */
160 GoFx(kStatus) GoScript_AddOutput(GoScript tool, k32u id);
161 
162 /**
163  * Removes a script output with the specific ID.
164  *
165  * @public @memberof GoScript
166  * @version Introduced in firmware 4.0.10.27
167  * @param tool GoScript object.
168  * @param id An ID of the script output to remove.
169  * @return Operation status.
170  */
171 GoFx(kStatus) GoScript_RemoveOutput(GoScript tool, k32u id);
172 
173 /**
174  * Returns the count of script tool outputs.
175  *
176  * @public @memberof GoScript
177  * @version Introduced in firmware 4.0.10.27
178  * @param tool GoScript object.
179  * @return Script output count.
180  */
181 GoFx(kSize) GoScript_OutputCount(GoScript tool);
182 
183 /**
184  * Returns a handle to a script output at the given index.
185  *
186  * @public @memberof GoScript
187  * @version Introduced in firmware 4.0.10.27
188  * @param tool GoScript object.
189  * @param index The index with which to return a corresponding script output.
190  * @return A GoScriptOutput object or kNULL if the index is invalid.
191  */
192 GoFx(GoScriptOutput) GoScript_OutputAt(GoScript tool, kSize index);
193 
194 kEndHeader()
195 #include <GoSdk/Tools/GoTools.x.h>
196 
197 #endif
Lists all tool types.
Declares the base GoTool class.
Represents the base class for a tool measurement or script output.
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.
kStatus GoTools_ClearTools(GoTools tools)
Removes all tools in the given GoTools instance.
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.
kStatus GoScript_Code(GoScript tool, kChar **code)
Gets the code for the script.
Represents the base tool class.
Represents a collection of tools.
kStatus GoScript_SetCode(GoScript tool, kChar *code)
Sets the code for the script.
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.
GoMeasurement GoTools_FindMeasurementById(GoTool tools, k32u id)
Returns an enabled measurement handle if the specified ID is valid.
GoTool GoTools_ToolAt(GoTools tools, kSize index)
Returns a tool handle at the given index.