AuboStudio SDK  0.6.3
ethernet_ip.h
浏览该文件的文档.
1#ifndef AUBO_SCOPE_ETHERNET_IP_H
2#define AUBO_SCOPE_ETHERNET_IP_H
3
5
6namespace arcs {
7namespace aubo_scope {
9
10/**
11 * \chinese
12 * EtherNet/IP IO 接口
13 * 此接口提供对 EtherNet/IP I/O 的支持。
14 * \endchinese
15 * \english
16 * EtherNetIP
17 * This interface provides support for EtherNet/IP I/Os.
18 * \endenglish
19 */
21{
22public:
26
27 /**
28 * \chinese
29 * 获取此EtherNet/IP I/O的字节偏移量
30 * @return 字节偏移量。
31 * \endchinese
32 * \english
33 * Returns the byte offset for this EtherNet/IP I/O.
34 * @return Get the byte offset for this EtherNet/IP I/O.
35 * \endenglish
36 */
38
39 /**
40 * \chinese
41 * 获取此EtherNet/IP I/O的位偏移量
42 * @return 位偏移量。
43 * \endchinese
44 * \english
45 * Returns the bit offset for this EtherNet/IP I/O.
46 * @return Get the bit offset for this EtherNet/IP I/O.
47 * \endenglish
48 */
50
51 /**
52 * \chinese
53 * 判断此EtherNet/IP I/O是否为从站
54 * @return 是否为从站。
55 * \endchinese
56 * \english
57 * Returns whether this EtherNet/IP I/O is a slave.
58 * @return Get the is slave for this EtherNet/IP I/O.
59 * \endenglish
60 */
61 bool isSlave();
62
63 /**
64 * \chinese
65 * 设置EtherNet/IP信号的整数值。
66 * @param value 要设置的整数值。
67 * @return 信号下发成功返回<code>true</code>,否则返回<code>false</code>。
68 * \endchinese
69 * \english
70 * Set EtherNet/IP signal to an integer value.
71 * @param value Set EtherNet/IP signal to an integer value.
72 * @return <code>true</code> if the EtherNet/IP signal was sent down to the
73 * controller, and <code>false</code> if the signal was not sent down.
74 * \endenglish
75 */
76 bool setValue(int value);
77
78 /**
79 * \chinese
80 * 获取EtherNet/IP信号的整数值。
81 * @return EtherNet/IP信号的整数值。
82 * \endchinese
83 * \english
84 * Returns the integer value of the EtherNet/IP signal.
85 * @return the integer value of the EtherNet/IP signal.
86 * \endenglish
87 */
88 int getValue();
89
90private:
91 friend class DataSwitch;
93 void *d_{ nullptr };
94};
95
97{
98 EtherNetIPFilter(Io::IoType type, bool is_input)
99 : type_(type), is_input_(is_input)
100 {
101 }
102 bool operator()(IoPtr io)
103 {
104 return std::dynamic_pointer_cast<EtherNetIP>(io) != nullptr &&
105 io->getType() == type_ && io->isInput() == is_input_;
106 }
107
108private:
111};
112
113} // namespace aubo_scope
114} // namespace arcs
115
116#endif // EtherNet/IPIO_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...
\chinese EtherNet/IP IO 接口 此接口提供对 EtherNet/IP I/O 的支持。 \endchinese \english EtherNetIP This interface...
int getByteOffset()
\chinese 获取此EtherNet/IP I/O的字节偏移量
bool isSlave()
\chinese 判断此EtherNet/IP I/O是否为从站
int getBitOffset()
\chinese 获取此EtherNet/IP I/O的位偏移量
bool setValue(int value)
\chinese 设置EtherNet/IP信号的整数值。
int getValue()
\chinese 获取EtherNet/IP信号的整数值。
EtherNetIPFilter(Io::IoType type, bool is_input)