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 8abf063
Show file tree
Hide file tree
Showing 8 changed files with 2,262 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")
14 changes: 14 additions & 0 deletions src/builder2ibek/converters/rackfan.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from builder2ibek.converters.globalHandler import globalHandler
from builder2ibek.types import Entity, Generic_IOC

xml_component = "rackFan"


@globalHandler
def handler(entity: Entity, entity_type: str, ioc: Generic_IOC):
"""
XML to YAML specialist convertor function for the rackFan support module
"""

if entity_type == "rackFan":
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
244 changes: 244 additions & 0 deletions tests/samples/BL16I-VA-IOC-01.xml

Large diffs are not rendered by default.

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
Loading

0 comments on commit 8abf063

Please sign in to comment.