Experimental Physics and
PV's are named in the fashion $(TS)STATS0:S$(CH)_ampl
$(CH) takes values 1,2,3,4 to indicate the 4 channels.
The .opi I am working on can be downloaded here.
Use a combo box to change the value of $(CH) for each combo box selection. This will not work because it is explained here that, "the macros property cannot be changed via script during runtime. It is only loaded once during opi startup."
Create a different .opi file for each channel. The channel number is then hardcoded into each PV of each widget in each .opi. This is extremely inelegant and very hard to maintain.
Use rules to change the PV of the strip chart. See a screenshot of my rules setup here. This works if I remove $(TS) from the output _expression_ of the rule. It appears that rule output expressions do not evaluate macros. This can be seen here, where I ran the .opi and right clicked --> PV Info. You can see "$(TS)" in the PV's name. If correctly substituted, this should say whatever value I have $(TS) set at. I have $(TS) defined both in my global preferences and on my root grouping container. Unless I have made a mistake that is preventing macro evaluation, this will not work because there must be at least the $(TS) macro on every PV.
Use an action to reopen the same .opi with $(CH) redefiend. This works, but not with a single combo box. I do not see how to assign a different action to each item of a combo box. Hence, I must use one action button for each channel. Furthermore, this inefficiently reloads the entire screen and has the negative side effect of wiping the history of the strip chart. However, this is the only usable solution at the moment.
Also note that the strip chart plots 4 PVs, and there are other widgets which must also respond to the change in channel selection. Hence, any solution must be capable of handling both macros and multiple PV changes.
|ANJ, 18 Nov 2013||
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·