Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database Generation #67

Open
gilesknap opened this issue May 9, 2023 · 2 comments
Open

Database Generation #67

gilesknap opened this issue May 9, 2023 · 2 comments

Comments

@gilesknap
Copy link
Member

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

  • accumulating a list of PV names in global state using utils.set_var / get_var.
  • adding a make_file entry to defs that creates a file and populates it with a multiline string. (this could be used to generate any file - not just DB files)
  • using make_file to make a db from jinja for loops iterating over the PV names list above.

@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
Copy link
Member Author

gilesknap commented May 9, 2023

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
Copy link
Member Author

Decide on whether we need this after J20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant