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
4cf9389f
Commit
4cf9389f
authored
Jul 14, 2016
by
olivier R-D
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove add_subtype and use add_object_type
parent
cea71e27
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
17 deletions
+2
-17
opcua/common/manage_nodes.py
opcua/common/manage_nodes.py
+0
-11
opcua/common/node.py
opcua/common/node.py
+0
-4
opcua/server/server.py
opcua/server/server.py
+1
-1
tests/tests_common.py
tests/tests_common.py
+1
-1
No files found.
opcua/common/manage_nodes.py
View file @
4cf9389f
...
@@ -141,17 +141,6 @@ def create_method(parent, *args):
...
@@ -141,17 +141,6 @@ def create_method(parent, *args):
return
node
.
Node
(
parent
.
server
,
_create_method
(
parent
,
nodeid
,
qname
,
callback
,
inputs
,
outputs
))
return
node
.
Node
(
parent
.
server
,
_create_method
(
parent
,
nodeid
,
qname
,
callback
,
inputs
,
outputs
))
# FIXME: remove, it implicitely means create_object_type
def
create_subtype
(
parent
,
*
args
):
"""
create a child node subtype
arguments are nodeid, browsename
or namespace index, name
"""
nodeid
,
qname
=
_parse_nodeid_qname
(
*
args
[:
2
])
return
node
.
Node
(
parent
.
server
,
_create_object_type
(
parent
.
server
,
parent
.
nodeid
,
nodeid
,
qname
))
def
_create_object
(
server
,
parentnodeid
,
nodeid
,
qname
,
objecttype
):
def
_create_object
(
server
,
parentnodeid
,
nodeid
,
qname
,
objecttype
):
addnode
=
ua
.
AddNodesItem
()
addnode
=
ua
.
AddNodesItem
()
addnode
.
RequestedNewNodeId
=
nodeid
addnode
.
RequestedNewNodeId
=
nodeid
...
...
opcua/common/node.py
View file @
4cf9389f
...
@@ -523,10 +523,6 @@ class Node(object):
...
@@ -523,10 +523,6 @@ class Node(object):
from
opcua.common
import
manage_nodes
from
opcua.common
import
manage_nodes
return
manage_nodes
.
create_method
(
*
args
,
**
kwargs
)
return
manage_nodes
.
create_method
(
*
args
,
**
kwargs
)
def
add_subtype
(
*
args
,
**
kwargs
):
from
opcua.common
import
manage_nodes
return
manage_nodes
.
create_subtype
(
*
args
,
**
kwargs
)
def
call_method
(
*
args
,
**
kwargs
):
def
call_method
(
*
args
,
**
kwargs
):
from
opcua.common
import
methods
from
opcua.common
import
methods
return
methods
.
call_method
(
*
args
,
**
kwargs
)
return
methods
.
call_method
(
*
args
,
**
kwargs
)
opcua/server/server.py
View file @
4cf9389f
...
@@ -370,7 +370,7 @@ class Server(object):
...
@@ -370,7 +370,7 @@ class Server(object):
else
:
else
:
base_t
=
Node
(
self
.
iserver
.
isession
,
ua
.
NodeId
(
basetype
))
base_t
=
Node
(
self
.
iserver
.
isession
,
ua
.
NodeId
(
basetype
))
custom_t
=
base_t
.
add_
sub
type
(
idx
,
name
)
custom_t
=
base_t
.
add_
object_
type
(
idx
,
name
)
for
property
in
properties
:
for
property
in
properties
:
datatype
=
None
datatype
=
None
if
len
(
property
)
>
2
:
if
len
(
property
)
>
2
:
...
...
tests/tests_common.py
View file @
4cf9389f
...
@@ -505,7 +505,7 @@ class CommonTests(object):
...
@@ -505,7 +505,7 @@ class CommonTests(object):
self
.
assertEqual
(
o
.
get_type_definition
(),
ua
.
ObjectIds
.
BaseObjectType
)
self
.
assertEqual
(
o
.
get_type_definition
(),
ua
.
ObjectIds
.
BaseObjectType
)
base_otype
=
self
.
opc
.
get_node
(
ua
.
ObjectIds
.
BaseObjectType
)
base_otype
=
self
.
opc
.
get_node
(
ua
.
ObjectIds
.
BaseObjectType
)
custom_otype
=
base_otype
.
add_
sub
type
(
2
,
'MyFooObjectType'
)
custom_otype
=
base_otype
.
add_
object_
type
(
2
,
'MyFooObjectType'
)
o
=
f
.
add_object
(
3
,
'MyObject3'
,
custom_otype
.
nodeid
)
o
=
f
.
add_object
(
3
,
'MyObject3'
,
custom_otype
.
nodeid
)
self
.
assertEqual
(
o
.
get_type_definition
(),
custom_otype
.
nodeid
.
Identifier
)
self
.
assertEqual
(
o
.
get_type_definition
(),
custom_otype
.
nodeid
.
Identifier
)
...
...
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