-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
131 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = "IOCinfo" | ||
|
||
|
||
@globalHandler | ||
def handler(entity: Entity, entity_type: str, ioc: Generic_IOC): | ||
""" | ||
XML to YAML specialist convertor function for the IOCInfo support module | ||
""" | ||
|
||
if entity_type == "IOCinfo": | ||
entity.remove("name") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from builder2ibek.converters.globalHandler import globalHandler | ||
from builder2ibek.types import Entity, Generic_IOC | ||
from builder2ibek.utils import hex_to_int | ||
|
||
xml_component = "interlock" | ||
|
||
# records the port names of the read100 entities keyed by name | ||
read100Objects = {} | ||
|
||
|
||
@globalHandler | ||
def handler(entity: Entity, entity_type: str, ioc: Generic_IOC): | ||
""" | ||
XML to YAML specialist convertor function for the interlock support module | ||
This module gets converted to dlsPLC equivalents | ||
""" | ||
|
||
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = "rga" | ||
|
||
|
||
@globalHandler | ||
def handler(entity: Entity, entity_type: str, ioc: Generic_IOC): | ||
""" | ||
XML to YAML specialist convertor function for the rga support module | ||
""" | ||
|
||
if entity_type == "rga": | ||
entity.remove("name") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from builder2ibek.converters.globalHandler import globalHandler | ||
from builder2ibek.types import Entity, Generic_IOC | ||
|
||
xml_component = "vacuumSpace" | ||
|
||
|
||
@globalHandler | ||
def handler(entity: Entity, entity_type: str, ioc: Generic_IOC): | ||
""" | ||
XML to YAML specialist convertor function for the vacuumSpace support module | ||
""" | ||
|
||
# remove GUI only parameters (except those that use name for object ref) | ||
if entity_type == "spaceTemplate": | ||
entity.remove("name") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from builder2ibek.converters.globalHandler import globalHandler | ||
from builder2ibek.types import Entity, Generic_IOC | ||
|
||
xml_component = "vacuumValve" | ||
|
||
# records the port names of the read100 entities keyed by name | ||
read100Objects = {} | ||
|
||
|
||
@globalHandler | ||
def handler(entity: Entity, entity_type: str, ioc: Generic_IOC): | ||
""" | ||
XML to YAML specialist convertor function for the vacuumValve support module | ||
This module gets converted to dlsPLC equivalents | ||
""" | ||
|
||
if entity_type == "vacuumValveRead": | ||
# record the port name of this entity | ||
read100Objects[entity.name] = entity.port | ||
|
||
entity.type = "dlsPLC.read100" | ||
entity.century = "0" # TODO make int in dlsPLC.ibek.support.yaml | ||
entity.remove("name") | ||
|
||
if entity_type == "vacuumValveRead2": | ||
# record the port name of this entity | ||
read100Objects[entity.name] = entity.port | ||
|
||
# TODO need an example to work out how to do this, we probably need | ||
# to record in read100Objects, which centry this entity is associated | ||
# WARNING: interlock.interlock will need to know about this (I think) | ||
raise NotImplementedError("vacuumValveRead2 not implemented") | ||
|
||
elif entity_type in ["vacuumValve", "vacuumValve_callback"]: | ||
entity.type = "dlsPLC.vacValve" | ||
|
||
entity.rename("crate", "vlvcc") | ||
entity.addr = str(int(entity.valve) * 10) # TODO should be int | ||
entity.remove("valve") | ||
|
||
entity.port = read100Objects[entity.vlvcc] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters