diff --git a/frappy_psi/picontrol.py b/frappy_psi/picontrol.py index d1b14f89..f7877068 100644 --- a/frappy_psi/picontrol.py +++ b/frappy_psi/picontrol.py @@ -61,7 +61,7 @@ example cfg: import time import math import numpy as np -from frappy.core import Readable, Writable, Parameter, Attached, IDLE, Property +from frappy.core import Readable, Writable, Parameter, Attached, IDLE, WARN, Property from frappy.lib import clamp, merge_status from frappy.datatypes import LimitsType, EnumType, FloatRange from frappy.errors import SECoPError @@ -296,6 +296,13 @@ class PI(HasConvergence, PImixin): super().write_target(target) self.convergence_start() + def deactivate_control(self, source=None): + super().deactivate_control(source) + if self.isBusy(): + self.convergence_state.stop_status = ( + WARN, f'switched to manual mode by {source or self.name}') + self.convergence_state.start(self.convergence_interrupt) + # unchecked! class PI2(PI):