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
1fc97eac
Commit
1fc97eac
authored
Aug 24, 2016
by
olivier R-D
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add get_current_path method to Node
parent
99453150
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
opcua/common/node.py
opcua/common/node.py
+17
-0
No files found.
opcua/common/node.py
View file @
1fc97eac
...
@@ -353,6 +353,23 @@ class Node(object):
...
@@ -353,6 +353,23 @@ class Node(object):
return
None
return
None
return
references
[
0
].
NodeId
return
references
[
0
].
NodeId
def
get_current_path
(
self
):
"""
Attempt to find current path of node and return it as a list of strings.
There might several possible paths to a node, this function will return one
Some nodes may be missing references, so this method may
return an empty list
"""
path
=
[]
node
=
self
while
True
:
refs
=
node
.
get_references
(
refs
=
ua
.
ObjectIds
.
HierarchicalReferences
,
direction
=
ua
.
BrowseDirection
.
Inverse
)
if
len
(
refs
)
>
0
:
path
.
insert
(
0
,
refs
[
0
].
BrowseName
.
to_string
())
node
=
Node
(
self
.
server
,
refs
[
0
].
NodeId
)
else
:
return
path
def
get_parent
(
self
):
def
get_parent
(
self
):
"""
"""
returns parent of the node.
returns parent of the node.
...
...
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