I believe there's Option 5:
Create an XYGraph with all 4 channels, then change the visibility of those individual traces.
A rule connected to the PV of a combo box could decide which trace is visible.
Visibility has only been added recently to the XYGraph, so you'll have to get the latest.
Thanks,
-Kay
From: Alex Dunn <
[email protected]<mailto:
[email protected]>>
Date: Tuesday, July 31, 2012 17:17
To: "
[email protected]<mailto:
[email protected]>" <
[email protected]<mailto:
[email protected]>>
Cc: "
[email protected]<mailto:
[email protected]>" <
[email protected]<mailto:
[email protected]>>
Subject: CSS BOY Dynamic Strip Charts with Macros
There are 4 channels of data, but I want only one XYGraph on screen. To
flip through the channels on this single strip chart, I thought of
several options.
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<
https://raw.github.com/kienjakenobi/storage/master/css-boy/front.opi>.
Option 1
Use a combo box to change the value of $(CH) for each combo box selection. This will not work because it is explained here<
http://www.aps.anl.gov/epics/tech-talk/2010/msg01036.php> that, "the macros property cannot be changed via script during runtime. It is only loaded once during opi startup."
Option 2
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.
Option 3
Use rules to change the PV of the strip chart. See a screenshot of my rules setup here<
https://github.com/kienjakenobi/storage/raw/master/css-boy/rules.png>.
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<
https://github.com/kienjakenobi/storage/raw/master/css-boy/unresolved-pv.png>,
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.
Option 4
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.
Thank you,
Alex