Skip to content

CS Studio Perspectives

kasemir edited this page Dec 14, 2016 · 12 revisions

Eclipse Views and Perspectives

In January 2016, CSS version 4.2 changes the *.opi runtimes to be based on "views". This allows their their arrangement to be saved, switched, restored as part of the Eclipse "Perspective" handling.

For previous users of BOY, the key change is that *.opi display files are best opened in the "OPI Runtime" perspective, where a newly opened display will by default appear in the center. When starting in other perspectives, the center is usually occupied by the editors area.

How to create a new display perspective

  1. Open fresh "OPI Runtime" perspective: Window/Open Perspective/Other/OPI Runtime. "Reset" if it was already active.
  2. Open views, position them as desired.
  3. Invoke "Save As" context menu on the perspective.

You can now close the perspective, later re-open it, or switch between perspectives.

After closing or moving views, either
a) "Reset" the perspective to revert to the original layout
b) Use "Save As" with a new name for a new perspective, or under the same name to overwrite the existing perspective.

Perspective preferences:

  1. Creating a OPI Runtime perspective with the default part stacks
    The preference option to "Show OPI Runtime Stacks" adds one placeholder view in each part stack, which helps positioning views in those stacks. Remember, however, to close the placeholder views when done!

org.csstudio.opibuilder/show_opi_runtime_stacks=true

  1. Setting the folder for saving and reading perspectives

Whenever a perspective is saved with the save as command, this will create a <perspective_name>.xmi file in the specified 'save' directory. On startup cs-studio will load all the perspectives available in the 'load' directory, these perspectives will then be available in the perspective toolbar/open perspective editor.

Layout of the "OPI Runtime" Perspective

The OPI Runtime perspective has part stacks named CENTER, TOP, BOTTOM, LEFT, RIGHT which are positioned as one would guess. When an action is configured to open an *.opi to the "left", it will be placed in the LEFT part stack.

When these part stacks are empty, they are invisible and it is thus impossible to manually move displays into them. A display can be positioned "left" from the center, but the actual LEFT part stack would be even further to the left.

Multiple Windows

If you want displays to be outside of the original workbench window, there are three options:

  1. 'Detach' by dragging it outside of the workbench. Detached windows belong to the current perspective of their origin window. They open/close with perspective changes.

  2. Open display in new workbench (or move to another existing workbench). Each workbench has its own perspective.

  3. Standalone Window (shell) Not part of any perspective, will not be persisted over application restarts.

Locking the Display Layout

By default, CS-Studio will start up with the same window layout in which it was last shut down.

For operational setups it can sometimes be more practical to always start out with a known window layout, regardless of how it was shut down. For example, this allows you to create a setup where users always have some "Main" layout when they start CSS. They can then switch to a "Vacuum", "Experiment 1", etc. layout as desired. They can still move things around. For the most part, they can "reset" a perspective to get the original layout. When users close & restart CSS, that start again with the "Main" setup.

If you want to "lock" a display setup:

  1. Create the desired perspectives
  2. Arrange windows as desired
  3. Exit CS-Studio
  4. Locate the workbench.xmi in the workspace folder, create a copy: cp YOUR_WORKSPACE/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi $HOME/my_golden_workbench.xmi
  5. Start CSS with the -workbench_xmi option: css -workbench_xmi $HOME/my_golden_workbench.xmi

Known Issues

https://github.com/ControlSystemStudio/cs-studio/issues/1707 (workaround: https://github.com/ControlSystemStudio/cs-studio/issues/1499)

For details on the evolution of perspective handling, see https://github.com/ControlSystemStudio/cs-studio/issues/544

Clone this wiki locally