event_objects.py
Go to the documentation of this file.
1 """
2 This file contains event types as Python objects.
3 
4 TODO: This should be auto-generated but is not!!!!!
5 
6 """
7 
8 from opcua import ua
9 from opcua.common.events import Event
10 
11 
13  """
14  BaseEvent implements BaseEventType from which inherit all other events and it is used per default.
15  """
16  def __init__(self, sourcenode=None, message=None, severity=1):
17  Event.__init__(self)
18  self.add_property("EventId", bytes(), ua.VariantType.ByteString)
19  self.add_property("EventType", ua.NodeId(ua.ObjectIds.BaseEventType), ua.VariantType.NodeId)
20  self.add_property("SourceNode", sourcenode, ua.VariantType.NodeId)
21  self.add_property("SourceName", None, ua.VariantType.String)
22  self.add_property("Time", None, ua.VariantType.DateTime)
23  self.add_property("ReceiveTime", None, ua.VariantType.DateTime)
24  self.add_property("LocalTime", None, ua.VariantType.DateTime)
25  self.add_property("Message", ua.LocalizedText(message), ua.VariantType.LocalizedText)
26  self.add_property("Severity", severity, ua.VariantType.UInt16)
27 
28 
30  """
31  Audit implements AuditEventType from which inherit all other Audit events.
32  """
33  def __init__(self, sourcenode=None, message=None, severity=1):
34  super(AuditEvent, self).__init__(sourcenode, message, severity)
35  self.EventType = ua.NodeId(ua.ObjectIds.AuditEventType)
36  self.add_property("ActionTimeStamp", None, ua.VariantType.DateTime)
37  self.add_property("Status", False, ua.VariantType.Boolean)
38  self.add_property("ServerId", None, ua.VariantType.String)
39  self.add_property("ClientAuditEntryId", None, ua.VariantType.String)
40  self.add_property("ClientUserId", None, ua.VariantType.String)
41 
42 
43 IMPLEMENTED_EVENTS = {
44  ua.ObjectIds.BaseEventType: BaseEvent,
45  ua.ObjectIds.AuditEventType: AuditEvent,
46  }
def __init__(self, sourcenode=None, message=None, severity=1)
def add_property(self, name, val, datatype)
Definition: events.py:36
def __init__(self, sourcenode=None, message=None, severity=1)


ros_opcua_impl_python_opcua
Author(s): Denis Štogl , Daniel Draper
autogenerated on Tue Jan 19 2021 03:12:43