Importing files

Especially for systems already in production, a common scenario is to have most displays - or even all of them - already developed using the same tool. As much as one would want to have them ported to a web-native application, redrawing everything in another tool can be very time-consuming task.

For that reason, WEISS provides methods to facilitate the import of existing displays from other tools, reducing the manual effort required to recreate them in a web-native environment.

Warning

An imported display should be treated as a starting point to save time and effort. Always test it with the intended IOC and review the complete display before making it available to operators.
For now, WEISS supports importing displays from CS-Studio/Phoebus only. Other tools will be considered in future updates.

From CS-Studio

WEISS currently supports importing Phoebus Display Builder files (.bob), the display format used by modern CS-Studio installations. The importer converts the display into WEISS widgets so you can continue editing it in the browser or use it right away.

Make sure you have things ready

Open the displays you want to import in CS-Studio/Phoebus and check that they work as expected. The extension accepted is a .bob file only, so check that they are also saved on this format.

Be sure to have all image files or embedded displays used by your OPI at hand, as they will also need to be uploaded or imported.

Example CS-Studio display

Import the display(s)

With the WEISS app running, login as a “Developer” and select the destination folder in the project tree (or a file inside it). Click Import in the application header and select From CSS/Phoebus. In the dialog, drop .bob files or whole folders, or use Select files / Select folder. Folders are imported recursively and keep their structure.

Each foo.bob is converted and saved as foo.opi.json in the destination folder; there is no need to create the files beforehand. Files that already exist are skipped unless Overwrite is checked. When a single display is imported, it opens in the editor.

Import a CS-Studio display

Pictures (.svg, .png, .jpg, .jpeg) found in imported folders are uploaded along with the displays, at the same relative paths. Pictures elsewhere can be selected or dropped in the same dialog, or uploaded later to the repository. Make sure the paths used by the imported Image widgets match the paths of the uploaded files. Paths to embedded displays are converted from .bob to .opi.json.

Important

Not all Phoebus widgets and features are supported. The unsupported widgets will be substituted by a dashed outline as placeholder, and a warning will be shown. Check next section for details on supported widgets and features.

Review the conversion

The goal of this tool is to reduce the manual effort required to recreate already existent displays, but does not eliminate the need for checking and validating your OPI in WEISS. Manual adjustments may be needed, especially for more complex widgets or rules.

The current widget support is:

Phoebus type

WEISS widget

Status

label

TextLabel

✅

textupdate

TextUpdate

✅

textentry

InputField

✅

action_button

ActionButton / NavigationButton

✅ map based on action type

bool_button

ToggleButton

✅

combo

SelectionBox

✅

spinner

Spinner

✅

scaledslider

Slider

✅

led

BitIndicator

✅

multi_state_led

MultiStateLED

✅

byte_monitor

MultiBitIndicator

✅

progressbar

ProgressBar

✅

rectangle

Rectangle

✅

ellipse

Ellipse

✅

picture

Image

✅

embedded

EmbeddedDisplay

✅ .bob path rewritten to .opi.json

group

Group

✅

navtabs

NavigationTabs

✅ per-tab colors not supported

xyplot

GraphXY

✅

stripchart

GraphY

✅

image

AreaDetector

✅ see notes below

checkbox

—

🔶 not implemented

choice

—

🔶 not implemented

meter

—

🔶 not implemented

linearmeter

—

🔶 not implemented

tank

—

🔶 not implemented

thermometer

—

🔶 not implemented

array

—

🔶 not implemented

tabs

—

🔶 not implemented

slide_button

—

🔶 not implemented

thumbwheel

—

🔶 not implemented

radio

—

🔶 not implemented

table

—

🔶 not implemented

polyline

—

🔶 not implemented

template

—

🔶 not implemented

3d viewer

—

🔶 not implemented

fileselector

—

❌ not planned

text-symbol

—

❌ not planned

symbol

—

❌ not planned

scrollbar

—

❌ not planned

databrowser / waterfallplotwidget

—

❌ not planned

arc

—

❌ not planned

polygon

—

❌ not planned

webbrowser

—

❌ not planned

Other conversion details:

  • Phoebus formula PVs (names starting with =, e.g. =timestamp(...)) are not supported and are removed, with a warning.

  • Local and simulated PVs (loc://, sim://) are kept but not supported, and a warning is shown.

  • image widgets keep their PV, colormap, colorbar visibility and intensity limits. Colormaps MAGMA and JET become inferno and turbo; other colormaps use the default. A fixed image size (data_width/data_height) is not imported: for plain waveform PVs, set the Size X/Y PV properties of the AreaDetector widget.

Rules and scripts are currently not implemented for the imported displays and need to be added manually using the WEISS interface.

Test, commit, and deploy

After checking PV names and macros, switch to Runtime mode and verify that the imported widgets connect to their PVs and the display behaves as expected.

When the OPI is ready, you can then commit and deploy it using the workflow described in the first web OPI tutorial.