Skip to main content

Interface generation for ophyd devices

Project description

Typhos

Automated User Interface Creation from Ophyd Devices

EPICS is a flexible and powerful controls system that gives access to experimental information, however, the relation and meaning of process variables is often obscure. Many of the user interfaces for EPICS information reflect this, as walls of buttons and flashing lights bombard the user with little thought to structure or cohesion.

Typhos addresses this by providing an automated way to generate screens based on a provided hierarchy of devices and signals. Built using PyDM, a PyQt based display manager developed at SLAC National Laboratory, Typhos utilizes a large toolkit of widgets to display EPICS information. For each process variable, a corresponding widget is created based on; the importance to the average operator, the type of value the EPICS PV will return, and whether a user should be allowed to write to the variable. These widgets are then placed in a convenient tab-based system to only show the necessary information for basic function, but still allow access to more advanced signals.

Instead of reinventing a new way to specify device structures, Typhos uses Ophyd, a library to abstract EPICS information into consistently structured Python objects. Originally built for scripting experimental procedures at NSLSII, Ophyd represents devices as combinations of components which are either signals or nested devices. Then, either at runtime or by using the defaults of the representative Python class, these signals are sorted into different categories based on their relevance to operators. Typhos uses this information to craft user interfaces.

Installation

Recommended installation on Linux:

conda install typhos -c conda-forge -c pcds-tag

All -tag channels have -dev counterparts for bleeding edge installations. Both requirements.txt and optional dev-requirements.txt are kept up to date as well for those who prefer installation via pip

typhos utilizes PyDM's designer widget entrypoints. This means that if you have PyDM working correctly with the Qt Designer, typhos widgets will also be available. No further customization or environment settings are required.

happi is an optional dependency but is recommended. This must be installed manually if not using the CONDA recipe.

Qt Installation

There have been some observed inconsistencies between installations of Qt available on pip, defaults and conda-forge. It is recommended that if you want to use the full typhos feature to install via conda-forge. We have found this the most reliable, especially when it comes to using the QtDesigner. It is worth noting that since this library uses qtpy as an interface layer to the various options for Qt Python bindings, the bare requirements will not install a specific one for you. The testing suite runs using PyQt5.

Getting Started

Creating your first typhos panel for anophyd.Device only takes two lines:

import sys
from ophyd.sim import motor
from qtpy.QtWidgets import QApplication
import typhos

# Create our application
app = QApplication.instance() or QApplication(sys.argv)
typhos.use_stylesheet()  # Optional
suite = typhos.TyphosSuite.from_device(motor)

# Launch
suite.show()
app.exec_()

Available Widgets

Typhos has three major building blocks that combine into the final display seen by the operator:

  • TyphosSuite: The overall view for a Typhos window. It allows the operator to view all of the loaded components and tools

  • TyphosDeviceDisplay: This is the widget created for a standard ophyd.Device. Signals are organized based on their Kind and description.

  • typhos.tools: These are widgets that interface with external applications. While you may have other GUIs for these systems, typhos.tools are built especially to handle the handshaking between all the information stored on your device and the tool you are interfacing with. This saves your operator clicks and ensures consistency in use.

Initialization Pattern

All three of the widgets listed above share a similar API for creation. Instantiating the object by itself handles loading the container widgets and placing them in the correct place, but these do not accept ophyd.Device arguments. The reason for this is to ensure that we can use all of the typhos screens as templates, and regardless or not of whether you have an ophyd.Device you can always populate the screens by hand. If you do in fact have an ophyd.Device every class has an add_device method and alternatively and be constructed using the from_device classmethod.

Related Projects

PyDM - PyQT Display Manager for EPICS information

Ophyd - Device abstraction for Experimental Control

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

typhos-3.1.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

typhos-3.1.0-py3-none-any.whl (715.8 kB view details)

Uploaded Python 3

File details

Details for the file typhos-3.1.0.tar.gz.

File metadata

  • Download URL: typhos-3.1.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for typhos-3.1.0.tar.gz
Algorithm Hash digest
SHA256 5fc971acf3c94bc2d88a926c5a4b27b9843f99763a6a41d0d67ffd7efb375a6e
MD5 3ae94d997b4eeecc5781fb4f27810872
BLAKE2b-256 1588e524a0d318db1dcbdfe37a1f805e94ae1f5b4c733ceae3b30dd94cea6578

See more details on using hashes here.

Provenance

File details

Details for the file typhos-3.1.0-py3-none-any.whl.

File metadata

  • Download URL: typhos-3.1.0-py3-none-any.whl
  • Upload date:
  • Size: 715.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for typhos-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca2727ca3e720a0e01bd0a8ff9fb5133b48ba8a794f933323c8de9b86f64c51c
MD5 bbdf5408e1c02aea70fd82771b7e829e
BLAKE2b-256 bde54c15280d2706790f2bfaeffc2b6b7b9f948d8faef437a1dad838eb63c8ee

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page