Epics@GSI Webhome

Epics Tips And Tricks Use Of Msi With Multiple Templeate Files

use of msi with multiple template files

To produce a single db file from multiple template files it is sufficient to include in the Makefile in the app/Db directory the line with the name of the db. This should be a not existing file (because it will be produced). Existing must be the corresponding substitutions file and the template file(s). In case that the substitutions file calls to a multiple template files is necessary to have an independent name from them, otherwise the generated db file will be only based on the same name template file.

Be aware that none of the template files should have the same name as the substitutions file.

Example: To make a db called vulom_1.db use a file vulom_1.substitutions which references for instance vulom.template, vulomreg.template, and vulomreg1.template

    file vulom.template {
    { PRE=HAD, NN="0", MM="1"}
    file vulomreg.template {
    { PRE=HAD, NN="0", MM="1", CC="Del_0", AA="0", LIM="49.5", GAIN="3.3", LLIM="0"}
    { PRE=HAD, NN="0", MM="1", CC="Del_1", AA="1", LIM="49.5", GAIN="3.3", LLIM="0"}
    file vulomreg1.template {
    { PRE=HAD, NN="0", MM="1", CC="Down_0", AA="7", LIM="15", GAIN="1"}
    { PRE=HAD, NN="0", MM="1", CC="Down_1", AA="8", LIM="15", GAIN="1"}

The Makefile should contain a line
    DB += vulom_1.db

additional Dependencies

Adding the line in the Makefile
    vulom_1_DEPENDS ?= $(shell perl -n -e 'if (/file\s+(\w+.template)/) {print "$$1 \n";}' vulom_1.substitutions )
right after the previous
    DB += vulom_1.db
enables EPICS to check for dependencies (q.v. IOC Application Developer's Guide - 3.14.9 Chapter 4.6.4):
    If a <name> substitutions file contains "file" references to other input files, these referenced files should be made dependencies of the created <name>.db by adding a dependency definition line:
    <name>_DEPENDS = <filename1> <filename2> ...
-- PeterZumbruch - 09 May 2008

-- MartinMitkov - 2017-03-31

-- PeterZumbruch - 2017-03-31
-- PeterZumbruch - 2018-01-08
Topic revision: r2 - 2018-01-08, PeterZumbruch - This page was cached on 2022-05-20 - 20:16.

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback | Legal notice | Privacy Policy (german)