From 0932228596cd06d571f2d3e6cf6ed567d8e99e1f Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Wed, 14 Jun 2023 11:28:59 +0200 Subject: [PATCH] frappy_psi.mercury/triton: add control_off command frappy_psi.triton.TemperatureLoop has not output module to deactivate control -> add control_off also to loops in frappy_psi.mercury Change-Id: I4dc4333134da34a8d3ae0f3c037a1e5b108c95a1 Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/31341 Tested-by: Jenkins Automated Tests Reviewed-by: Enrico Faulhaber Reviewed-by: Markus Zolliker --- frappy_psi/mercury.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frappy_psi/mercury.py b/frappy_psi/mercury.py index 8c88dfd..40202be 100644 --- a/frappy_psi/mercury.py +++ b/frappy_psi/mercury.py @@ -25,7 +25,7 @@ import math import re import time -from frappy.core import Drivable, HasIO, Writable, StatusType, \ +from frappy.core import Command, Drivable, HasIO, Writable, StatusType, \ Parameter, Property, Readable, StringIO, Attached, IDLE, RAMPING, nopoll from frappy.datatypes import EnumType, FloatRange, StringType, StructOf, BoolType, TupleOf from frappy.errors import HardwareError, ProgrammingError, ConfigError, RangeError @@ -218,7 +218,6 @@ class HasInput(HasControlledBy, MercuryChannel): class Loop(HasOutputModule, MercuryChannel, Drivable): """common base class for loops""" output_module = Attached(HasInput, mandatory=False) - control_active = Parameter(readonly=False) ctrlpars = Parameter( 'pid (proportional band, integral time, differential time', StructOf(p=FloatRange(0, unit='$'), i=FloatRange(0, unit='min'), d=FloatRange(0, unit='min')), @@ -254,6 +253,13 @@ class Loop(HasOutputModule, MercuryChannel, Drivable): def read_status(self): return IDLE, '' + @Command() + def control_off(self): + """switch control off""" + # remark: this is needed in frappy_psi.trition.TemperatureLoop, as the heater + # output is not available there. We define it here as a convenience for the user. + self.write_control_active(False) + class ConvLoop(HasConvergence, Loop): def deactivate_control(self, source):