Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
opcua-asyncio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nikola Balog
opcua-asyncio
Commits
a9e7cb0e
Commit
a9e7cb0e
authored
Jul 20, 2020
by
Andreas Heine
Committed by
GitHub
Jul 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update instantiate_util.py
parent
78bc1928
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
asyncua/common/instantiate_util.py
asyncua/common/instantiate_util.py
+10
-7
No files found.
asyncua/common/instantiate_util.py
View file @
a9e7cb0e
...
...
@@ -12,7 +12,7 @@ from .node_factory import make_node
logger
=
logging
.
getLogger
(
__name__
)
async
def
instantiate
(
parent
,
node_type
,
nodeid
=
None
,
bname
=
None
,
dname
=
None
,
idx
=
0
,
instantiate_optional
=
Tru
e
):
async
def
instantiate
(
parent
,
node_type
,
nodeid
=
None
,
bname
=
None
,
dname
=
None
,
idx
=
0
,
instantiate_optional
=
Fals
e
):
"""
instantiate a node type under a parent node.
nodeid and browse name of new node can be specified, or just namespace index
...
...
@@ -49,7 +49,7 @@ async def _instantiate_node(server,
bname
,
dname
=
None
,
recursive
=
True
,
instantiate_optional
=
Tru
e
):
instantiate_optional
=
Fals
e
):
"""
instantiate a node type under parent
"""
...
...
@@ -95,13 +95,16 @@ async def _instantiate_node(server,
if
not
refs
:
# spec says to ignore nodes without modelling rules
logger
.
info
(
"Instantiate: Skip node without modelling rule %s as part of %s"
,
c_rdesc
.
BrowseName
,
addnode
.
BrowseName
)
c_rdesc
.
BrowseName
,
addnode
.
BrowseName
)
continue
# exclude nodes with optional ModellingRule if requested
if
not
instantiate_optional
or
refs
[
0
].
nodeid
==
ua
.
NodeId
(
ua
.
ObjectIds
.
ModellingRule_Optional
):
logger
.
info
(
"Instantiate: Skip optional node %s as part of %s"
,
c_rdesc
.
BrowseName
,
addnode
.
BrowseName
)
continue
if
refs
[
0
].
nodeid
==
ua
.
NodeId
(
ua
.
ObjectIds
.
ModellingRule_Optional
):
#not instantiate_optional or refs[0].nodeid == ua.NodeId(ua.ObjectIds.ModellingRule_Optional):
if
instantiate_optional
:
pass
else
:
logger
.
info
(
"Instantiate: Skip optional node %s as part of %s"
,
c_rdesc
.
BrowseName
,
addnode
.
BrowseName
)
continue
# if root node being instantiated has a String NodeId, create the children with a String NodeId
if
res
.
AddedNodeId
.
NodeIdType
is
ua
.
NodeIdType
.
String
:
inst_nodeid
=
res
.
AddedNodeId
.
Identifier
+
"."
+
c_rdesc
.
BrowseName
.
Name
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment