diff --git a/ibek-support-dls b/ibek-support-dls index 2d69b21..3d1d675 160000 --- a/ibek-support-dls +++ b/ibek-support-dls @@ -1 +1 @@ -Subproject commit 2d69b21af38f5a056794279b59ed226c73568ff8 +Subproject commit 3d1d67591dca6622d7eb739a4d7402f26ff74cea diff --git a/src/builder2ibek/converters/interlock.py b/src/builder2ibek/converters/interlock.py index cb2a453..8bdeabb 100644 --- a/src/builder2ibek/converters/interlock.py +++ b/src/builder2ibek/converters/interlock.py @@ -18,7 +18,17 @@ def handler(entity: Entity, entity_type: str, ioc: Generic_IOC): if entity_type == "interlock": entity.type = "dlsPLC.interlock" - entity.addr = str(entity.addr) # TODO make int in dlsPLC.ibek.support.yaml - # entity.remove("name") - hex_to_int(entity, "ilk") + + if entity_type == "overrideRequestMain": + entity.type = "dlsPLC.overrideRequestMain" + # https://confluence.diamond.ac.uk/x/i4kuAw#:~:text=addr%2C%20in%2C%20and,is%20outaddr%2D1 + entity.outaddr = int(entity.addr) * 10 + int(entity["in"]) + entity.remove("in") + entity.remove("out") + entity.remove("addr") + entity.remove("name") + + if entity_type == "overrideRequestIndividual": + entity.type = "dlsPLC.overrideRequestIndividual" + entity.remove("FIELD") diff --git a/src/builder2ibek/converters/vacuumValve.py b/src/builder2ibek/converters/vacuumValve.py index c5bc877..5a2847a 100644 --- a/src/builder2ibek/converters/vacuumValve.py +++ b/src/builder2ibek/converters/vacuumValve.py @@ -20,7 +20,7 @@ def handler(entity: Entity, entity_type: str, ioc: Generic_IOC): read100Objects[entity.name] = entity.port entity.type = "dlsPLC.read100" - entity.century = "0" # TODO make int in dlsPLC.ibek.support.yaml + entity.century = 0 entity.remove("name") if entity_type == "vacuumValveRead2": @@ -36,7 +36,11 @@ def handler(entity: Entity, entity_type: str, ioc: Generic_IOC): entity.type = "dlsPLC.vacValve" entity.rename("crate", "vlvcc") - entity.addr = str(int(entity.valve) * 10) # TODO should be int + entity.addr = int(entity.valve) * 10 entity.remove("valve") entity.port = read100Objects[entity.vlvcc] + + elif entity_type == "vacuumValveGroup": + entity.type = "dlsPLC.vacValveGroup" + entity.remove("name") diff --git a/src/builder2ibek/converters/water.py b/src/builder2ibek/converters/water.py new file mode 100644 index 0000000..ac9ee0b --- /dev/null +++ b/src/builder2ibek/converters/water.py @@ -0,0 +1,20 @@ +from builder2ibek.converters.globalHandler import globalHandler +from builder2ibek.types import Entity, Generic_IOC + +xml_component = "water" + + +@globalHandler +def handler(entity: Entity, entity_type: str, ioc: Generic_IOC): + """ + XML to YAML specialist convertor function for the water support module + + This module gets converted to dlsPLC equivalents + """ + + # water.flow and dlsPLC.flow do not appear to be equivalent + # I believe there is no dlsPLC for this; + # https://confluence.diamond.ac.uk/display/CNTRLS/Upgrade+a+Vacuum+IOC+to+use+dlsPLC#:~:text=This%20template%20reads,need%20to%20change. + # if entity_type == "flow": + # entity.type = "dlsPLC.flow" + # entity.remove("name") diff --git a/tests/samples/bl04i-va-ioc-01.yaml b/tests/samples/bl04i-va-ioc-01.yaml index 8936a61..8e6d69c 100644 --- a/tests/samples/bl04i-va-ioc-01.yaml +++ b/tests/samples/bl04i-va-ioc-01.yaml @@ -829,12 +829,12 @@ entities: ionp8: BL04I-VA-IONP-07 - type: dlsPLC.read100 - century: '0' + century: 0 device: BL04I-VA-VLVCC-01 port: ty_40_0 - type: dlsPLC.vacValve - addr: '10' + addr: 10 device: BL04I-VA-VALVE-01 gilk0: GAUGE-01 gilk1: GAUGE-02 @@ -873,7 +873,7 @@ entities: vlvcc: VLVCC01 - type: dlsPLC.vacValve - addr: '20' + addr: 20 device: BL04I-VA-VALVE-02 gilk0: GAUGE-01 gilk1: GAUGE-02 @@ -912,7 +912,7 @@ entities: vlvcc: VLVCC01 - type: dlsPLC.vacValve - addr: '30' + addr: 30 device: BL04I-VA-VALVE-03 gilk0: GAUGE-01 gilk1: GAUGE-02 @@ -951,7 +951,7 @@ entities: vlvcc: VLVCC01 - type: dlsPLC.vacValve - addr: '50' + addr: 50 device: BL04I-VA-VALVE-11 gilk0: GAUGE-01 gilk1: GAUGE-02 @@ -990,7 +990,7 @@ entities: vlvcc: VLVCC01 - type: dlsPLC.vacValve - addr: '40' + addr: 40 device: BL04I-PS-SHTR-01 gilk0: '' gilk1: '' @@ -1042,7 +1042,7 @@ entities: port: ty_40_0 - type: dlsPLC.interlock - addr: '7' + addr: 7 desc: Water Flow Interlocks device: BL04I-VA-VLVCC-01 ilk0: I04 Filter @@ -1066,7 +1066,7 @@ entities: port: ty_40_0 - type: dlsPLC.interlock - addr: '9' + addr: 9 desc: Front End Permit device: BL04I-VA-VLVCC-01 ilk0: Waterflows @@ -1090,7 +1090,7 @@ entities: port: ty_40_0 - type: dlsPLC.interlock - addr: '39' + addr: 39 desc: Machine Beam Critical device: BL04I-VA-VLVCC-01 ilk0: V11 Open @@ -1229,19 +1229,15 @@ entities: S: 9 name: DCM.OB1 - - type: interlock.overrideRequestMain + - type: dlsPLC.overrideRequestMain P: BL04I-VA-VLVCC-01 Q: :OVERRIDE - addr: 8 - in: 1 - name: ITLK - out: 0 + outaddr: 81 port: ty_40_0 - - type: interlock.overrideRequestIndividual + - type: dlsPLC.overrideRequestIndividual BIT: 1 DESC: HFM Piezo Overrride - FIELD: B OVERRIDE: BL04I-VA-VLVCC-01:OVERRIDE P: BL04I-OP-HFM-01:ILK PRESSURE1: BL04I-VA-GAUGE-04:P @@ -1249,10 +1245,9 @@ entities: SETPOINT: 500 name: HFMOR - - type: interlock.overrideRequestIndividual + - type: dlsPLC.overrideRequestIndividual BIT: 2 DESC: VFM Piezo Override - FIELD: C OVERRIDE: BL04I-VA-VLVCC-01:OVERRIDE P: BL04I-OP-VFM-01:ILK PRESSURE1: BL04I-VA-GAUGE-05:P @@ -1260,10 +1255,9 @@ entities: SETPOINT: 500 name: VFMOR - - type: interlock.overrideRequestIndividual + - type: dlsPLC.overrideRequestIndividual BIT: 3 DESC: Bimorph Override - FIELD: D OVERRIDE: BL04I-VA-VLVCC-01:OVERRIDE P: BL04I-OP-BIM-01:ILK PRESSURE1: BL04I-VA-GAUGE-04:P @@ -1283,10 +1277,9 @@ entities: evr: BL04I-VA-EVR-01 name: CMS.OB1 - - type: vacuumValve.vacuumValveGroup + - type: dlsPLC.vacValveGroup delay: 10 device: BL04I-VA-GVALV-98 - name: GVALV98 valve1: FE02I-VA-VALVE-02 valve2: BL04I-VA-VALVE-11 valve3: BL04I-VA-VALVE-01 @@ -1296,10 +1289,9 @@ entities: valve7: BL04I-VA-VALVE-02 valve8: BL04I-VA-VALVE-02 - - type: vacuumValve.vacuumValveGroup + - type: dlsPLC.vacValveGroup delay: 10 device: BL04I-VA-GVALV-99 - name: GVALV99 valve1: BL04I-VA-VALVE-03 valve2: BL04I-VA-VALVE-03 valve3: BL04I-VA-VALVE-03 diff --git a/tests/samples/bl11i-va-ioc-01.yaml b/tests/samples/bl11i-va-ioc-01.yaml index cf90dd6..6df18bf 100644 --- a/tests/samples/bl11i-va-ioc-01.yaml +++ b/tests/samples/bl11i-va-ioc-01.yaml @@ -615,12 +615,12 @@ entities: name: D1 - type: dlsPLC.read100 - century: '0' + century: 0 device: BL11I-VA-VLVCC-01 port: ty_40_3 - type: dlsPLC.read100 - century: '0' + century: 0 device: BL11I-VA-VLVCC-02 port: ty_41_3 @@ -633,7 +633,7 @@ entities: port: ty_40_3 - type: dlsPLC.vacValve - addr: '10' + addr: 10 device: BL11I-VA-VALVE-01 gilk0: Gauge01 gilk1: Gauge02 @@ -651,7 +651,7 @@ entities: vlvcc: VLVCC1 - type: dlsPLC.vacValve - addr: '20' + addr: 20 device: BL11I-VA-VALVE-02 gilk0: Gauge01 gilk1: Gauge02 @@ -670,7 +670,7 @@ entities: vlvcc: VLVCC1 - type: dlsPLC.vacValve - addr: '40' + addr: 40 device: BL11I-VA-VALVE-03 gilk0: Gauge01 gilk1: Gauge02 @@ -688,7 +688,7 @@ entities: vlvcc: VLVCC1 - type: dlsPLC.vacValve - addr: '50' + addr: 50 device: BL11I-VA-VALVE-04 ilk0: Air press. OK ilk1: IMG5 Healthy @@ -702,7 +702,7 @@ entities: vlvcc: VLVCC1 - type: dlsPLC.vacValve - addr: '20' + addr: 20 device: BL11I-VA-VALVE-05 ilk0: Air press. OK ilk1: IMG6 Healthy @@ -716,7 +716,7 @@ entities: vlvcc: VLVCC2 - type: dlsPLC.vacValve - addr: '30' + addr: 30 device: BL11I-VA-VALVE-06 ilk0: Air press. OK ilk1: IMG7 Healthy @@ -730,7 +730,7 @@ entities: vlvcc: VLVCC2 - type: dlsPLC.vacValve - addr: '10' + addr: 10 device: BL11I-PS-SHTR-01 ilk0: Air press. OK ilk1: Guardline A @@ -749,7 +749,7 @@ entities: vlvcc: VLVCC2 - type: dlsPLC.vacValve - addr: '30' + addr: 30 device: BL11I-DI-PHDGN-02 ilk15: Valve Fault name: D2 @@ -757,7 +757,7 @@ entities: vlvcc: VLVCC1 - type: dlsPLC.vacValve - addr: '60' + addr: 60 device: BL11I-DI-PHDGN-03 ilk15: Valve Fault name: D3 @@ -765,7 +765,7 @@ entities: vlvcc: VLVCC1 - type: dlsPLC.vacValve - addr: '40' + addr: 40 device: BL11I-DI-PHDGN-04 ilk15: Valve Fault name: D4 @@ -773,7 +773,7 @@ entities: vlvcc: VLVCC2 - type: dlsPLC.vacValve - addr: '60' + addr: 60 device: BL11I-PS-SHTR-02 ilk0: Air press. OK ilk1: Guardline A @@ -788,7 +788,7 @@ entities: vlvcc: VLVCC2 - type: dlsPLC.interlock - addr: '7' + addr: 7 desc: Waterflow Interlocks device: BL11I-VA-VLVCC-01 ilk0: GBC Water @@ -800,7 +800,7 @@ entities: port: ty_40_3 - type: dlsPLC.interlock - addr: '9' + addr: 9 desc: Front End Absorber device: BL11I-VA-VLVCC-01 ilk0: Water OK @@ -823,7 +823,7 @@ entities: port: ty_40_3 - type: dlsPLC.interlock - addr: '1' + addr: 1 desc: Temperatures Zone 1 device: BL11I-VA-TMPCC-01 ilk0: GBC Temp 1 @@ -835,7 +835,7 @@ entities: port: ty_40_2 - type: dlsPLC.interlock - addr: '2' + addr: 2 desc: Temperatures Zone 2 device: BL11I-VA-TMPCC-01 ilk0: S1 ApA Temp 1 @@ -851,7 +851,7 @@ entities: port: ty_40_2 - type: dlsPLC.interlock - addr: '39' + addr: 39 desc: Machine Beam Critical device: BL11I-VA-VLVCC-01 ilk0: Valve1 Open