As a developer I would like the information in the iocBoot config.xml to reflect what really happens in the ioc. Currently the information in config.xml is used by the GUI to define macros, it also has entries like hasDefault="YES" and default="0x0" but these are for information only in the GUI and do not influence, or necessarily correctly reflect, what the IOC actually does. We should have a single source of truth consistent between the IOC and GUI
Acceptance Criteria
[ ] Discussion held (virtually or as meeting) to decide on appropriate solution and agreed approach documented
[ ] Develop approach to enable default IOC macro values specified in only one place and correctly reflected by IOC and GUI display on new IOCs (as agreed in discussion)
[ ] Start applying this to existing IOCs
[ ] Create tickets to continue this work
Extra Information
An initial discussion of approach will be needed. There are various potential options e.g.
use existing config.xml as source of truth and add a new IOC command that reads file on IOC startup and creates macros. We already do something similar with configurations - IOC reads XML from disk and creates macros, so necessary XML reading code and an example of how to define a macro from an XML file already exists in IOC.
use existing config.xml as source of truth but at build time this file is parsed by a stand-alone program (e.g. a python script) that generates a default-macros.cmd file with necessary epicsEnvSet commands, this file can then be loaded by the IOC. This will need a new common Makefile build rule adding to automatically rebuild the macros file, but this is reasonable straightforward
(You could also create a new source of truth file and use it to generate config.xml and an IOC loadable file, but as config.xml is in a readily readable format that is not really worth it)
Note that you will not need to edit every IOC to either load default-macros.cmd or run a new command, all iocs already run init.cmd from the iocstartup common directory, so the command can be added to central init.cmd to apply to all IOCs
How to Test
should be a matter of just editing a config.xml for a chosen IOC and then looking at the screen output of the IOC to check macros defined as expected
As a developer I would like the information in the iocBoot
config.xml
to reflect what really happens in the ioc. Currently the information inconfig.xml
is used by the GUI to define macros, it also has entries likehasDefault="YES"
anddefault="0x0"
but these are for information only in the GUI and do not influence, or necessarily correctly reflect, what the IOC actually does. We should have a single source of truth consistent between the IOC and GUIAcceptance Criteria
Extra Information
An initial discussion of approach will be needed. There are various potential options e.g.
config.xml
as source of truth and add a new IOC command that reads file on IOC startup and creates macros. We already do something similar with configurations - IOC reads XML from disk and creates macros, so necessary XML reading code and an example of how to define a macro from an XML file already exists in IOC.config.xml
as source of truth but at build time this file is parsed by a stand-alone program (e.g. a python script) that generates adefault-macros.cmd
file with necessaryepicsEnvSet
commands, this file can then be loaded by the IOC. This will need a new common Makefile build rule adding to automatically rebuild the macros file, but this is reasonable straightforward(You could also create a new source of truth file and use it to generate config.xml and an IOC loadable file, but as config.xml is in a readily readable format that is not really worth it)
Note that you will not need to edit every IOC to either load
default-macros.cmd
or run a new command, all iocs already runinit.cmd
from the iocstartup common directory, so the command can be added to centralinit.cmd
to apply to all IOCsHow to Test
should be a matter of just editing a
config.xml
for a chosen IOC and then looking at the screen output of the IOC to check macros defined as expectedTime in planning meeting (18/07/24)
1:34:35