bug fix in frappy_psi.convergence

+ various doc improvements

Change-Id: I8ce2a1f006a5e4870285ce1f6015510e21d01a13
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/33906
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
This commit is contained in:
2024-06-11 16:47:33 +02:00
parent e74192d45e
commit fa007e4f1c
4 changed files with 11 additions and 5 deletions

View File

@@ -219,7 +219,7 @@ class AsynTcp(AsynConn):
# timeout while waiting
return b''
except ConnectionResetError:
pass # treat equallly as a gracefully disconnected peer
pass # treat equally as a gracefully disconnected peer
# note that when no data is sent on a connection, an interruption might
# not be detected within a reasonable time. sending a heartbeat should
# help in this case.

View File

@@ -38,6 +38,8 @@ class HasControlledBy:
:param name: the name of the module (for controlled_by enum)
:param deactivate_control: a method on the input module to switch off control
called by <controller module>.initModule
"""
if not self.inputCallbacks:
self.inputCallbacks = {}
@@ -75,7 +77,7 @@ class HasOutputModule:
"""mixin for modules having an output module
in the :meth:`write_target` the hardware action to switch to own control should be done
and in addition self.activate_output() should be called
and in addition self.activate_control() should be called
"""
# mandatory=False: it should be possible to configure a module with fixed control
output_module = Attached(HasControlledBy, mandatory=False)
@@ -105,7 +107,10 @@ class HasOutputModule:
self.set_control_active(True)
def deactivate_control(self, source=None):
"""called when an other module takes over control"""
"""called when another module takes over control
registered to be called from the controlled module(s)
"""
if self.control_active:
self.set_control_active(False)
self.log.warning(f'switched to manual mode by {source or self.name}')

View File

@@ -122,7 +122,7 @@ class ProxyModule(HasIO, Module):
self.status = Readable.Status.IDLE, state
else:
readerror = CommunicationFailedError('disconnected')
if self.status != disconnected:
if self.status != DISCONNECTED:
for pname in set(self.parameters) - set(('module', 'status')):
self.announceUpdate(pname, None, readerror)
self.status = self._connection_status = DISCONNECTED

View File

@@ -176,7 +176,7 @@ class HasConvergence:
def convergence_interrupt(self, state):
"""stopping"""
self.__set_status(state.stop_status) # stop called
self.__set_status(*state.stop_status) # stop called
return self.convergence_instable
def stop(self):
@@ -196,3 +196,4 @@ class HasConvergence:
if self.pollInfo:
self.pollInfo.trigger(True)
return value