AuboStudio SDK  0.6.3
wait_node.h
浏览该文件的文档.
1#ifndef AUBO_SCOPE_WAIT_NODE_H
2#define AUBO_SCOPE_WAIT_NODE_H
3
11
12namespace arcs {
13namespace aubo_scope {
15
17{
18public:
19 /**
20 * The configuration type used to determine which type of configuration this
21 * instance is.
22 */
23 enum ConfigType : int
24 {
25
27
28 /**
29 * <p>
30 * Nothing to wait.
31 * </p>
32 *
33 *
34 */
36
37 /**
38 * <p>
39 * Wait type is time.
40 * </p>
41 *
42 * The config instance can be cast to {@link TimeWaitNodeConfig}.
43 */
45
46 /**
47 * <p>
48 * Wait type is digital_input.
49 * </p>
50 *
51 * The config instance can be cast to {@link
52 * DigitalInputWaitNodeConfig}.
53 */
55
56 /**
57 * <p>
58 * Wait type is analog_input_current.
59 * </p>
60 *
61 * The config instance can be cast to {@link
62 * AnalogInputCurrentWaitNodeConfig}.
63 */
65
66 /**
67 * <p>
68 * Wait type is analog_input_voltage.
69 * </p>
70 *
71 * The config instance can be cast to {@link
72 * AnalogInputVoltageWaitNodeConfig}.
73 */
75
76 /**
77 * <p>
78 * Wait type is float_register_input.
79 * </p>
80 *
81 * The config instance can be cast to {@link
82 * FloatRegisterInputWaitNodeConfig}.
83 */
85
86 /**
87 * <p>
88 * Wait type is expression_input.
89 * </p>
90 *
91 * The config instance can be cast to {@link
92 * ExpressionInputWaitNodeConfig}.
93 */
95 };
96
97 /**
98 * Compare operator types LESS_THAN and GREATER_THAN used when waiting for
99 * an analog input to go lower or higher, respectively, than a threshold
100 */
106
109 virtual ~WaitNode();
110
111 /**
112 * This method returns the type of configuration. Cast this instance
113 * appropriately to have access to specific getters.
114 *
115 * @return the type of this config.
116 */
119
120 /**
121 *
122 * @return the time to wait for. second
123 */
124 double getWaitTime();
125 void setWaitTime(double time);
126
127 /**
128 * Depending on the type of input this is interpreted in different ways.
129 * For digital inputs and MODBUS inputs, <code>true</code> means the input
130 * to wait for must be HIGH, <code>false</code> means the input to wait for
131 * must be LOW. For boolean registers the value is interpreted literally.
132 *
133 * @return the input value to wait for.
134 */
136 void setBoolValueToWaitFor(bool value);
137
139 void setFloatValueToWaitFor(float value);
140
141 /**
142 * Creates a configuration for waiting for a digital input to go high or
143 * low.
144 *
145 * @param input the digital input on which to wait, not <code>null</code>.
146 * @param value_to_wait_for <code>true</code>, if waiting for the input
147 * signal value/level to go HIGH, <code>false</code> otherwise (waiting for
148 * LOW signal value/level).
149 * @return the configuration.
150 * @throws IllegalArgumentException if <code>input</code> is an output (does
151 * not support reading of values). See {@link IO#isInput()}.
152 */
153 void setDigitalInput(DigitalIoPtr input);
154 DigitalIoPtr getDigitalInput();
155
156 /**
157 * Creates a configuration for waiting for a digital MODBUS input to go high
158 * or low.
159 *
160 * @param input the digital MODBUS input on which to wait, not
161 * <code>null</code>.
162 * @param value_to_wait_for <code>true</code>, if waiting for the input
163 * signal value/level to go HIGH, <code>false</code> otherwise (waiting for
164 * LOW signal value/level).
165 * @return the configuration.
166 * @throws IllegalArgumentException if <code>input</code> is an output (does
167 * not support reading of values) or if <code>output</code> is not a digital
168 * output. See {@link IO#isInput()} and {@link IO#getType()}.
169 */
170 void setModbusInput(ModbusIoPtr input);
171 ModbusIoPtr getModbusInput();
172
173 /**
174 * Creates a configuration for waiting for a boolean register to go
175 * <code>true</code> or <code>false</code>.
176 *
177 * @param input the boolean register input on which to wait, not
178 * <code>null</code>.
179 * @param value_to_wait_for <code>true</code>, if waiting for the register
180 * to be <code>true}, <code>false} otherwise.
181 * @return the configuration.
182 * @throws IllegalArgumentException if <code>input</code> is an output (does
183 * not support reading of values). See {@link IO#isInput()}.
184 */
185 void setBoolRegister(BoolRegisterPtr input);
186 BoolRegisterPtr getBoolRegister();
187
188 void setCompareOperator(CompareOperator compareOperator);
190
191 /**
192 * Creates a configuration for waiting for an analog input to go past an
193 * electric current threshold.
194 *
195 * @param input on which to wait, not <code>null</code>.
196 * @param compareOperator the operator to use when comparing input to value,
197 * not <code>null</code>. Available options are "less than" ({@literal <})
198 * or "greater than" ({@literal >}).
199 * @param current the electric current threshold to wait for, not
200 * <code>null</code>.
201 * @param errorHandler the error handler for validation errors. If using
202 * {@link ErrorHandler#AUTO_CORRECT} this will clamp the value to the
203 * nearest valid current value.
204 * @return the configuration.
205 * @throws IllegalArgumentException if <code>input</code> is an output (does
206 * not support reading of values). See {@link IO#isInput()}.
207 */
208 void setAnalogInput(AnalogIoPtr input);
209 AnalogIoPtr getAnalogInput();
210
211 /**
212 * Creates a configuration for waiting for a register to go past a float
213 * threshold.
214 *
215 * @param input the float register input on which to wait, not
216 * <code>null</code>.
217 * @param compareOperator the operator to use when comparing register to
218 * value, not <code>null</code>. Available options are "less than"
219 * ({@literal <}) or "greater than" ({@literal >}).
220 * @param value_to_wait_for the float threshold to wait for.
221 * @return the configuration.
222 * @throws IllegalArgumentException if <code>input</code> is an output (does
223 * not support reading of values). See {@link IO#isInput()}.
224 */
225 void setDoubleRegisterInput(DoubleRegisterPtr input);
226 DoubleRegisterPtr getDoubleRegisterInput();
227
228 /**
229 * Create a configuration for waiting for an expression to be evaluated to
230 * true.
231 *
232 * @param expression the expression to evaluate, not <code>null</code>.
233 * @return the configuration.
234 */
235 void setExpressionInputConfig(ExpressionPtr expression);
237
238private:
239 friend class DataSwitch;
241 void *d_{ nullptr };
242};
243
244} // namespace aubo_scope
245} // namespace arcs
246#endif // AUBO_SCOPE_WAIT_NODE_H
#define ARCS_ABI_EXPORT
#define ARCS_CLASS_FORWARD(C)
Macro that forward declares a class and defines the respective smartpointers through ARCS_DECLARE_PTR...
bool getBoolValueToWaitFor()
Depending on the type of input this is interpreted in different ways.
DoubleRegisterPtr getDoubleRegisterInput()
void setCompareOperator(CompareOperator compareOperator)
void setConfigType(ConfigType type)
DigitalIoPtr getDigitalInput()
AnalogIoPtr getAnalogInput()
void setWaitTime(double time)
void setBoolRegister(BoolRegisterPtr input)
Creates a configuration for waiting for a boolean register to go true or false.
CompareOperator
Compare operator types LESS_THAN and GREATER_THAN used when waiting for an analog input to go lower o...
ConfigType getConfigType()
This method returns the type of configuration.
BoolRegisterPtr getBoolRegister()
void setModbusInput(ModbusIoPtr input)
Creates a configuration for waiting for a digital MODBUS input to go high or low.
ModbusIoPtr getModbusInput()
void setDigitalInput(DigitalIoPtr input)
Creates a configuration for waiting for a digital input to go high or low.
CompareOperator getCompareOperator()
ConfigType
The configuration type used to determine which type of configuration this instance is.
void setDoubleRegisterInput(DoubleRegisterPtr input)
Creates a configuration for waiting for a register to go past a float threshold.
void setBoolValueToWaitFor(bool value)
void setFloatValueToWaitFor(float value)
void setAnalogInput(AnalogIoPtr input)
Creates a configuration for waiting for an analog input to go past an electric current threshold.
ExpressionPtr getExpressionInputConfig()
void setExpressionInputConfig(ExpressionPtr expression)
Create a configuration for waiting for an expression to be evaluated to true.