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
4ea99310
Commit
4ea99310
authored
Oct 24, 2016
by
olivier R-D
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
orders aliases by NodeId when exporting to xml
parent
9cc2ded8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
opcua/common/xmlexporter.py
opcua/common/xmlexporter.py
+9
-5
No files found.
opcua/common/xmlexporter.py
View file @
4ea99310
...
...
@@ -218,7 +218,7 @@ class XmlExporter(object):
dtype
=
node
.
get_data_type
()
if
dtype
.
Identifier
in
o_ids
.
ObjectIdNames
:
dtype_name
=
o_ids
.
ObjectIdNames
[
dtype
.
Identifier
]
self
.
aliases
[
dtype
_name
]
=
dtype
.
to_string
()
self
.
aliases
[
dtype
]
=
dtype_name
else
:
dtype_name
=
dtype
.
to_string
()
rank
=
node
.
get_value_rank
()
...
...
@@ -305,9 +305,13 @@ class XmlExporter(object):
def
_add_alias_els
(
self
):
aliases_el
=
Et
.
Element
(
'Aliases'
)
for
k
,
v
in
self
.
aliases
.
items
():
ref_el
=
Et
.
SubElement
(
aliases_el
,
'Alias'
,
Alias
=
k
)
ref_el
.
text
=
v
ordered_keys
=
list
(
self
.
aliases
.
keys
())
print
(
"KEYS"
,
ordered_keys
)
ordered_keys
.
sort
()
for
nodeid
in
ordered_keys
:
name
=
self
.
aliases
[
nodeid
]
ref_el
=
Et
.
SubElement
(
aliases_el
,
'Alias'
,
Alias
=
name
)
ref_el
.
text
=
nodeid
.
to_string
()
self
.
etree
.
getroot
().
insert
(
0
,
aliases_el
)
...
...
@@ -326,7 +330,7 @@ class XmlExporter(object):
ref_el
.
attrib
[
'IsForward'
]
=
'false'
ref_el
.
text
=
self
.
_node_to_string
(
ref
.
NodeId
)
self
.
aliases
[
ref
_name
]
=
ref
.
ReferenceTypeId
.
to_string
()
self
.
aliases
[
ref
.
ReferenceTypeId
]
=
ref_name
def
member_to_etree
(
el
,
name
,
dtype
,
val
):
...
...
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