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
56965b33
Commit
56965b33
authored
Nov 29, 2017
by
Mathias Lüdtke
Committed by
oroulet
Nov 29, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
migrate all nodeids in XMLImporter
parent
daf9d026
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
opcua/common/xmlimporter.py
opcua/common/xmlimporter.py
+6
-3
No files found.
opcua/common/xmlimporter.py
View file @
56965b33
...
...
@@ -43,7 +43,7 @@ class XmlImporter(object):
"""
aliases_mapped
=
{}
for
alias
,
node_id
in
aliases
.
items
():
aliases_mapped
[
alias
]
=
self
.
_migrate_ns
(
self
.
to_nodeid
(
node_id
)
)
aliases_mapped
[
alias
]
=
self
.
to_nodeid
(
node_id
)
return
aliases_mapped
def
import_xml
(
self
,
xmlpath
):
...
...
@@ -151,7 +151,7 @@ class XmlImporter(object):
node
.
TypeDefinition
=
self
.
_migrate_ns
(
obj
.
typedef
)
return
node
def
to_nodeid
(
self
,
nodeid
):
def
_
to_nodeid
(
self
,
nodeid
):
if
isinstance
(
nodeid
,
ua
.
NodeId
):
return
nodeid
elif
not
nodeid
:
...
...
@@ -166,6 +166,9 @@ class XmlImporter(object):
else
:
return
ua
.
NodeId
(
getattr
(
ua
.
ObjectIds
,
nodeid
))
def
to_nodeid
(
self
,
nodeid
):
return
self
.
_migrate_ns
(
self
.
_to_nodeid
(
nodeid
))
def
add_object
(
self
,
obj
):
node
=
self
.
_get_node
(
obj
)
attrs
=
ua
.
ObjectAttributes
()
...
...
@@ -398,7 +401,7 @@ class XmlImporter(object):
ref
.
ReferenceTypeId
=
self
.
to_nodeid
(
data
.
reftype
)
ref
.
SourceNodeId
=
self
.
_migrate_ns
(
obj
.
nodeid
)
ref
.
TargetNodeClass
=
ua
.
NodeClass
.
DataType
ref
.
TargetNodeId
=
self
.
_migrate_ns
(
self
.
to_nodeid
(
data
.
target
)
)
ref
.
TargetNodeId
=
self
.
to_nodeid
(
data
.
target
)
refs
.
append
(
ref
)
self
.
_add_references
(
refs
)
...
...
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