Coder Social home page Coder Social logo

lucid's People

Contributors

hhslepicka avatar klauer avatar tacaswell avatar tangkong avatar teddyrendahl avatar zllentz avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lucid's Issues

Logging setup incorrect

lucid/lucid/launcher.py

Lines 143 to 149 in b8dcaa9

lucid_logger = logging.getLogger('')
handler = logging.StreamHandler()
formatter = logging.Formatter(
'[%(asctime)s] [%(levelname)-8s] - %(message)s')
handler.setFormatter(formatter)
lucid_logger.addHandler(handler)
lucid_logger.setLevel(log_level)

I don't think we should be adding a handler to the root logger here...

Stack overflow?

Not the website:

[2020-06-04 15:09:40,088] [ERROR   ] - An uncaught exception happened: wrapped C/C++ object of type Connection has been deleted
Traceback (most recent call last):
  File "_ctypes/callbacks.c", line 234, in 'calling callback function'
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/epics/ca.py", line 720, in _onConnectionEvent
    timestamp=time.time())
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/epics/ca.py", line 263, in run_connection_callbacks
    callback(pvname=self.pvname, chid=chid_int, conn=self.conn)
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/epics/pv.py", line 48, in wrapped
    return func(self, *args, **kwargs)
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/epics/pv.py", line 325, in __on_connect
    conn_cb(pvname=self.pvname, conn=conn, pv=self)
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/data_plugins/epics_plugins/pyepics_plugin_component.py", line 111, in send_connection_state
    self.connection_state_signal.emit(conn)
RuntimeError: wrapped C/C++ object of type Connection has been deleted
[2020-06-04 15:09:40,107] [ERROR   ] - An uncaught exception happened: wrapped C/C++ object of type Connection has been deleted
Traceback (most recent call last):
  File "_ctypes/callbacks.c", line 234, in 'calling callback function'
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/epics/ca.py", line 769, in _onAccessRightsEvent
    entry.run_access_event_callbacks(read, write)
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/epics/ca.py", line 236, in run_access_event_callbacks
    callback(ra, wa)
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/epics/pv.py", line 48, in wrapped
    return func(self, *args, **kwargs)
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/epics/pv.py", line 290, in __on_access_rights_event
    cb(read_access, write_access, pv=self)
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/data_plugins/epics_plugins/pyepics_plugin_component.py", line 102, in send_access_state
    self.write_access_signal.emit(write_access)
RuntimeError: wrapped C/C++ object of type Connection has been deleted
Fatal Python error: Cannot recover from stack overflow.

I may have closed the window before this happened, but I don't recall (it was during a meeting).

