Skip to content

Commit

Permalink
add more test IOCs
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Jan 16, 2025
1 parent 971200d commit 67d204a
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/builder2ibek/converters/mks937a.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ def handler(entity: Entity, entity_type: str, ioc: Generic_IOC):
XML to YAML specialist convertor function for the mks937a support module
"""
# remove GUI only parameters (except on mks937aGauge which uses it for object ref)
if entity_type not in ["mks937aGauge", "mks937a"]:
if entity_type not in ["mks937aGauge", "mks937a", "mks937aGaugeEGU"]:
entity.remove("name")
29 changes: 29 additions & 0 deletions src/builder2ibek/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,32 @@ def hex_to_int(entity: Entity, prefix: str):
hex_key = f"{prefix}{hex(n)[2:].upper()}"
if hex_key in entity:
entity.rename(hex_key, f"{prefix}{n}")


hz_list = [
"1Hz",
"2Hz",
"5Hz",
"10Hz",
"20Hz",
"50Hz",
"100Hz",
"200Hz",
"500Hz",
"1kHz",
"2kHz",
"5kHz",
"10kHz",
"20kHz",
"50kHz",
"100kHz",
]


def int_to_Hertz(entity: Entity, key: str):
"""
Convert an integer key to a Hertz key
"""
if key in entity and type(entity[key]) is int:
hz = hz_list[entity[key]]
entity[key] = hz
3 changes: 0 additions & 3 deletions tests/samples/bl04i-va-ioc-01.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1136,19 +1136,16 @@ entities:
- type: rackFan.rackFan
c: 60
device: BL04I-PS-FANC-01
name: VAFAN1
s: 11

- type: rackFan.rackFan
c: 60
device: BL04I-PS-PSU-01
name: PSUFAN
s: 12

- type: rackFan.rackFan
c: 60
device: BL04I-VA-RACK-01:PSU-01
name: PSUHEALTH
s: 13

- type: water.flow
Expand Down
14 changes: 0 additions & 14 deletions tests/samples/bl11i-va-ioc-01.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,79 +221,66 @@ entities:
- type: rackFan.rackFan
c: 60
device: BL11I-EA-FANC-01
name: FANC1
s: 0

- type: rackFan.rackFan
c: 60
device: BL11I-PS-FANC-01
name: FANC2
s: 1

- type: rackFan.rackFan
c: 60
device: BL11I-PS-PSU-01
name: FANC3
s: 2

- type: rackFan.rackFan
c: 60
device: BL11I-VA-FANC-01
name: FANC4
s: 3

- type: rackFan.rackFan
c: 60
device: BL11I-MO-FANC-01
name: FANC5
s: 4

- type: rackFan.rackFan
c: 60
device: BL11I-MO-FANC-02
name: FANC6
s: 5

- type: rackFan.rackFan
c: 60
device: BL11I-VA-FANC-02
name: FANC7
s: 6

- type: rackFan.rackFan
c: 60
device: BL11I-NT-FANC-01
name: FANC8
s: 7

- type: rackFan.rackFan
c: 60
device: BL11I-DA-FANC-01
name: FANC9
s: 8

- type: rackFan.rackFan
c: 60
device: BL11I-MO-FANC-03
name: FANC10
s: 9

- type: rackFan.rackFan
c: 60
device: BL11I-EA-FANC-02
name: FANC11
s: 10

- type: rackFan.rackFan
c: 60
device: BL11I-EA-FANC-03
name: FANC12
s: 11

- type: rackFan.rackFan
c: 60
device: BL11I-OP-FANC-01
name: FANC13
s: 12

- type: rackFan.rackFan
Expand All @@ -305,7 +292,6 @@ entities:
- type: rackFan.rackFan
c: 60
device: BL11I-EA-ROBOT-01:MOVN
name: ROBOT
s: 37

- type: temperature.temperaturePLCRead
Expand Down
7 changes: 7 additions & 0 deletions tests/samples/sr03c-va-ioc-01.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,36 +159,43 @@ entities:
dom: SR03S
id: 1
input: SR03S-VA-GAUGE-01:RAW
name: GAUGE_S_01

- type: mks937a.mks937aGaugeEGU
dom: SR03S
id: 2
input: SR03S-VA-GAUGE-02:RAW
name: GAUGE_S_02

- type: mks937a.mks937aGaugeEGU
dom: SR03A
id: 1
input: SR03A-VA-GAUGE-01:RAW
name: GAUGE_A_01

- type: mks937a.mks937aGaugeEGU
dom: SR03A
id: 2
input: SR03A-VA-GAUGE-02:RAW
name: GAUGE_A_02

- type: mks937a.mks937aGaugeEGU
dom: SR03A
id: 3
input: SR03A-VA-GAUGE-03:RAW
name: GAUGE_A_03

- type: mks937a.mks937aGaugeEGU
dom: SR03A
id: 4
input: SR03A-VA-GAUGE-04:RAW
name: GAUGE_A_04

- type: mks937a.mks937aGaugeEGU
dom: SR03A
id: 31
input: SR03A-VA-GAUGE-31:RAW
name: GAUGE_A_31

- type: mks937a.mks937aImg
GCTLR: GCTLR_S_01
Expand Down

0 comments on commit 67d204a

Please sign in to comment.