Commit cdb5ced5 authored by Perceval Guillou's avatar Perceval Guillou
Browse files

prevent the loop regulation to be stopped

parent 5019f7cd
Pipeline #32725 failed with stages
in 98 minutes and 45 seconds
......@@ -511,20 +511,6 @@ class Output(SamplingCounterController):
else:
return self._controller.is_output_ramping(self)
@lazy_init
def set_in_safe_mode(self):
try:
return self._controller.set_in_safe_mode(self)
except NotImplementedError:
# if self.limits[0] is not None:
# self.set_value(self.limits[0])
# else:
# self.set_value(0)
pass
@lazy_init
def _set_value(self, value):
""" Set the value for the output. Value is expressed in output unit """
......@@ -677,9 +663,6 @@ class ExternalOutput(Output):
else:
raise TypeError("the associated device must be an 'Axis'")
def set_in_safe_mode(self):
pass
@with_custom_members
class Loop(SamplingCounterController):
......@@ -1001,25 +984,22 @@ class Loop(SamplingCounterController):
self._start_ramping(value)
def stop(self):
""" Stop the regulation and ramping (if any) """
""" Stop the ramping """
log_debug(self, "Loop:stop")
self._stop_ramping()
self._stop_regulation()
def abort(self):
""" Stop the regulation and ramping (if any) and set output device to minimum value """
""" Stop the ramping (alias for stop) """
log_debug(self, "Loop:abort")
self._stop_ramping()
self._stop_regulation()
self.output.set_in_safe_mode()
##--- SOFT AXIS METHODS: makes the Loop object scannable (ex: ascan(loop, ...) )
@property
# @property
@autocomplete_property
def axis(self):
""" Return a SoftAxis object that makes the Loop scanable """
......@@ -1039,6 +1019,7 @@ class Loop(SamplingCounterController):
def axis_stop(self):
""" Set the setpoint to the current input device value as if stopping a move on an axis """
self._stop_ramping()
self._first_scan_move = True
def axis_state(self):
......
......@@ -162,9 +162,6 @@ class NhqOutput(ExternalOutput):
self.device.setpoint = value
def set_in_safe_mode(self):
pass
class NhqCC(SamplingCounterController):
def __init__(self, name, nhq):
......
......@@ -541,19 +541,6 @@ class LakeShore331(Controller):
log_debug_data(self, "raw answer", asw)
return asw.decode()
# ------ safety methods (optional) ------------------------------
def set_in_safe_mode(self, toutput):
"""
Set the output in a safe mode (like stop heating)
Args:
toutput: Output class type object
"""
log_info(self, "set_in_safe_mode: %s" % (toutput))
toutput.range = 0
# ----- controller specific methods -----------------
@_send_limit
......
......@@ -481,19 +481,6 @@ class LinkamTms94(Controller):
# return asw
raise NotImplementedError
# ------ safety methods (optional) ------------------------------
def set_in_safe_mode(self, toutput):
"""
Set the output in a safe mode (like stop heating)
Raises NotImplementedError if not defined by inheriting class
Args:
toutput: Output class type object
"""
log_info(self, "Controller:set_in_safe_mode: %s" % (toutput))
# set_hold_on ????
# ----- controller specific methods --------------------------
@_send_limit
......
......@@ -561,19 +561,6 @@ class Controller:
log_info(self, "Controller:WRraw:")
raise NotImplementedError
# ------ safety methods (optional) ------------------------------
def set_in_safe_mode(self, toutput):
"""
Set the output in a safe mode (like stop heating)
Raises NotImplementedError if not defined by inheriting class
Args:
toutput: Output class type object
"""
log_info(self, "Controller:set_in_safe_mode: %s" % (toutput))
raise NotImplementedError
# --- controller methods to customize the PID algo (optional) ------------------------
def get_sampling_frequency(self, tloop):
......
......@@ -193,7 +193,7 @@ class ChainPreset:
Called at the end of the scan just before calling **stop** on detectors
"""
pass
def stop(self, chain):
"""
Called at the end of the chain iteration.
......@@ -909,7 +909,7 @@ class AcquisitionChainIter:
all_tasks = []
stats_dict = self.__acquisition_chain_ref()._stats_dict
with capture_exceptions(raise_index=0) as capture:
#call before_stop on preset
# call before_stop on preset
with capture():
preset_tasks = [
gevent.spawn(preset.before_stop, self.acquisition_chain)
......
Supports Markdown
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