frappy_psi.picontrol: stop when switching to manual mode

Change-Id: I3ffb9a109fb3b04fbca06f5a72acbfbd19525aae
This commit is contained in:
2025-11-27 07:49:29 +01:00
parent 38dd5b8ebb
commit f57400feb9

View File

@@ -61,7 +61,7 @@ example cfg:
import time import time
import math import math
import numpy as np 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.lib import clamp, merge_status
from frappy.datatypes import LimitsType, EnumType, FloatRange from frappy.datatypes import LimitsType, EnumType, FloatRange
from frappy.errors import SECoPError from frappy.errors import SECoPError
@@ -296,6 +296,13 @@ class PI(HasConvergence, PImixin):
super().write_target(target) super().write_target(target)
self.convergence_start() 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! # unchecked!
class PI2(PI): class PI2(PI):