Skip to content

Commit

Permalink
tidy up convertors for bl2oj-mo-brick-02
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Dec 1, 2023
1 parent fa9a8ce commit b179d60
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/builder2ibek/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def dispatch(builder: Builder) -> Generic_IOC:
and build a generic IOC from the converted Entities
"""
ioc = Generic_IOC(
ioc_name=builder.name.lower(),
# ioc_name=builder.name.lower(),
ioc_name="{{ ioc_yaml_file_name }}",
description="auto-generated by https://github.com/epics-containers/builder2ibek",
entities=[],
)
Expand Down
4 changes: 4 additions & 0 deletions src/builder2ibek/converters/deviocstats.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ def handler(entity: Entity, entity_type: str, ioc: Generic_IOC):
entity.rename("name", "IOC")
if "name" in entity:
entity.remove("name")

# we will always use the uppercase version of the instance YAML stem
# for devIOCStats IOC name.
entity.IOC = "{{ ioc_name | upper }}"
3 changes: 3 additions & 0 deletions src/builder2ibek/converters/epics_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ def handler(entity: Entity, entity_type: str, ioc: Generic_IOC):
entity.type = "epics.EpicsCaMaxArrayBytes"
else:
entity.rename("key", "name")
# remove IOCSH settings as epics-containers makes the iocsh prompt
if "IOCSH" in entity.name:
entity.delete_me()
elif entity_type == "StartupCommand":
if entity.post_init:
entity.type = "epics.PostStartupCommand"
Expand Down
3 changes: 3 additions & 0 deletions src/builder2ibek/converters/pmac.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ def handler(entity: Entity, entity_type: str, ioc: Generic_IOC):
if entity.VMAX is not None:
entity.VMAX = str(entity.VMAX)

elif entity_type == "GeoBrick":
entity.rename("Port", "pmacAsynPort")

elif entity_type == "GeoBrickTrajectoryControlT":
# don't bore the user with the fact this is a template!
entity.type = "pmac.GeoBrickTrajectoryControl"
Expand Down

0 comments on commit b179d60

Please sign in to comment.