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:
zolliker 2024-06-11 16:47:33 +02:00
parent a4ee261744
commit e093bdae96
2 changed files with 9 additions and 3 deletions

View File

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

View File

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