Experimental Physics and
| |||||||||||||||||
|
Andrew Johnson wrote: Emmanuel Mayssat wrote: This technique appears to be somewhat fragile (meaning you must be careful if you decide to use it). It's probably fine if you have a small number of .dbl files and can keep track of all the variables that each one needs, but what happens if you should re-use a variable name (with different default values) in two different dbl files? The first That's a risk we are willing to take ;-) The advantage is that the input parameters can be changed just by changing the template. this is very important to us for development purpose ( we work at the driver and at higher levels at the same time ) Currently, we have scripts that automate the building of the stcmd file. They literally replace the fields with other strings and concat the modified template files to the stcmd. dbl file would set the value it wants as the default, but the second file would always see the earlier file's default setting (because the variable was never unset), even if the user really wanted to use the I would suggest that you require that the parent script must set *all* parameters that a dbl file relies on itself, or load a single default settings file early on like Eric suggested. Impossible, because we want to use several times the same template in the same stcmd file ( and with different parameter values ). For example, we have a digital output/input on a DAC. We have one driver for the digital input and one for the digital output. The board has 50 DIO ports. We must dbLoad 50 intances with different parameters for each BI and BO drivers. We have several IOC which use the same drivers. Using a template dbl enables us to upgrade all the IOC at once. ( that 's a big advantage for development purpose ). For example, you can change the db file very easily which such a mechanism. I was thinking about using a registar function as follow: default("${BR}",9600) that would check the value or $BR and if not set, then put 9600. (and so far nobody mentioned that solution!! ) but what I really want to do is an if then else in iocsh ;-)
| ||||||||||||||||
ANJ, 02 Sep 2010 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |