Giter Club home page Giter Club logo

pmps-ui's Introduction

PMPS - User Interface

The main entry point for the PMPS UI is the pmps.py file. This display takes a macro called CFG which specify the prefix for the configuration file to be loaded, e.g. LFE_config.yml.

By default to ensure backwards compatibility, if one launches the pmps.py file without specifying macros, the LFE configuration is loaded and the screen is launched.

To launch a different configuration do:

pydm -m "CFG=KFE" pmps.py

Configuration File

The configuration file provides information to render properly the screen and expand the number of Fast Faults and Preemptive Requests displayed without the need to modify other files or have a custom screen for each line.

Here is an example of a configuration file:

# This is the prefix to be used for the arbiter
line_arbiter_prefix: "PMPS:KFE:"
# This is the undulator Kicker Rate PV provided by the Accelerator
undulator_kicker_rate_pv: "IOC:BSY0:MP01:BYKIKS_RATE"
# This is the URL to the Grafana dashboard to be displayed
dashboard_url: "http://ctl-logsrv01:3000/ctl/grafana/d/PRr2cuGGz/k-pmps-events?viewPanel=2&orgId=1&refresh=10s&kiosk"

# fastfaults is an array of fast faults to be configured.
fastfaults:
  - prefix: "PMPS:KFE:"
    ffo_start: 1
    ffo_end: 2
    ff_start: 1
    ff_end: 50

# preemptive_requests is an array of Preemptive Requests to be configured
preemptive_requests:
  - prefix: "PMPS:KFE:"
    arbiter_instance: "Arbiter:01"
    assertion_pool_start: 0
    assertion_pool_end: 20

pmps-ui's People

Contributors

cristinasewell avatar divyak1910 avatar hhslepicka avatar joshc-slac avatar slacawallace avatar tangkong avatar wnwright avatar zllentz avatar

Watchers

 avatar  avatar

pmps-ui's Issues

Cleanup Diagnostic for near-term use

  • Add units to override time field
  • Remove eV spectrogram (for now)
  • Add enum display of BYKIK rate
  • Remove dialog boxes from override activate, deactivate, and fault ack/reset buttons

Grafana connection error spam

Periodic error spam in the terminal:

js: WebSocket connection to 'ws://ctl-logsrv01:3000/ctl/grafana/api/live/ws' failed: Error during WebSocket handshake: Unexpected response code: 403

I am on tmo-console because I'm doing a cursory check of #51

ev Range Alignment

Small nitpick:
image

This might be slightly more intuitive to read if the eV range values are left-justified (or is it top-justified?).

Distinguish between LFE and KFE

Both lines use the same diagnostic tool, but an instance might be launched for the L line or the K line. Right now it's not immediately obvious which line (KFE or LFE) the diagnostic is pointing to.

Need something to distinguish between the two lines.

Consolidate custom channel setup

Currently there's a much-repeated pattern in this repository where we create a pydm channel, connect it, and set it to be cleared when the containing widget is destroyed.

This should be consolidated into a re-usable function, either specifically here or in a shared utilities repository.
Conversation here: #53 (comment)

Add indicator next to arbiter time to show current clock drift

If the arbiter clock drifts again, the user should know by how much at a glance! If this number gets bad, we should get a call sooner rather than later.

Let's add a red +0, +1, etc. seconds diff counter that compares the arbiter PV with your local system clock.

Date/Time for Override

Either an embedded ms calculator, for translation from Months/Weeks/Days/Hours/Minutes or some other way to enter a time for the overrides time.

Arbiter Outputs tab desc field too wide

Here's the minimum size. Note that when you extend this horizontally, the output indicator continues to be glued to the right side of the screen. The large empty space and no row lines makes it very hard to see what's going on here.

image

Add diagnostic for upstream link node status

There's (one? several?) accelerator link nodes that show the status of the system fast faults. These should be included in the diagnostic so that if there's some sort of problem with the node it becomes apparent to anyone trying to look for issues in the existing diagnostic pages.

There was an issue this weekend where there was a problem with the link node but it wasn't clear why the photon-side systems were faulting the KFE line.

Add top-level fault summary

Top-level "FAULT" or "NO FAULTS" to make it clear that there isn't an issue without having to dig around.
Starts as "LOADING", probably

Newest env fails to open pmps-ui

$ ./launch.sh KFE
[2022-04-07 16:50:00,665] [INFO    ] - Using PyDM via SSH. Reverting to Software Rendering.
Added 1355 fast faults
Traceback (most recent call last):
  File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.3.1/bin/pydm", line 10, in <module>
    sys.exit(main())
  File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.3.1/lib/python3.9/site-packages/pydm_launcher/main.py", line 116, in main
    app = pydm.PyDMApplication(
  File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.3.1/lib/python3.9/site-packages/pydm/application.py", line 96, in __init__
    self.main_window.open(ui_file, macros, command_line_args)
  File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.3.1/lib/python3.9/site-packages/pydm/main_window.py", line 335, in open
    new_widget = load_file(filename,
  File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.3.1/lib/python3.9/site-packages/pydm/display.py", line 66, in load_file
    w = loader(file, args=args, macros=macros)
  File "/cds/group/pcds/pyps/conda/py39/envs/pcds-5.3.1/lib/python3.9/site-packages/pydm/display.py", line 232, in load_py_file
    instance = cls(**kwargs)
  File "/cds/home/z/zlentz/github/pmps-ui/pmps.py", line 69, in __init__
    self.setup_ui()
  File "/cds/home/z/zlentz/github/pmps-ui/pmps.py", line 82, in setup_ui
    self.setup_tabs()
  File "/cds/home/z/zlentz/github/pmps-ui/pmps.py", line 105, in setup_tabs
    self.setup_preemptive_requests()
  File "/cds/home/z/zlentz/github/pmps-ui/pmps.py", line 122, in setup_preemptive_requests
    from preemptive_requests import PreemptiveRequests
  File "/cds/home/z/zlentz/github/pmps-ui/preemptive_requests.py", line 10, in <module>
    from PyQt5.QtGui import QTableWidgetItem
ImportError: cannot import name 'QTableWidgetItem' from 'PyQt5.QtGui' (/cds/group/pcds/pyps/conda/py39/envs/pcds-5.3.1/lib/python3.9/site-packages/PyQt5/QtGui.so)
$ conda list | grep qt
WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(143): Could not remove or rename /cds/group/pcds/pyps/conda/py39/envs/pcds-5.3.1/conda-meta/databroker-1.2.5-pyhd8ed1ab_0.json.  Please remove this file manually (you may need to reboot to free file handles)
pyqt                      5.12.3           py39hf3d152e_8    conda-forge
pyqt-impl                 5.12.3           py39hde8b62d_8    conda-forge
pyqt5-sip                 4.19.18          py39he80948d_8    conda-forge
pyqtads                   3.7.2            py39he80948d_2    conda-forge
pyqtchart                 5.12             py39h0fcd23e_8    conda-forge
pyqtgraph                 0.12.4             pyhd8ed1ab_0    conda-forge
pyqtwebengine             5.12.1           py39h0fcd23e_8    conda-forge
pytest-qt                 3.3.0                      py_0    conda-forge
qt                        5.12.9               h1304e3e_6    conda-forge
qtawesome                 1.1.1              pyhd8ed1ab_0    conda-forge
qtconsole                 5.3.0              pyhd8ed1ab_0    conda-forge
qtconsole-base            5.3.0              pyhd8ed1ab_0    conda-forge
qtpy                      2.0.1              pyhd8ed1ab_0    conda-forge
qtpyinheritance           0.0.2              pyhd8ed1ab_0    conda-forge
sphinxcontrib-qthelp      1.0.3                      py_0    conda-forge

Veto Logic

It'd be nice to include a summary of the veto logic in the diagnostic

Stop Button for Beam

Need to add a button to Play/Pause the beam. It enter a requested rate of 0Hz and hit apply to the Line Beam Parameters Control element and be accessible outside the tab views (so always available).

Repackage for conda install

Currently, this is an application that lives outside of a python environment.

If this could be installed inside a python environment via pip or conda, then it would be easier to distribute to places like the accelerator prod machines.

REF: move internal imports to a reasonable place

Expected Behavior

There are places where we import modules/functions inside functions, rather than in the module preamble. For example:

Current Behavior

We should structure the package more sensibly

Possible Solution

Copy paste, see if it breaks?

Context

#100

Your Environment

pcds-5.8.1

Warn on bad IOC states

It's possible for twincat IOCs to be in a state where they are reading from stale memory locations after a PLC update. In these cases the IOC needs to be rebooted.

In the GUI, this may look something like this:

image

There are probably numerous ways we could look at the incoming data and produce suitable "reset the IOC please" warnings.

The simplest would be to catch negative assertion ids and cohorts.

Add an argument for configuration

As of now the code uses the YAML configuration file at the current folder.
We need to add an option to specify the file to be used so we can launch the PMPS UI for LFE and KFE.

Rendering on 13" laptop is tough

Rendering using MobaXterm, Windows 10, 13" laptop, 3200x1800.

PMPS display can only show a few words in fast faults, and some of the filter mechanisms are obscured.

image

Negative counts on PLC IOC Status Tab

For large cycle counts, we get negative numbers in the PLC IOC status tab because EPICS is signed while the underlying data type in the PLC is unsigned. It should be possible to force these to always be positive.

ENH: Add a splash screen with loading information

Expected Behavior

We should have some visual indication of loading progress

Current Behavior

Screen takes a very long time to load, with little feedback outside of command line print statements

Possible Solution

QSplashScreen was my first look at this, and led me to go about refactoring the package to expose the entrypoints to our manipulation.

This likely has to go in the PMPS class, since the QApplication is created during PyDMApplication instatntiation.

Context

Jira ticket link

Your Environment

pcds-5.8.1

DOC: Set up docs

As a follow up to #100, set up our standard docs workflow.

Be sure to include pre-release notes

Better diagnostics for full FFO allocations

When a PLC doesn't have enough PMPS fast fault allocations, the PLC output will fault without any other indication in the pmps-ui.

Goal: improve the diagnostic to let us know when this situation is happening.

We currently show the counts of allocated/in use/faulted FFOs on the ioc/plc status page. Since the counts here are summed from FFO1, FFO2, FFO3, ... they can't be considered a useful diagnostic tool for when the PLC has more in-use fast faults than allocated fast faults.

Ideas:

  • Separate the allocated/in use counters per FFO
  • Create a warning indicator somewhere visible on the main screen when this happens
  • Create a fast-fault-looking thing and add it to the fast fault table to represent this event

Error: Could not decode <array> using utf_8 at widget named 'device_label'

I guess we have a label that is receiving data it doesn't expect

$ [2023-05-04 10:45:21,834] [INFO    ] - Using PyDM via SSH. Reverting to Software Rendering.
Added 1465 fast faults
Added 410 preemptive requests
Added 29 arbiter outputs
[2023-05-04 10:46:05,214] [ERROR   ] - Could not decode [247 204 177  88   1] using utf_8 at widget named 'device_label'.
[2023-05-04 10:46:05,259] [ERROR   ] - Could not decode [128  63   1] using utf_8 at widget named 'device_label'.
[2023-05-04 10:46:05,908] [ERROR   ] - Could not decode [129  88 189   1] using utf_8 at widget named 'device_label'.
[2023-05-04 10:46:06,758] [ERROR   ] - Could not decode [129  88 189   1] using utf_8 at widget named 'device_label'.

MNT/REF: Remove pyDM macro substitution

Expected Behavior

CLI should be simple and intuitive (read: follow the other conventions present in our stack)

Current Behavior

The package and accompanying .ui files currently use pyDM's macro substitution to pick the proper config.

Possible Solution

Use normal args to specify the config

Context

#100

Your Environment

pcds-5.8.1

Warning for No In-Use FFOs, Disconnected IOC

  • If a PLC boots and has all FFOs as not in-use, this should be represented somewhere in the diagnostic
  • If an IOC is down, this should be represented somewhere in the diagnostic

Vague user reports of UI Freezing

Awaiting further user data if I can't reproduce it myself.

I am not exactly sure where to direct this question, but the PMPS screens have been freezing. They become non-responsive after being open for ~10 min.
This happened consistently for the 24 hour LX15 shift. The screen would freeze after 10 minutes and need to be Force Quit and relaunched

MNT: Consider refactoring entrypoints to import PMPS Display instead of call file

Expected Behavior

From Zach:

I think ideally the code looks more like "import the pmps class and create it" 
and less like "here's a string path to a python file to exec", so long as the
pydm application would support it.

Current Behavior

We call PyDMApplication and direct its ui_file arg to the right python file (source)

Possible Solution

Refactor the package a smidge. Doing this might require us to do more PyDM initialization.

A note: I did try creating the display under a vanilla QApplication, but got a lot of EPICS connection errors. For example this fails on teardown:

app = QApplication([])
display = PMPS()
display.show()
app.exec()

Context

Brought up in #100

Your Environment

pcds-5.8.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.