Current thread 0x00007f0eba2d9740 (most recent call first):
  File "/reg/g/pcds/pyps/conda/py36/envs/dev/lib/python3.6/linecache.py", line 95 in updatecache
  File "/reg/g/pcds/pyps/conda/py36/envs/dev/lib/python3.6/linecache.py", line 47 in getlines
  File "/reg/g/pcds/pyps/conda/py36/envs/dev/lib/python3.6/linecache.py", line 16 in getline
  File "/reg/g/pcds/pyps/conda/py36/envs/dev/lib/python3.6/traceback.py", line 286 in line
  File "/reg/g/pcds/pyps/conda/py36/envs/dev/lib/python3.6/traceback.py", line 364 in extract
  File "/reg/g/pcds/pyps/conda/py36/envs/dev/lib/python3.6/traceback.py", line 509 in __init__
  File "/reg/g/pcds/pyps/conda/py36/envs/dev/lib/python3.6/traceback.py", line 104 in print_exception
  File "/reg/g/pcds/pyps/conda/py36/envs/dev/lib/python3.6/logging/__init__.py", line 535 in formatException
  File "/reg/g/pcds/pyps/conda/py36/envs/dev/lib/python3.6/logging/__init__.py", line 585 in format
  File "/reg/g/pcds/pyps/conda/py36/envs/dev/lib/python3.6/logging/__init__.py", line 840 in format
  File "/reg/g/pcds/pyps/conda/py36/envs/dev/lib/python3.6/logging/__init__.py", line 994 in emit
  File "/reg/g/pcds/pyps/conda/py36/envs/dev/lib/python3.6/logging/__init__.py", line 865 in handle
  File "/reg/g/pcds/pyps/conda/py36/envs/dev/lib/python3.6/logging/__init__.py", line 1516 in callHandlers
  File "/reg/g/pcds/pyps/conda/py36/envs/dev/lib/python3.6/logging/__init__.py", line 1454 in handle
  File "/reg/g/pcds/pyps/conda/py36/envs/dev/lib/python3.6/logging/__init__.py", line 1444 in _log
  File "/reg/g/pcds/pyps/conda/py36/envs/dev/lib/python3.6/logging/__init__.py", line 1337 in error
  File "/reg/g/pcds/pyps/conda/py36/envs/dev/lib/python3.6/logging/__init__.py", line 1343 in exception
  File "/reg/g/pcds/pyps/apps/dev/lucid/lucid/main_window.py", line 195 in handle_error
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/exception.py", line 182 in raise_to_operator
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/utilities/__init__.py", line 320 in wrapper
  File "/reg/g/pcds/pyps/apps/dev/lucid/lucid/main_window.py", line 196 in handle_error
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/exception.py", line 182 in raise_to_operator
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/utilities/__init__.py", line 320 in wrapper
  File "/reg/g/pcds/pyps/apps/dev/lucid/lucid/main_window.py", line 196 in handle_error
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/exception.py", line 182 in raise_to_operator
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/utilities/__init__.py", line 320 in wrapper
  File "/reg/g/pcds/pyps/apps/dev/lucid/lucid/main_window.py", line 196 in handle_error
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/exception.py", line 182 in raise_to_operator
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/utilities/__init__.py", line 320 in wrapper
  File "/reg/g/pcds/pyps/apps/dev/lucid/lucid/main_window.py", line 196 in handle_error

Mostly full log on NFS ~klauer/lucid_failure.txt

Lucid displays poorly on small screens

If the grid is larger than the screen height, you can't navigate to the Quick Launcher Toolbar on some setups. This can also be a problem for the device windows that open up to the right if the screen is not wide enough.

Lucid Window Title

From Silke on slack chat:
"The lucid screens should get more specific titles than "LUCID", e.g. including the beamline/hutch."

Stale results in cached search

  • Refresh button
  • Search again after a certain period?
  • FIFO cache needed for search model dictionary

Some other method for results to invalidate the cache? e.g., happi update signal -> invalidate happi results cache, new dock widget -> invalidate screen cache, etc.

Embedded display intermittent issue (`object of type 'NoneType' has no len()`)

While loading the attenuator calculator screen (and maybe popping it out too quickly?)

[2020-08-04 14:06:14,573] [ERROR   ] - An uncaught exception happened: object of type 'NoneType' has no len()
Traceback (most recent call last):
  File "/reg/g/pcds/pyps/conda/py36/envs/dev/bin/lucid", line 10, in <module>
    sys.exit(main())
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/lucid/launcher.py", line 237, in main
    launch(**kwargs)
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/lucid/launcher.py", line 231, in launch
    app.exec_()
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/lucid/overview.py", line 107, in eventFilter
    self.device_menu.exec_(self.mapToGlobal(event.pos()))
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/lucid/main_window.py", line 379, in wrapper
    area=QtAds.RightDockWidgetArea)
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/lucid/main_window.py", line 309, in add_dock
    self.dock_manager.addDockWidget(area, dock)
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/widgets/embedded_display.py", line 308, in showEvent
    w = self.open_file()
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/widgets/embedded_display.py", line 172, in open_file
    w = load_file(fname, macros=self.parsed_macros(), target=None)
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/display.py", line 63, in load_file
    w = load_ui_file(file, macros=macros)
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/display.py", line 111, in load_ui_file
    setupUi(d, d)
  File "<string>", line 70, in setupUi
  File "<string>", line 84, in retranslateUi
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/widgets/template_repeater.py", line 306, in dataSource
    self.data = json.load(f)
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/widgets/template_repeater.py", line 422, in data
    self.rebuild()
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/widgets/template_repeater.py", line 387, in rebuild
    pydm.data_plugins.establish_queued_connections()
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/data_plugins/__init__.py", line 45, in establish_queued_connections
    while not len(__CONNECTION_QUEUE__) == 0:
