AuboStudio SDK  0.6.3
profinet.h
Go to the documentation of this file.
1 #ifndef AUBO_SCOPE_PROFINET_H
2 #define AUBO_SCOPE_PROFINET_H
3 
5 
6 namespace arcs {
7 namespace aubo_scope {
8 ARCS_CLASS_FORWARD(Profinet);
9 
10 /**
11  *
12  * This interface provides support for PROFINET I/Os.
13  */
14 class ARCS_ABI_EXPORT Profinet : public Io
15 {
16 public:
17  Profinet(Profinet &f);
18  Profinet(Profinet &&f);
19  ~Profinet();
20 
21  /**
22  *
23  * @return Get the byte offset for this Profinet I/O.
24  */
25  int getByteOffset();
26 
27  /**
28  *
29  * @return Get the bit offset for this Profinet I/O.
30  */
31  int getBitOffset();
32 
33  /**
34  *
35  * @return Get the is slave for this Profinet I/O.
36  */
37  bool isSlave();
38 
39  /**
40  *
41  * @param value Set PROFINET signal to an integer value. If the PROFINET
42  * signal is digital, then <code>false</code> is represented by 0 and
43  * <code>true</code> are represented by all numbers different from 0.
44  *
45  * @return <code>true</code> if the PROFINET signal was sent down to the
46  * controller, and <code>false</code> if the signal was not sent down, e.g.
47  * because the controller was not running. Notice that the PROFINET signal
48  * must support writes, consult the Aubo PROFINET protocol.
49  */
50  bool setValue(int value);
51 
52  /**
53  *
54  * @return the integer value of the PROFINET signal. If the PROFINET signal
55  * is digital then <code>false</code> is represented by 0 and
56  * <code>true}</code> is represented by the value 1.
57  */
58  int getValue();
59 
60 private:
61  friend class DataSwitch;
62  Profinet();
63  void *d_{ nullptr };
64 };
65 
67 {
68  ProfinetFilter(Io::IoType type, bool is_input)
69  : type_(type), is_input_(is_input)
70  {
71  }
72  bool operator()(IoPtr io)
73  {
74  return std::dynamic_pointer_cast<Profinet>(io) != nullptr &&
75  io->getType() == type_ && io->isInput() == is_input_;
76  }
77 
78 private:
80  bool is_input_;
81 };
82 
83 } // namespace aubo_scope
84 } // namespace arcs
85 
86 #endif // PROFINETIO_H
ARCS_CLASS_FORWARD(GripForceCapability)
This is the base interface representing all types of I/Os available in AuboScope. ...
Definition: io.h:16
ProfinetFilter(Io::IoType type, bool is_input)
Definition: profinet.h:68
This interface provides support for PROFINET I/Os.
Definition: profinet.h:14
#define ARCS_ABI_EXPORT
Definition: class_forward.h:16
IoType getType() const