ControlSystemStudio / cs-studio

Control System Studio is an Eclipse-based collections of tools to monitor and operate large scale control systems, such as the ones in the accelerator community.
https://controlsystemstudio.org/
Eclipse Public License 1.0
113 stars 96 forks source link

Intensity Graph: Send cursor location to PV #470

Closed kasemir closed 10 years ago

kasemir commented 10 years ago

Idea: Add properties for X and Y cursor PV.

Location of cursor (in image axis coordinates) is then sent to those PVs. Always update the PVs? Or only on "click"? The PVs can simply be displayed, but they can also be used with rules or formulas to compute something based on those locations within the image.

Applications:

berryma4 commented 10 years ago

Maybe the pv could be a VTable (because that is the object used in similar applications). On Apr 11, 2014 1:18 PM, "kasemir" notifications@github.com wrote:

Idea: Add properties for X and Y cursor PV.

Location of cursor (in image axis coordinates) is then sent to those PVs. Always update the PVs? Or only on "click"? The PVs can simply be displayed, but they can also be used with rules or formulas to compute something based on those locations within the image.

Applications:

  • Display cursor location just for fun.
  • Decode detail of detector pixel.
  • Move motor to designated location within camera image.

Reply to this email directly or view it on GitHubhttps://github.com/ControlSystemStudio/cs-studio/issues/470 .

kasemir commented 10 years ago

Sure, you can implement it as one table PV, then add scripts which decode its value into basic PVs sent to IOCs.

Somewhat important is the option to select "always update" vs. "update on click". For info displays (details of detector module, tube, raw pixel ID) an "always update" is nice. When using this to move motors, however, you probably want to 1) Have user click on a location in image, which sets PVs, which are then transformed into new motor positions 2) Have user press another "Go" button to actually move and not move motors whenever the mouse happens to go across the image.

kasemir commented 10 years ago

A 'pixel info PV' that receives a VTable would be somewhat extensible in the future. For now it could receive a table with columns X: Location on X axis, Y: Location on Y axis, Pixel: Pixel value Clicked: 1 (True) is mouse button clicked

Future columns could be added (color map entry for that pixel value, …)

kasemir commented 10 years ago

The proj_470 branch has an example.

IntensityGraph widget, the one now also in Nebula, required an update. Before, it would internally decode the mouse position into X/Y coordinate and pixel value. Adding a mouse listener and doing the same outside of the widget would duplicate effort plus not really work because mouse clicks are already 'consumed' by the widget. Now the IntensityGraph supports a PixelInfo listener.

The BOY widget has a new "Pixel Info" PV property. If configured, it sends pixel info to that PV in the form of a VTable. Instead of another option to configure "always update" vs. "update on click", a 'selected' column indicates if the pixel was clicked, or results from a basic mouse move.

The VTable is somewhat clumsy. Seems a lot of overhead for just one row. The 'selected' column is really a boolean, but it's sent as a number because there's no ArrayBoolean, and List also generates errors.

Still, the mouse location (actually x/y as index, as coordinates, value at location, 'selected?') is now in a PV, so it can be used in scripts etc.

screen shot 2014-04-14 at 4 45 08 pm