DiamondLightSource/cs-web-proto

Actions

Closed this issue · 3 comments

Phoebus allows 6 different types of action:

  • open display
  • write PV
  • execute script - we don't want to do this
  • execute command - whatever support we have for this will have to go via the server
  • open file - I'm not sure what this is for, unless e.g. databrowser plots
  • open web page

Three of these are easy. We don't plan to support scripts. Execute command and open file are less clear.

Phoebus's behaviour

Any widget may have actions associated with it. If so, they are available as a right-click option.

An action button executes an action on click. If more than one action is attached to an action button it will become a choice button.

It is possible to group together all actions so that they are executed together. On the right-click option this doesn't seem to have any effect. On the action button it will execute all actions if you press the button: not a choice button any more.

Phoebus XML syntax:

 <actions execute_as_one="true">                                               
    <action type="open_webpage">                                                
      <url>https://www.google.com</url>                                         
      <description>Google</description>                                         
    </action>                                                                   
    <action type="open_webpage">                                                
      <url>https://www.bbc.co.uk</url>                                          
      <description>BBC</description>                                            
    </action>                                                                   
  </actions>     

We have an implementation of actions that can be extended if necessary.