コード例 #1
0
 def add_object(self, *args):
     parent = self.modeler.tree_ui.get_current_node()
     logger.info("Creating object with args: %s", args)
     nodeid, bname, otype = args
     new_nodes = instantiate(parent, otype, bname=bname, nodeid=nodeid, dname=ua.LocalizedText(bname.Name))
     self._after_add(new_nodes)
     return new_nodes
コード例 #2
0
 def add_object(self, *args):
     parent = self.modeler.tree_ui.get_current_node()
     logger.info("Creating object with args: %s", args)
     nodeid, bname, otype = args
     new_nodes = instantiate(parent, otype, bname=bname, nodeid=nodeid, dname=ua.LocalizedText(bname.Name))
     self._after_add(new_nodes)
     return new_nodes
コード例 #3
0
def create_object(parent, nodeid, bname, objecttype=None):
    """
    create a child node object
    arguments are nodeid, browsename, [objecttype]
    or namespace index, name, [objecttype]
    if objectype is given (a NodeId) then the type node is instantiated inclusive its child nodes
    """
    nodeid, qname = _parse_nodeid_qname(nodeid, bname)
    if objecttype is not None:
        objecttype = node.Node(parent.server, objecttype)
        return instantiate(parent, objecttype, nodeid, bname)
    else:
        return node.Node(parent.server, _create_object(parent.server, parent.nodeid, nodeid, qname, ua.ObjectIds.BaseObjectType))
コード例 #4
0
def create_object(parent, nodeid, bname, objecttype=None):
    """
    create a child node object
    arguments are nodeid, browsename, [objecttype]
    or namespace index, name, [objecttype]
    if objectype is given (a NodeId) then the type node is instantiated inclusive its child nodes
    """
    nodeid, qname = _parse_nodeid_qname(nodeid, bname)
    if objecttype is not None:
        objecttype = node.Node(parent.server, objecttype)
        nodes = instantiate(parent, objecttype, nodeid, bname)[0]
        return nodes
    else:
        return node.Node(parent.server, _create_object(parent.server, parent.nodeid, nodeid, qname, ua.ObjectIds.BaseObjectType))