From 8bc0671f73f7e0aec1fde5268005bd8bb5fb1d96 Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Wed, 12 Jun 2024 11:24:26 +0200 Subject: [PATCH] fs furnace: move PI with relais to frappy_psi/furnace.py Change-Id: Ia8bec296035b3ae23a698f041fe8be39d925d996 --- cfg/vf_cfg.py | 2 +- frappy_psi/furnace.py | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/cfg/vf_cfg.py b/cfg/vf_cfg.py index ad7e44b..29819e9 100644 --- a/cfg/vf_cfg.py +++ b/cfg/vf_cfg.py @@ -67,7 +67,7 @@ Mod('T_wall', ) Mod('T', - 'frappy_psi.picontrol.PI', + 'frappy_psi.furnace.PI', 'controlled Temperature', input = 'T_htr', output = 'out', diff --git a/frappy_psi/furnace.py b/frappy_psi/furnace.py index 6db7e3f..1a9f78b 100644 --- a/frappy_psi/furnace.py +++ b/frappy_psi/furnace.py @@ -20,7 +20,10 @@ """interlocks for furnance""" import time -from frappy.core import Module, Writable, Attached, Parameter, FloatRange, Readable, BoolType, ERROR, IDLE +from frappy.core import Module, Writable, Attached, Parameter, FloatRange, Readable,\ + BoolType, ERROR, IDLE +from frappy_psi.picontrol import PImixin + class Interlocks(Module): input = Attached(Readable, 'the input module') @@ -45,5 +48,16 @@ class Interlocks(Module): return self.control.write_control_active(False) self.relais.write_target(False) - - \ No newline at end of file + + +class PI(PImixin, Writable): + input = Attached(Readable, 'the input module') + relais = Attached(Writable, 'the interlock relais', mandatory=False) + + def read_value(self): + return self.input.value + + def write_target(self, value): + super().write_target(value) + if self.relais: + self.relais.write_target(1)