TypeError: object of type 'NoneType' has no len()

Spammy "INFO" Log Messages

These come from ply and cover the whole terminal on startup:

[2020-02-25 14:14:33,290] [INFO    ] - state 23
[2020-02-25 14:14:33,290] [INFO    ] - 
[2020-02-25 14:14:33,290] [INFO    ] -     (20) arglist -> value , arglist .
[2020-02-25 14:14:33,290] [INFO    ] - 
[2020-02-25 14:14:33,290] [INFO    ] -     )               reduce using rule 20 (arglist -> value , arglist .)
[2020-02-25 14:14:33,290] [INFO    ] - 
[2020-02-25 14:14:33,291] [INFO    ] - 
[2020-02-25 14:14:33,291] [INFO    ] - state 24
[2020-02-25 14:14:33,291] [INFO    ] - 
[2020-02-25 14:14:33,291] [INFO    ] -     (16) block -> BARE ( arglist ) { nodelist . }
[2020-02-25 14:14:33,291] [INFO    ] - 
[2020-02-25 14:14:33,291] [INFO    ] -     }               shift and go to state 25
[2020-02-25 14:14:33,291] [INFO    ] - 
[2020-02-25 14:14:33,291] [INFO    ] - 
[2020-02-25 14:14:33,291] [INFO    ] - state 25
[2020-02-25 14:14:33,291] [INFO    ] - 
[2020-02-25 14:14:33,291] [INFO    ] -     (16) block -> BARE ( arglist ) { nodelist } .
[2020-02-25 14:14:33,291] [INFO    ] - 
[2020-02-25 14:14:33,292] [INFO    ] -     CODE            reduce using rule 16 (block -> BARE ( arglist ) { nodelist } .)
[2020-02-25 14:14:33,292] [INFO    ] -     COMMENT         reduce using rule 16 (block -> BARE ( arglist ) { nodelist } .)
[2020-02-25 14:14:33,292] [INFO    ] -     BARE            reduce using rule 16 (block -> BARE ( arglist ) { nodelist } .)
[2020-02-25 14:14:33,292] [INFO    ] -     $end            reduce using rule 16 (block -> BARE ( arglist ) { nodelist } .)
[2020-02-25 14:14:33,292] [INFO    ] -     }               reduce using rule 16 (block -> BARE ( arglist ) { nodelist } .)
[2020-02-25 14:14:33,292] [INFO    ] - 

Swap left/right click in grid

  • Left click
    • Menu pops up with options
      • Open all
      • ----------- (spacer)
      • Device 1
      • Device 2
      • etc...
  • Right click either opens all or does nothing

HXR vacuum screen crashes and there is a C code error and this is the printout

File "/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/widgets/base.py", line 703, in connectionStateChanged
    self.connection_changed(connected)
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/widgets/base.py", line 568, in connection_changed
    self.alarmSeverityChanged(self.ALARM_NONE)
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/widgets/base.py", line 732, in alarmSeverityChanged
    self.alarm_severity_changed(new_alarm_severity)
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/widgets/base.py", line 623, in alarm_severity_changed
    refresh_style(self)
  File "/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/widgets/base.py", line 90, in refresh_style
    child_widget.style().unpolish(child_widget)

