epics-containers / ibek

IOC Builder for EPICS and Kubernetes
https://epics-containers.github.io/ibek
Apache License 2.0
12 stars 4 forks source link

Database Generation #67

Open gilesknap opened 1 year ago

gilesknap commented 1 year ago

From a discussion with Tom.

We should provide the ability to generate a DB file using Jinja.

For example the PSC IOC SR-05I-PC-IOC-01 has the generated DB file pasted below.

We could do this by

@coretl I'm still concerned that we will need to support epicsDB-builder for some IOCs. We could take the tack of using it instead of ibek. Maybe that is the only viable option as integrating ibek and builder sounds hard.

 For example the PSC IOC SR-05I-PC-IOC-01 has the following generated DB file:
# This file was automatically generated on Thu 18 Aug 2022 18:10:59 BST from
# source: /dls_sw/prod/R3.14.12.7/support/pscBuilder/2-2-3/python/build-psc.py
# 
# *** Please do not edit this file: edit the source file instead. ***
# 

record(calc, "SR05I-PC-TRIM-01:GRPSTATE")
{
    field(CALC, "0")
    field(INPA, "SR05I-PC-TRIM-01:L4DEVSTATE CP MS")
    field(INPB, "SR05I-PC-TRIM-02:L4DEVSTATE CP MS")
    field(INPC, "SR05I-PC-TRIM-03:L4DEVSTATE CP MS")
    field(INPD, "SR05I-PC-TRIM-04:L4DEVSTATE CP MS")
    field(INPE, "SR05I-PC-TRIM-05:L4DEVSTATE CP MS")
    field(INPF, "SR05I-PC-TRIM-06:L4DEVSTATE CP MS")
    field(INPG, "SR05I-PC-TRIM-07:L4DEVSTATE CP MS")
    field(INPH, "SR05I-PC-TRIM-08:L4DEVSTATE CP MS")
    field(INPI, "SR05I-PC-TRIM-09:L4DEVSTATE CP MS")
    field(INPJ, "SR05I-PC-TRIM-10:L4DEVSTATE CP MS")
    field(INPK, "SR05I-PC-TRIM-11:L4DEVSTATE CP MS")
    field(INPL, "SR05I-PC-TRIM-01:GRPSTATE2 CP MS")
    field(PINI, "YES")
    field(SCAN, "Passive")
}

record(calc, "SR05I-PC-TRIM-01:GRPSTATE2")
{
    field(CALC, "0")
    field(INPA, "SR05I-PC-TRIM-12:L4DEVSTATE CP MS")
    field(INPB, "SR05I-PC-TRIM-13:L4DEVSTATE CP MS")
    field(INPC, "SR05I-PC-TRIM-14:L4DEVSTATE CP MS")
    field(INPD, "SR05I-PC-VSTR-11:L4DEVSTATE CP MS")
    field(INPE, "SR05I-PC-VSTR-12:L4DEVSTATE CP MS")
    field(INPF, "SR05I-PC-HSTR-11:L4DEVSTATE CP MS")
    field(INPG, "SR05I-PC-HSTR-12:L4DEVSTATE CP MS")
    field(PINI, "YES")
    field(SCAN, "Passive")
}
gilesknap commented 1 year ago

If we did allow use of EpicsDbBuilder then would this mean builder.py files were needed in support modules?

@coretl There are non-XmlBuilder things in some builder.py which I thought related to EpicsDbBuilder. e.g. see the attributes created with RecordFactory in https://gitlab.diamond.ac.uk/controls/support/mrftiming/-/blob/master/etc/builder.py

UPDATE: Tom has convinced me that EpicsDbBuilder does not require builder.py files.

gilesknap commented 1 year ago

Decide on whether we need this after J20