From ff1f23ce4d70a83ae9c4de3b24e960293de94e4d Mon Sep 17 00:00:00 2001 From: Jack Harper Date: Wed, 25 Oct 2023 17:11:36 +0100 Subject: [PATCH 1/2] remove units sp option, add vent status and SP --- pace5000Sup/pace5000.db | 64 +++++++++++++++---- pace5000Sup/pace5000.proto | 9 +++ .../lewis_emulators/Pace5000/device.py | 9 +++ .../Pace5000/interfaces/stream_interface.py | 10 +++ system_tests/tests/pace5000.py | 24 ++++++- 5 files changed, 101 insertions(+), 15 deletions(-) diff --git a/pace5000Sup/pace5000.db b/pace5000Sup/pace5000.db index 489b621..0c88415 100644 --- a/pace5000Sup/pace5000.db +++ b/pace5000Sup/pace5000.db @@ -233,23 +233,14 @@ record(stringout, "$(P)UNITS:SP") { field(SIML, "$(P)SIM") field(SIOL, "$(P)SIM:UNITS:SP") field(SDIS, "$(P)DISABLE") - info(INTEREST, "HIGH") - info(archive, "VAL") -} -record(stringout, "$(P)UNITS:SP_NO_ACTION") { - field(DESC, "Set Device Units but do not Action") - info(INTEREST, "LOW") + # Enforce units at startup + field(VAL, "Bar") + field(PINI, "YES") + info(INTEREST, "HIGH") info(archive, "VAL") } -record(stringout, "$(P)UNITS:SP:_SETTER") { - field(DESC, "Propagate string value to setpoint") - field(OMSL, "closed_loop") - field(DOL, "$(P)UNITS:SP_NO_ACTION") - field(OUT, "$(P)UNITS:SP CA") -} - ############################################# record(bi, "$(P)STATE") { @@ -330,6 +321,53 @@ record(ai, "$(P)LIMIT:LOWER") { info(archive, "VAL") } +record(longin, "$(P)VENT_THRESHOLD") { + field(DTYP, "Soft Channel") + field(VAL, "$(VENT_THRESHOLD=5)") +} + +record(mbbi, "$(P)VENT_STATUS") { + field(DTYP, "stream") + field(SCAN, "1 second") + field(INP, "@pace5000.proto getVent $(PORT)") + field(ZRVL, "0") + field(ZRST, "Vent OK") + field(ONVL, "1") + field(ONST, "Vent in progress") + field(TWVL, "2") + field(TWST, "Vent finished") + field(SIML, "$(P)SIM") + field(SIOL, "$(P)SIM:VENT_STATUS") + field(SDIS, "$(P)DISABLE") + info(archive, "VAL") +} + +record(bo, "$(P)VENT:SP") { + field(DESC, "Start/abort venting") + field(ZNAM, "ABORT") + field(ONAM, "START") + field(FLNK, "$(P)VENT:SP:CALC.PROC") +} + +record(calcout, "$(P)VENT:SP:CALC") +{ + field(DESC, "vent if rbv Date: Thu, 26 Oct 2023 10:37:24 +0100 Subject: [PATCH 2/2] check pressure after vent status --- system_tests/tests/pace5000.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/system_tests/tests/pace5000.py b/system_tests/tests/pace5000.py index eb41ee6..75162e6 100644 --- a/system_tests/tests/pace5000.py +++ b/system_tests/tests/pace5000.py @@ -84,6 +84,7 @@ def test_WHEN_pressure_above_vent_threshold_THEN_cannot_vent(self): self.ca.set_pv_value("VENT:SP", 1) self.ca.assert_that_pv_is_not("VENT:SP:OUT", 1) self.ca.assert_that_pv_is("VENT_STATUS.RVAL", 0) + self.ca.assert_that_pv_is("PRESSURE", pressure) @skip_if_recsim("requires emulator logic") def test_WHEN_pressure_below_vent_threshold_THEN_can_vent(self): @@ -94,6 +95,7 @@ def test_WHEN_pressure_below_vent_threshold_THEN_can_vent(self): self.ca.set_pv_value("VENT_THRESHOLD", threshold) self.ca.set_pv_value("VENT:SP", 1) self.ca.assert_that_pv_is("VENT_STATUS.RVAL", 2) + self.ca.assert_that_pv_is("PRESSURE", 0) @parameterized.expand(parameterized_list([ ("PRESSURE:SP:RBV", "PRESSURE:SP", 0.5),