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
0bfdd9c5
Commit
0bfdd9c5
authored
May 09, 2020
by
oroulet
Committed by
oroulet
May 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
very small improvments
parent
4b3e7e49
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
asyncua/common/structures.py
asyncua/common/structures.py
+2
-1
asyncua/server/server.py
asyncua/server/server.py
+3
-5
No files found.
asyncua/common/structures.py
View file @
0bfdd9c5
...
...
@@ -320,9 +320,10 @@ async def load_enums(server, env=None):
try:
c = await _get_enum_values(name, node)
except ua.UaError as ex:
_logger.
info
("Node %s, %s under DataTypes/Enumeration, does not seem to have a child called EnumString or EumValue: %s", name, node, ex)
_logger.
warning
("Node %s, %s under DataTypes/Enumeration, does not seem to have a child called EnumString or EumValue: %s", name, node, ex)
continue
if not hasattr(ua, c.name):
_logger.warning("Adding enum %s to ua namespace", c)
model.append(c)
return _generate_python_class(model, env=env)
...
...
asyncua/server/server.py
View file @
0bfdd9c5
...
...
@@ -420,19 +420,17 @@ class Server:
"""
get all namespace defined in server
"""
ns_node
=
self
.
get_node
(
ua
.
NodeId
(
ua
.
ObjectIds
.
Server_NamespaceArray
))
return
await
ns_node
.
read_value
()
return
await
self
.
nodes
.
namespace_array
.
read_value
()
async
def
register_namespace
(
self
,
uri
)
->
int
:
"""
Register a new namespace. Nodes should in custom namespace, not 0.
"""
ns_node
=
self
.
get_node
(
ua
.
NodeId
(
ua
.
ObjectIds
.
Server_NamespaceArray
))
uries
=
await
ns_node
.
read_value
()
uries
=
await
self
.
nodes
.
namespace_array
.
read_value
()
if
uri
in
uries
:
return
uries
.
index
(
uri
)
uries
.
append
(
uri
)
await
ns_node
.
write_value
(
uries
)
await
self
.
nodes
.
namespace_array
.
write_value
(
uries
)
return
len
(
uries
)
-
1
async
def
get_namespace_index
(
self
,
uri
):
...
...
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