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
3728c0ae
Commit
3728c0ae
authored
Oct 09, 2016
by
olivier R-D
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create_variable_type: do not set attributes that should not be set
parent
c217b806
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
opcua/common/manage_nodes.py
opcua/common/manage_nodes.py
+3
-5
No files found.
opcua/common/manage_nodes.py
View file @
3728c0ae
...
...
@@ -51,7 +51,8 @@ def create_object(parent, nodeid, bname, objecttype=None):
nodeid
,
qname
=
_parse_nodeid_qname
(
nodeid
,
bname
)
if
objecttype
is
not
None
:
objecttype
=
node
.
Node
(
parent
.
server
,
objecttype
)
return
instantiate
(
parent
,
objecttype
,
nodeid
,
bname
)[
0
]
nodes
=
instantiate
(
parent
,
objecttype
,
nodeid
,
bname
)[
0
]
return
nodes
else
:
return
node
.
Node
(
parent
.
server
,
_create_object
(
parent
.
server
,
parent
.
nodeid
,
nodeid
,
qname
,
ua
.
ObjectIds
.
BaseObjectType
))
...
...
@@ -95,7 +96,7 @@ def create_variable_type(parent, nodeid, bname, datatype):
"""
nodeid
,
qname
=
_parse_nodeid_qname
(
nodeid
,
bname
)
if
datatype
and
not
isinstance
(
datatype
,
ua
.
NodeId
):
raise
RuntimeError
()
raise
RuntimeError
(
"Data type should be nodeid, got {}"
.
format
(
datatype
)
)
addnode
=
ua
.
AddNodesItem
()
addnode
.
RequestedNewNodeId
=
nodeid
addnode
.
BrowseName
=
qname
...
...
@@ -109,9 +110,6 @@ def create_variable_type(parent, nodeid, bname, datatype):
attrs
.
IsAbstract
=
False
attrs
.
WriteMask
=
0
attrs
.
UserWriteMask
=
0
attrs
.
Historizing
=
0
attrs
.
AccessLevel
=
ua
.
AccessLevel
.
CurrentRead
.
mask
attrs
.
UserAccessLevel
=
ua
.
AccessLevel
.
CurrentRead
.
mask
addnode
.
NodeAttributes
=
attrs
results
=
parent
.
server
.
add_nodes
([
addnode
])
results
[
0
].
StatusCode
.
check
()
...
...
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