Skip to content

Commit

Permalink
add schema generation
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Jan 16, 2025
1 parent 8abf063 commit 31917f4
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "ibek-support-dls"]
path = ibek-support-dls
url = https://gitlab.diamond.ac.uk/controls/containers/utils/ibek-support-dls.git
[submodule "ibek-support"]
path = ibek-support
url = https://github.com/epics-containers/ibek-support
1 change: 1 addition & 0 deletions ibek-support
Submodule ibek-support added at e68591
1 change: 1 addition & 0 deletions ibek-support-dls
Submodule ibek-support-dls added at 7b13a8
2 changes: 2 additions & 0 deletions src/builder2ibek/converters/Hy8401ip.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from builder2ibek.converters.globalHandler import globalHandler
from builder2ibek.types import Entity, Generic_IOC
from builder2ibek.utils import int_to_hertz

xml_component = "Hy8401ip"

Expand All @@ -12,3 +13,4 @@ def handler(entity: Entity, entity_type: str, ioc: Generic_IOC):

if entity_type == "Hy8401":
entity.remove("name")
int_to_hertz(entity, "clockRate")
2 changes: 1 addition & 1 deletion src/builder2ibek/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def hex_to_int(entity: Entity, prefix: str):
]


def int_to_Hertz(entity: Entity, key: str):
def int_to_hertz(entity: Entity, key: str):
"""
Convert an integer key to a Hertz key
"""
Expand Down
4 changes: 2 additions & 2 deletions tests/samples/bl16i-va-ioc-01.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ entities:
- type: Hy8401ip.Hy8401
cardid: 50
carrier: IPAC5
clockRate: 15
clockRate: 100kHz
ipslot: 0

- type: Hy8401ip.Hy8401
cardid: 51
carrier: IPAC5
clockRate: 15
clockRate: 100kHz
ipslot: 1

- type: epics.InterruptVectorVME
Expand Down
9 changes: 9 additions & 0 deletions update-schema
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

THISDIR=$(dirname $0)

# set up the generic IOC-like environment for ibek
mkdir -p /epics/ibek-defs/
ln -srf $THISDIR/ibek-support*/*/*.ibek.support.yaml /epics/ibek-defs/

ibek ioc generate-schema > /epics/ibek-defs/ioc.schema.json

0 comments on commit 31917f4

Please sign in to comment.