Skip to content

epics-containers/vdct2template

Repository files navigation

CI Coverage PyPI License

vdct2template

Converts EPICS vdct templates to pure msi compatible EPICS db templates

This tool is designed to modify an EPICS support module in order to remove its dependency on the vdct tool. This is useful for support modules that we want to build with the upstream vanilla EPICS base that does not include vdct.

Source https://github.com/epics-containers/vdct2template
PyPI pip install vdct2template
Releases https://github.com/epics-containers/vdct2template/releases

Installation

To install the latest release from PyPI, create a virtual environment and pip install like this:

python -m venv venv
source venv/bin/activate

pip install vdct2template

Usage

$ vdct2template --help
                                                                                          
 Usage: vdct2template [OPTIONS] FOLDER                                                    
                                                                                          
                          VDCT to template conversion function.

 This function assumes that all referenced VDCT files in the expand() blocks will be   
    in the same folder.                                                                   
 We can use the builder.py file to check for direct references to template files Use   
    --no-use-builder to disable this feature. Direct references to a template file is an  
    error because we need to modify all macro names to add a _ prefix in templated files. 
 Files referenced in expand() blocks will have their macro names updated to all have a 
    _ prefix, because MSI does not support substituting a macro with it's own name and    
    passing a default. This is a workaround to that limitation.                           
 The original expands() block is replaced with a series of substitute MSI directives   
    and an include MSI directive.                                                         
 The resulting set of templates can be expanded natively by MSI without the need for   
    VDCT.                                                                                 
 The DB files created by such an expansion should be equivalent to the original VDCT   
    generated ones.                                                                       

╭─ Arguments ────────────────────────────────────────────────────────────────────────────╮
│ *    folder      DIRECTORY  folder of vdb files to convert to template files.          │
│                             [default: None]                                            │
│                             [required]                                                 │
╰────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ──────────────────────────────────────────────────────────────────────────────╮
│ --version                                         Print the version and exit           │
│ --use-builder           --no-use-builder          Use the builder.py file to look for  │
│                                                   direct references to template files. │
│                                                   [default: use-builder]               │
│ --builder                                   FILE  Path to the builder file.            │
│                                                   [default: None]                      │
│ --help                                            Show this message and exit.          │
╰────────────────────────────────────────────────────────────────────────────────────────╯