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
8d501b27
Commit
8d501b27
authored
Mar 21, 2015
by
Olivier R-D
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small cleanup
parent
dd901cad
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
20 deletions
+11
-20
opcua/node.py
opcua/node.py
+11
-20
No files found.
opcua/node.py
View file @
8d501b27
...
...
@@ -113,6 +113,8 @@ class Node(object):
def
add_folder
(
self
,
*
args
):
"""
create a child node folder
arguments are nodeid, browsename
or namespace index, name
"""
nodeid
,
qname
=
self
.
_parse_add_args
(
*
args
)
return
self
.
_add_folder
(
nodeid
,
qname
)
...
...
@@ -158,9 +160,6 @@ class Node(object):
results
[
0
].
StatusCode
.
check
()
return
Node
(
self
.
server
,
nodeid
)
#def add_property(self, *args):
#return self.add_variable(*args, isproperty=True)
def
add_property
(
self
,
*
args
):
"""
create a child node property
...
...
@@ -168,14 +167,7 @@ class Node(object):
or idx, name, value, [variant type]
"""
nodeid
,
qname
=
self
.
_parse_add_args
(
*
args
[:
2
])
val
=
args
[
2
]
if
type
(
val
)
is
ua
.
Variant
:
return
self
.
_add_variable
(
nodeid
,
qname
,
val
)
else
:
if
len
(
args
)
>
3
:
val
=
ua
.
Variant
(
val
,
args
[
3
])
else
:
val
=
ua
.
Variant
(
val
)
val
=
self
.
_to_variant
(
*
args
[
2
:])
return
self
.
_add_variable
(
nodeid
,
qname
,
val
,
isproperty
=
True
)
def
add_variable
(
self
,
*
args
):
...
...
@@ -185,15 +177,14 @@ class Node(object):
or idx, name, value, [variant type]
"""
nodeid
,
qname
=
self
.
_parse_add_args
(
*
args
[:
2
])
val
=
args
[
2
]
val
=
self
.
_to_variant
(
*
args
[
2
:])
return
self
.
_add_variable
(
nodeid
,
qname
,
val
,
isproperty
=
False
)
def
_to_variant
(
self
,
val
,
vtype
=
None
):
if
type
(
val
)
is
ua
.
Variant
:
return
self
.
_add_variable
(
nodeid
,
qname
,
val
)
return
val
else
:
if
len
(
args
)
>
3
:
val
=
ua
.
Variant
(
val
,
args
[
3
])
else
:
val
=
ua
.
Variant
(
val
)
return
self
.
_add_variable
(
nodeid
,
qname
,
val
,
isproperty
=
False
)
return
ua
.
Variant
(
val
,
vtype
)
def
_add_variable
(
self
,
nodeid
,
qname
,
val
,
isproperty
=
False
):
node
=
ua
.
AddNodesItem
()
...
...
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