AuboStudio SDK 0.6.3

wait_node.h
浏览该文件的文档.
1 #ifndef AUBO_SCOPE_WAIT_NODE_H
2 #define AUBO_SCOPE_WAIT_NODE_H
3
4 #include <aubo_caps/domain/program/nodes/program_node.h>
5 #include <aubo_caps/domain/io/analog_io.h>
6 #include <aubo_caps/domain/io/digital_io.h>
7 #include <aubo_caps/domain/io/modbus_io.h>
8 #include <aubo_caps/domain/io/boolean_register.h>
9 #include <aubo_caps/domain/io/double_register.h>
10 #include <aubo_caps/domain/value/expression/expression.h>
11
12 namespace arcs {
13 namespace aubo_scope {
14 ARCS_CLASS_FORWARD(WaitNode);
15
16 class ARCS_ABI_EXPORT WaitNode : public ProgramNode
17 {
18 public:
19 /**
20 * The configuration type used to determine which type of configuration this
21 * instance is.
22 */
23 enum ConfigType : int
24 {
25
26 NO_TYPE,
27
28 /**
29 * <p>
30 * Nothing to wait.
31 * </p>
32 *
33 *
34 */
35 NO_WAIT,
36
37 /**
38 * <p>
39 * Wait type is time.
40 * </p>
41 *
42 * The config instance can be cast to {@link TimeWaitNodeConfig}.
43 */
44 TIME,
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 */
54 DIGITAL_INPUT,
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 */
64 ANALOG_INPUT_CURRENT,
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 */
74 ANALOG_INPUT_VOLTAGE,
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 */
84 FLOAT_REGISTER_INPUT,
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 */
94 EXPRESSION_INPUT
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 */
101 enum CompareOperator : int
102 {
103 LESS_THAN,
104 GREATER_THAN
105 };
106
107 WaitNode(WaitNode &f);
108 WaitNode(WaitNode &&f);
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 */
117 ConfigType getConfigType();
118 void setConfigType(ConfigType type);
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 */
135 bool getBoolValueToWaitFor();
136 void setBoolValueToWaitFor(bool value);
137
138 float getFloatValueToWaitFor();
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);
189 CompareOperator getCompareOperator();
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);
236 ExpressionPtr getExpressionInputConfig();
237
238 private:
239 friend class DataSwitch;
240 WaitNode();
241 void *d_{ nullptr };
242 };
243
244 } // namespace aubo_scope
245 } // namespace arcs
246 #endif // AUBO_SCOPE_WAIT_NODE_H
analog_io.h
boolean_register.h
ARCS_ABI_EXPORT
#define ARCS_ABI_EXPORT
Definition: class_forward.h:16
arcs::aubo_scope::ProgramNode
Definition: program_node.h:19
arcs::aubo_scope::WaitNode
Definition: wait_node.h:17
arcs::aubo_scope::WaitNode::getBoolValueToWaitFor
bool getBoolValueToWaitFor()
Depending on the type of input this is interpreted in different ways.
arcs::aubo_scope::WaitNode::getDoubleRegisterInput
DoubleRegisterPtr getDoubleRegisterInput()
arcs::aubo_scope::WaitNode::setCompareOperator
void setCompareOperator(CompareOperator compareOperator)
arcs::aubo_scope::WaitNode::setConfigType
void setConfigType(ConfigType type)
arcs::aubo_scope::WaitNode::getDigitalInput
DigitalIoPtr getDigitalInput()
arcs::aubo_scope::WaitNode::getAnalogInput
AnalogIoPtr getAnalogInput()
arcs::aubo_scope::WaitNode::setWaitTime
void setWaitTime(double time)
arcs::aubo_scope::WaitNode::getFloatValueToWaitFor
float getFloatValueToWaitFor()
arcs::aubo_scope::WaitNode::setBoolRegister
void setBoolRegister(BoolRegisterPtr input)
Creates a configuration for waiting for a boolean register to go true or false.
arcs::aubo_scope::WaitNode::WaitNode
WaitNode()
arcs::aubo_scope::WaitNode::CompareOperator
CompareOperator
Compare operator types LESS_THAN and GREATER_THAN used when waiting for an analog input to go lower o...
Definition: wait_node.h:102
arcs::aubo_scope::WaitNode::LESS_THAN
@ LESS_THAN
Definition: wait_node.h:103
arcs::aubo_scope::WaitNode::getConfigType
ConfigType getConfigType()
This method returns the type of configuration.
arcs::aubo_scope::WaitNode::getBoolRegister
BoolRegisterPtr getBoolRegister()
arcs::aubo_scope::WaitNode::setModbusInput
void setModbusInput(ModbusIoPtr input)
Creates a configuration for waiting for a digital MODBUS input to go high or low.
arcs::aubo_scope::WaitNode::getModbusInput
ModbusIoPtr getModbusInput()
arcs::aubo_scope::WaitNode::getWaitTime
double getWaitTime()
arcs::aubo_scope::WaitNode::setDigitalInput
void setDigitalInput(DigitalIoPtr input)
Creates a configuration for waiting for a digital input to go high or low.
arcs::aubo_scope::WaitNode::getCompareOperator
CompareOperator getCompareOperator()
arcs::aubo_scope::WaitNode::WaitNode
WaitNode(WaitNode &&f)
arcs::aubo_scope::WaitNode::ConfigType
ConfigType
The configuration type used to determine which type of configuration this instance is.
Definition: wait_node.h:24
arcs::aubo_scope::WaitNode::NO_TYPE
@ NO_TYPE
Definition: wait_node.h:26
arcs::aubo_scope::WaitNode::ANALOG_INPUT_VOLTAGE
@ ANALOG_INPUT_VOLTAGE
Definition: wait_node.h:74
arcs::aubo_scope::WaitNode::NO_WAIT
@ NO_WAIT
Definition: wait_node.h:35
arcs::aubo_scope::WaitNode::DIGITAL_INPUT
@ DIGITAL_INPUT
Definition: wait_node.h:54
arcs::aubo_scope::WaitNode::ANALOG_INPUT_CURRENT
@ ANALOG_INPUT_CURRENT
Definition: wait_node.h:64
arcs::aubo_scope::WaitNode::TIME
@ TIME
Definition: wait_node.h:44
arcs::aubo_scope::WaitNode::FLOAT_REGISTER_INPUT
@ FLOAT_REGISTER_INPUT
Definition: wait_node.h:84
arcs::aubo_scope::WaitNode::setDoubleRegisterInput
void setDoubleRegisterInput(DoubleRegisterPtr input)
Creates a configuration for waiting for a register to go past a float threshold.
arcs::aubo_scope::WaitNode::setBoolValueToWaitFor
void setBoolValueToWaitFor(bool value)
arcs::aubo_scope::WaitNode::setFloatValueToWaitFor
void setFloatValueToWaitFor(float value)
arcs::aubo_scope::WaitNode::setAnalogInput
void setAnalogInput(AnalogIoPtr input)
Creates a configuration for waiting for an analog input to go past an electric current threshold.
arcs::aubo_scope::WaitNode::WaitNode
WaitNode(WaitNode &f)
arcs::aubo_scope::WaitNode::getExpressionInputConfig
ExpressionPtr getExpressionInputConfig()
arcs::aubo_scope::WaitNode::setExpressionInputConfig
void setExpressionInputConfig(ExpressionPtr expression)
Create a configuration for waiting for an expression to be evaluated to true.
arcs::aubo_scope::WaitNode::~WaitNode
virtual ~WaitNode()
digital_io.h
double_register.h
expression.h
modbus_io.h
arcs::aubo_scope::ARCS_CLASS_FORWARD
ARCS_CLASS_FORWARD(GripForceCapability)
arcs
Definition: contribution_provider.h:7
program_node.h