Don't know if this is a pcdswidgets issue or a lucid issue, but HXR VAccum screen keeps closing when loading ion pump expert screens

[adpai@lfe-console ~]$ source dev_conda
(dev) [adpai@lfe-console ~]$ lfe
(dev) [adpai@lfe-console ~]$ libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
QWidget::setLayout: Attempting to set QLayout "" on QFrame "interlock", which already has a layout
QWidget::setLayout: Attempting to set QLayout "" on QFrame "interlock", which already has a layout
/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/widgets/shell_command.py:150: UserWarning: 'PyDMShellCommand.command' is deprecated, use 'PyDMShellCommand.commands' instead.
  warnings.warn("'PyDMShellCommand.command' is deprecated, "
CA.Client.Exception...............................................
    Warning: "Virtual circuit disconnect"
    Context: "ctl-lfe-rec03.pcdsn:5064"
    Source File: modules/ca/src/client/cac.cpp line 1237
    Current Time: Mon Mar 02 2020 11:24:31.238944147
..................................................................
[2020-03-02 11:33:52,031] [ERROR   ] - Unable to connect to 'TV2L0_PIP_01_pressure' during widget creation
[2020-03-02 11:33:52,034] [ERROR   ] - Unable to connect to 'TV2L0_PIP_01_high_voltage_do' during widget creation

(dev) [adpai@lfe-console ~]$ lfe
(dev) [adpai@lfe-console ~]$ libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
QWidget::setLayout: Attempting to set QLayout "" on QFrame "interlock", which already has a layout
QWidget::setLayout: Attempting to set QLayout "" on QFrame "interlock", which already has a layout
/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/widgets/shell_command.py:150: UserWarning: 'PyDMShellCommand.command' is deprecated, use 'PyDMShellCommand.commands' instead.
  warnings.warn("'PyDMShellCommand.command' is deprecated, "
lfe
(dev) [adpai@lfe-console ~]$ libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
CA.Client.Exception...............................................
    Warning: "Virtual circuit disconnect"
    Context: "ctl-lfe-rec03.pcdsn:5064"
    Source File: modules/ca/src/client/cac.cpp line 1237
    Current Time: Mon Mar 02 2020 11:54:43.097265348
..................................................................
CA.Client.Exception...............................................
    Warning: "Virtual circuit disconnect"
    Context: "ctl-lfe-rec03.pcdsn:5064"
    Source File: modules/ca/src/client/cac.cpp line 1237
    Current Time: Mon Mar 02 2020 11:54:43.097284495
..................................................................

(dev) [adpai@lfe-console ~]$
(dev) [adpai@lfe-console ~]$
(dev) [adpai@lfe-console ~]$
(dev) [adpai@lfe-console ~]$
(dev) [adpai@lfe-console ~]$
(dev) [adpai@lfe-console ~]$ lfe
(dev) [adpai@lfe-console ~]$ libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
QWidget::setLayout: Attempting to set QLayout "" on QFrame "interlock", which already has a layout
QWidget::setLayout: Attempting to set QLayout "" on QFrame "interlock", which already has a layout
/reg/g/pcds/pyps/apps/dev/pythonpath/pydm/widgets/shell_command.py:150: UserWarning: 'PyDMShellCommand.command' is deprecated, use 'PyDMShellCommand.commands' instead.
  warnings.warn("'PyDMShellCommand.command' is deprecated, "

Rework the config to allow button column specification

The buttons above and below each other in the column are often cognitively linked. This is because you see multiple buttons in a column at the same time at a glance, since the buttons are wider than they are tall (due to normal horizontal text). Unfortunately, these are actually separated by several many lines in the config file, due to the way we currently fill the columns (left to right, top to bottom, in order). So if there are a subset of buttons in a tab that are meant to be related to each other, it is confusing to arrange them in a coherent way.

The current schema is "here's a number of columns, here's my buttons, please lay them out for me"
I'd like to change it to "here's the contents of column 1, here's the contents of column 2, ..."

Inactive Happi Entries Still Displayed

When marking a device as inactive in Happi, the device should no longer appear in the LUCID screen. This appears to not be the case. See an example below.

image

image

Mechanism for devices to opt out of grid placement

(From a discussion with @ZLLentz)

  • Name-based convention? e.g., hide devices that start with _
  • Happi item metadata key? e.g., "hide_from_lucid_grid: True"
  • Remove row/col values (stand=None) -> but this removes useful information

A variety metadata tag would make sense here, but they apply only to components.

DOCS

We need docs...

Remember to:

  • remove at the .travis.yml the allow failures for "Docs Build" and "Docs Upload"
  • add the doctr deploy key

Show error if no devices found

This implies that the user did something wrong while launching the program. Here we can check for invalid beamline arguments, unset happi configs, etc.

This happened to Raj and I when we did lucid lfe and it took an embarrassingly long amount of time to figure out what happened

Setpoint vs readback fields always the same for motors

I have found that for lucid, the read back .RBV field for motors always agrees with it's set point .VAL. After an IOC reset, both are correct as the initial .VAL field is set to the current motor position and the .RBV agrees, but position fluctuations then throw the .RBV off, while lucid shows it continues to match .VAL, even after move requests. This is not the case for non-motor pytmc generated PVs, such as gantry_y or gantry_x for devices mr1l0_lfe and mr2l0_lfe.

Steps to reproduce:

$ camonitor MR2L0:LFE:MMS:PITCH.RBV
lucid_val_rbv_issue

Search doesn't work on LCLS linux hosts

As I try to type "im1" for example in the search bar, the focus gets lost and my typing is interrupted. When I click back to the box I get no search results. The highlighted circles appear when I've only got "i" typed in the search bar, but disappear at "im". When they've appeared, the circles are off-center.

This behavior was observed on psbuild-rhel7 and lfe-console

Improve tests

As noted by @klauer in #93, the current tests are not adequate to make sure this package works as intended.
This includes at least the happy search algorithm but likely other areas as well.

Imagers show as OK in the grid with the server offline

Might need tweaks in pcdsdevices for the imager classes, might need grid tweaks for the typhos alarm circle settings. Currently, having all the area detector PVs as "disconnected" gives us a happy green in the grid.

Runtime Error Connection Deleted

Sometimes we get this pop up in the control room:

RuntimeError: wrapped C/C++ object of type Connection has been deleted

Sometimes the screen crashes, sometimes it happily continues on

Style sheets usage from the lucid grid vs as-launched from related displays

Loading up the BTPS screen from las (${EPICS_SETUP}/lucid-launcher.sh LAS), and popping it out results in this awful looking display:

image

Whereas the configuration editor loads up without the typhos stylesheet via the PyDM related display widget, which looks roughly as it was designed:

image

Not sure of a really appropriate fix here, but some reactionary thoughts follow:

  • The typhos stylesheet remains ugly
  • Maybe an opt-out mechanism for the typhos stylesheet somehow?

CLI seems slow

Just trying a simple lucid -h takes 5s to complete.

lfe-console:~ >source /reg/g/pcds/pyps/conda/dev_conda
lfe-console:~ >lucid -h

Xforwarding is enabled.

Add a search for buttons in the tab widgets

We already have a reasonable index source of these using the yaml config. It'd be nice if there was a special "search tab" with duplicates of every button that would show/hide themselves based on the search, or some other way to quickly locate buttons in the tab maze by keyword.

Revisit fuzzy-finding methodology

It started out as a simple fuzzywuzzy.fuzz.ratio(s1, s2) and morphed into something uglier after realizing that partial matches on long strings would not yield any results.

Statistics could be used to threshold the fuzz ratio instead of using the absolute method in place now. Would need more filtering/limiting to keep truly insignificant results out of the mix.

I'm up for suggestions, in any case...

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.