Commit 13c9702e authored by oroulet's avatar oroulet

small stuff from brubbel

parent 347dac10
......@@ -266,7 +266,7 @@ async def _create_variable(server, parentnodeid, nodeid, qname, var, datatype=No
attrs.ArrayDimensions = var.Dimensions
attrs.WriteMask = 0
attrs.UserWriteMask = 0
attrs.Historizing = 0
attrs.Historizing = False
attrs.AccessLevel = ua.AccessLevel.CurrentRead.mask
attrs.UserAccessLevel = ua.AccessLevel.CurrentRead.mask
addnode.NodeAttributes = attrs
......
......@@ -136,12 +136,12 @@ class ViewService(object):
res += self._get_sub_ref(ref.NodeId)
return res
def _suitable_direction(self, desc, isforward):
if desc == ua.BrowseDirection.Both:
def _suitable_direction(self, direction, isforward):
if direction == ua.BrowseDirection.Both:
return True
if desc == ua.BrowseDirection.Forward and isforward:
if direction == ua.BrowseDirection.Forward and isforward:
return True
if desc == ua.BrowseDirection.Inverse and not isforward:
if direction == ua.BrowseDirection.Inverse and not isforward:
return True
return False
......
......@@ -164,7 +164,7 @@ class InternalServer:
self.logger.info('starting internal server')
for edp in self.endpoints:
self._known_servers[edp.Server.ApplicationUri] = ServerDesc(edp.Server)
await Node(self.isession, ua.NodeId(ua.ObjectIds.Server_ServerStatus_State)).write_value(0, ua.VariantType.Int32)
await Node(self.isession, ua.NodeId(ua.ObjectIds.Server_ServerStatus_State)).write_value(ua.ServerState.Running, ua.VariantType.Int32)
await Node(self.isession, ua.NodeId(ua.ObjectIds.Server_ServerStatus_StartTime)).write_value(datetime.utcnow())
if not self.disabled_clock:
self._set_current_time()
......
......@@ -25,8 +25,7 @@ class InternalSession:
_counter = 10
_auth_counter = 1000
def __init__(self, internal_server, aspace: AddressSpace, submgr: SubscriptionService, name, user=User.Anonymous,
external=False):
def __init__(self, internal_server, aspace: AddressSpace, submgr: SubscriptionService, name, user=User.Anonymous, external=False):
self.logger = logging.getLogger(__name__)
self.iserver = internal_server
# define if session is external, we need to copy some objects if it is internal
......
......@@ -171,10 +171,10 @@ class InternalSubscription:
def republish(self, nb):
#self.logger.info("re-publish request for ack %s in subscription %s", nb, self)
notification_message = self._not_acknowledged_results.pop(nb, None)
if notification_message:
result = self._not_acknowledged_results.pop(nb, None)
if result:
self.logger.info("re-publishing ack %s in subscription %s", nb, self)
return notification_message
return result.NotificationMessage
self.logger.info("Error request to re-published non existing ack %s in subscription %s", nb, self)
return ua.NotificationMessage()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment