Hi Peter,
A rule (or a few rules) attached to the Scaled Slider might do the job. The rule can monitor the mbbo record fields and set the appropriate fields in the widget (Maxumum, Minimum, High, etc.). I use rules for similar jobs, mainly for the cases where widgets don't provide a PV monitor option (like the Intensity Widget X/Y sizes).
Cheers,
Matt
On Nov 22, 2014, at 1:32 PM, Peter Milne <[email protected]> wrote:
Hello Tech-talk
Developing an OPI for a multi channel DAC output device in DC mode (D-TACQ AO420FMC-4/ACQ424-32):
In the IOC:
- there's an AO record for each channel
- each channel has a gain control, so that the output range changes, from, say +/-5V to +/-10V, this is represented by an MBBO record.
- a short bit of SNL monitors the gain change and changes the AO record limits (HOPR, LOPR, ESLO) so that the PV is rescaled on the fly.
.. This works very well.
In the CSS/BOY OPI there's a Scaled Slider to control each AO. There's a menu button to set the gain for each channel. However, when the gain is changed, the Slider does not rescale automatically.
That's understandable, it's probably unreasonable to expect the widget to monitor _all_ the fields in the PV. On a Linux desktop, F5 "Refresh OPI" causes the widget to update and the scale changes correctly.
Q1: I'd like to hook a javascript to the gain menu button to call "Refresh OPI" so that the slider rescales automatically. It's not obvious how to do this. If javascript can't call the refresh method, perhaps it could even post <keypress F5> into the event queue.. Does anyone have an example?
There's another problem. I'm told that on a Windows desktop, "Refresh OPI" (either F5 or right-click menu) does _not_ cause the widget to update. However, closing and reopening the OPI does.
Q2: would it be possible to script a close/reopen of an opi (to come back in the same place) ?
.. In both cases, I've experimented with a few script options, but can't find the right method to call.
Thanks
--
Peter Milne
Director of Sales
www.d-tacq.com