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
bb5a2ffd
Commit
bb5a2ffd
authored
Jul 30, 2016
by
maljac
Committed by
ORD
Jul 30, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add instantiate support for data types and methods (#259)
parent
f17f79ee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
opcua/common/instantiate.py
opcua/common/instantiate.py
+8
-4
opcua/common/xmlparser.py
opcua/common/xmlparser.py
+1
-1
No files found.
opcua/common/instantiate.py
View file @
bb5a2ffd
...
...
@@ -44,8 +44,8 @@ def _instantiate_node(server, parentid, rdesc, nodeid, bname, recursive=True):
"""
addnode
=
ua
.
AddNodesItem
()
addnode
.
RequestedNewNodeId
=
nodeid
addnode
.
BrowseName
=
bname
addnode
.
RequestedNewNodeId
=
nodeid
addnode
.
BrowseName
=
bname
addnode
.
ParentNodeId
=
parentid
addnode
.
ReferenceTypeId
=
rdesc
.
ReferenceTypeId
addnode
.
TypeDefinition
=
rdesc
.
TypeDefinition
...
...
@@ -59,7 +59,12 @@ def _instantiate_node(server, parentid, rdesc, nodeid, bname, recursive=True):
elif
rdesc
.
NodeClass
in
(
ua
.
NodeClass
.
Variable
,
ua
.
NodeClass
.
VariableType
):
addnode
.
NodeClass
=
ua
.
NodeClass
.
Variable
_read_and_copy_attrs
(
node_type
,
ua
.
VariableAttributes
(),
addnode
)
elif
rdesc
.
NodeClass
in
(
ua
.
NodeClass
.
DataType
,):
addnode
.
NodeClass
=
ua
.
NodeClass
.
DataType
_read_and_copy_attrs
(
node_type
,
ua
.
DataTypeAttributes
(),
addnode
)
elif
rdesc
.
NodeClass
in
(
ua
.
NodeClass
.
Method
,):
addnode
.
NodeClass
=
ua
.
NodeClass
.
Method
_read_and_copy_attrs
(
node_type
,
ua
.
MethodAttributes
(),
addnode
)
else
:
print
(
"Instantiate: Node class not supported: "
,
rdesc
.
NodeClass
)
...
...
@@ -86,4 +91,3 @@ def _read_and_copy_attrs(node_type, struct, addnode):
else
:
print
(
"Instantiate: while copying attributes from node type %s, attribute %s, statuscode is %s"
%
(
node_type
,
name
,
results
[
idx
].
StatusCode
))
addnode
.
NodeAttributes
=
struct
opcua/common/xmlparser.py
View file @
bb5a2ffd
...
...
@@ -80,7 +80,7 @@ class XMLParser(object):
name
=
self
.
_retag
.
match
(
child
.
tag
).
groups
()[
1
]
if
name
==
"Aliases"
:
for
el
in
child
:
self
.
aliases
[
el
.
attrib
[
"Alias"
]]
=
el
.
text
self
.
aliases
[
el
.
attrib
[
"Alias"
]]
=
self
.
_get_node_id
(
el
.
text
)
elif
name
==
'NamespaceUris'
:
for
ns_index
,
ns_element
in
enumerate
(
child
):
ns_uri
=
ns_element
.
text
...
...
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