MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / __init__

Method __init__

opcua/common/events.py:199–215  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

197 class CustomEvent(parent_eventtype):
198
199 def __init__(self):
200 parent_eventtype.__init__(self)
201 self.EventType = node.nodeid
202 curr_node = node
203
204 while curr_node.nodeid.Identifier != parent_identifier:
205 for prop in curr_node.get_properties():
206 name = prop.get_browse_name().Name
207 val = prop.get_data_value()
208 self.add_property(name, val.Value.Value, val.Value.VariantType)
209 parents = curr_node.get_referenced_nodes(refs=ua.ObjectIds.HasSubtype, direction=ua.BrowseDirection.Inverse, includesubtypes=True)
210
211 if len(parents) != 1: # Something went wrong
212 raise UaError("Parent of event type could notbe found")
213 curr_node = parents[0]
214
215 self._freeze = True
216
217 return CustomEvent()
218

Callers

nothing calls this directly

Calls 7

UaErrorClass · 0.90
get_propertiesMethod · 0.80
get_browse_nameMethod · 0.80
get_data_valueMethod · 0.80
get_referenced_nodesMethod · 0.80
__init__Method · 0.45
add_propertyMethod · 0.45

Tested by

no test coverage detected