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
6b2b0544
Commit
6b2b0544
authored
Nov 17, 2016
by
olivier R-D
Committed by
ORD
Nov 17, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
copy type definition when copying node
parent
8f3ed5fc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
3 deletions
+5
-3
opcua/common/copy_node.py
opcua/common/copy_node.py
+3
-2
opcua/common/instantiate.py
opcua/common/instantiate.py
+1
-0
opcua/common/manage_nodes.py
opcua/common/manage_nodes.py
+1
-1
No files found.
opcua/common/copy_node.py
View file @
6b2b0544
...
...
@@ -55,11 +55,12 @@ def _rdesc_from_node(parent, node):
rdesc
.
ReferenceTypeId
=
ua
.
NodeId
(
ua
.
ObjectIds
.
Organizes
)
else
:
rdesc
.
ReferenceTypeId
=
ua
.
NodeId
(
ua
.
ObjectIds
.
HasComponent
)
rdesc
.
TypeDefinition
=
node
.
nodeid
typedef
=
node
.
get_type_definition
()
if
typedef
:
rdesc
.
TypeDefinition
=
typedef
return
rdesc
def
_read_and_copy_attrs
(
node_type
,
struct
,
addnode
):
names
=
[
name
for
name
in
struct
.
__dict__
.
keys
()
if
not
name
.
startswith
(
"_"
)
and
name
not
in
(
"BodyLength"
,
"TypeId"
,
"SpecifiedAttributes"
,
"Encoding"
,
"IsAbstract"
,
"EventNotifier"
)]
attrs
=
[
getattr
(
ua
.
AttributeIds
,
name
)
for
name
in
names
]
...
...
opcua/common/instantiate.py
View file @
6b2b0544
...
...
@@ -17,6 +17,7 @@ def instantiate(parent, node_type, nodeid=None, bname=None, idx=0):
properties are also instantiated
"""
rdesc
=
_rdesc_from_node
(
parent
,
node_type
)
rdesc
.
TypeDefinition
=
node_type
.
nodeid
if
nodeid
is
None
:
nodeid
=
ua
.
NodeId
(
namespaceidx
=
idx
)
# will trigger automatic node generation in namespace idx
...
...
opcua/common/manage_nodes.py
View file @
6b2b0544
...
...
@@ -185,7 +185,7 @@ def _create_object(server, parentnodeid, nodeid, qname, objecttype):
addnode
.
NodeClass
=
ua
.
NodeClass
.
Object
if
isinstance
(
objecttype
,
int
):
addnode
.
TypeDefinition
=
ua
.
NodeId
(
objecttype
)
el
if
isinstance
(
objecttype
,
ua
.
NodeId
)
:
el
se
:
addnode
.
TypeDefinition
=
objecttype
attrs
=
ua
.
ObjectAttributes
()
attrs
.
EventNotifier
=
0
...
...
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