AuboStudio SDK  0.6.3
analog_io.h
浏览该文件的文档.
1#ifndef AUBO_SCOPE_ANALOG_IO_H
2#define AUBO_SCOPE_ANALOG_IO_H
3
5
6namespace arcs {
7namespace aubo_scope {
9
10/**
11 * This interface provides support for analog I/Os.
12 *
13 */
15{
16public:
20
23
24 bool isCurrent();
25 bool isVoltage();
26
27 /**
28 * Set analog I/O output signal. Notice the I/O must be an output I/O
29 *
30 * @param value The analog value to be set.
31 * @return <code>true</code> if the analog signal was set,
32 * <code>false</code> if the signal was not set, e.g. because the controller
33 * was not running.
34 */
35 bool setValue(double value);
36
37 /**
38 *
39 * @return Returns the last reading of the I/O.
40 */
41 double getValue();
42
43private:
44 friend class DataSwitch;
46 void *d_{ nullptr };
47};
48
50{
51 AnalogIoFilter(Io::InterfaceType interface, bool is_input)
52 : interface_(interface), is_input_(is_input)
53 {
54 }
55 bool operator()(IoPtr io)
56 {
57 return std::dynamic_pointer_cast<AnalogIo>(io) != nullptr &&
58 io->getInterfaceType() == interface_ &&
59 io->isInput() == is_input_;
60 }
61
62private:
65};
66
67} // namespace aubo_scope
68} // namespace arcs
69
70#endif // AUBO_SCOPE_ANALOG_IO_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...
This interface provides support for analog I/Os.
bool setValue(double value)
Set analog I/O output signal.
AnalogIoFilter(Io::InterfaceType interface, bool is_input)