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)