frappy_psi.furnace: small improvments

- got not ail when _interlock is None

Change-Id: Ic56bf7b7beeabc39bb8ced3388c7d0f14845463a
This commit is contained in:
2025-10-27 11:59:42 +01:00
parent 576723c650
commit 160c3bfaf9

View File

@@ -21,14 +21,12 @@
from frappy.core import Module, Writable, Attached, Parameter, FloatRange, Readable, \
BoolType, ERROR, IDLE, Command, StringType
from frappy.errors import ImpossibleError
from frappy.errors import ImpossibleError, ConfigError
from frappy.ctrlby import WrapControlledBy
from frappy.lib import clamp, merge_status
from frappy_psi.picontrol import PImixin
from frappy_psi.convergence import HasConvergence
from frappy_psi.ionopimax import CurrentInput, LogVoltageInput
import frappy_psi.tdkpower as tdkpower
import frappy_psi.bkpower as bkpower
class Interlocks(Writable):
@@ -161,7 +159,7 @@ class Interlocks(Writable):
def get_violations(self):
violations = {False: [], True: []}
if self.flowswitch and self.flowswitch.value == 0:
violations[seld._disable_flow_check].append('no cooling water')
violations[self._disable_flow_check].append('no cooling water')
for sensor, limitname, disabled in self._sensor_checks:
if sensor.status[0] >= ERROR:
violations[disabled].append(f'error at {sensor.name}: {sensor.status[1]}')
@@ -196,7 +194,9 @@ class PI(HasConvergence, PImixin, Writable):
return self.input_module.value
def read_status(self):
violations = self.callback_func(query=True)
if not self._interlock:
return super().read_status()
violations = self._interlock.interlock_callback(query=True)
status = (ERROR, violations) if violations else super().read_status()
return merge_status(status, self.input_module.status)