BcdaQWidgets¶
PyEpics-aware PyQt widgets for the APS
- Note: This project is not complete and may be deleted in the future.
- The documentation is being added slowly.
author: | Pete R. Jemian |
---|---|
email: | jemian@anl.gov |
copyright: | 2005-2017, UChicago Argonne, LLC |
license: | ANL OPEN SOURCE LICENSE (see LICENSE.txt) |
docs: | http://bcdaqwidgets.readthedocs.io |
git: | https://github.com/BCDA-APS/bcdaqwidgets.git |
PyPI: | https://pypi.python.org/pypi/BcdaQWidgets |
TODO list: | https://github.com/BCDA-APS/bcdaqwidgets/issues |
version: | 2017.3.0 |
release: | 2.g80ebc1b.dirty |
published: | Apr 04, 2017 |
Overview¶
–tba–
Contents¶
BcdaQWidgets: bcdaqwidgets.bcdaqwidgets¶
BcdaQWidgets: PyEpics-aware PyQt widgets for the APS
Copyright (c) 2009-2017, UChicago Argonne, LLC. See LICENSE file for details.
The bcdaqwidgets [1] module provides a set of PyQt4 widgets that are EPICS-aware. These include:
widget | description |
---|---|
BcdaQLabel |
EPICS-aware QLabel widget |
BcdaQLineEdit |
EPICS-aware QLineEdit widget |
BcdaQPushButton |
EPICS-aware QPushButton widget |
BcdaQMomentaryButton |
sends a value when pressed or released, label does not change |
BcdaQToggleButton |
toggles boolean PV when pressed |
BcdaQLabel_RBV |
makes motor RBV field background green when motor is moving |
[1] | BCDA: Beam line Controls and Data Acquisition group of the Advanced Photon Source, Argonne National Laboratory, http://www.aps.anl.gov/bcda |
Note
bcdaqwidgets must be imported AFTER importing PyQt4
-
class
bcdaqwidgets.bcdaqwidgets.
BcdaQLabel
(pvname=None, useAlarmState=False, bgColorPv=None)[source]¶ Provide the value of an EPICS PV on a PyQt4.QtGui.QLabel
USAGE:
import bcdaqwidgets ... widget = bcdaqwidgets.BcdaQLabel() widget.ca_connect("example:m1.RBV")
Parameters: - pvname (str) – epics process variable name for this widget
- useAlarmState (bool) – change the text color based on pv severity
- bgColorPv (str) – update widget’s background color based on this pv’s value
-
class
bcdaqwidgets.bcdaqwidgets.
BcdaQLabel_RBV
(*args, **kw)[source]¶ makes motor readback field (BcdaQLabel) background green when motor is moving
EXAMPLE:
pvname = 'ioc:m1' w = bcdaqwidgets.BcdaQLabel_RBV() layout.addWidget(w) w.ca_connect(pvname+'.RBV')
-
class
bcdaqwidgets.bcdaqwidgets.
BcdaQLineEdit
(pvname=None, useAlarmState=False)[source]¶ Provide the value of an EPICS PV on a PyQt4.QtGui.QLineEdit
USAGE:
import bcdaqwidgets ... widget = bcdaqwidgets.BcdaQLineEdit() widget.ca_connect("example:m1.VAL")
-
class
bcdaqwidgets.bcdaqwidgets.
BcdaQMomentaryButton
(label='', pvname=None, pressed_value=None, released_value=None)[source]¶ Send a value when released, label does not change if PV changes.
It only acts on mouse pressed signal.
This is a special case of a BcdaQPushButton where the text on the button does not respond to changes of the value of the attached EPICS PV.
It is a good choice to use, for example, for a motor STOP button.
USAGE:
import bcdaqwidgets ... widget = bcdaqwidgets.BcdaQMomentaryButton('Stop') widget.ca_connect("example:m1.STOP") widget.SetPressedValue(1)
-
class
bcdaqwidgets.bcdaqwidgets.
BcdaQPushButton
(label='', pvname=None, pressed_value=None, released_value=None)[source]¶ Provide a QtGui.QPushButton connected to an EPICS PV
It is necessary to also call the SetPressedValue() and/or SetReleasedValue() method to define the value to be sent to the EPICS PV with the corresponding push button event. If left unconfigured, no action will be taken.
USAGE:
import bcdaqwidgets ... widget = bcdaqwidgets.BcdaQPushButton() widget.ca_connect("example:bo0") widget.SetReleasedValue(1)
-
SetBackgroundColor
(*args, **kw)[source]¶ set the background color of the QPushButton() via its stylesheet
-
SetPressedValue
(value)[source]¶ specify the value to be sent to the EPICS PV when the button is pressed
-
-
class
bcdaqwidgets.bcdaqwidgets.
BcdaQSignalDef
[source]¶ Define the signals used to communicate between the PyEpics thread and the PyQt4 (main Qt4 GUI) thread.
-
class
bcdaqwidgets.bcdaqwidgets.
BcdaQToggleButton
(pvname=None)[source]¶ Toggles boolean PV when pressed
This is a special case of a BcdaQPushButton where the text on the button changes with the value of the attached EPICS PV. In this case, the displayed value is the name of the next state of the EPICS PV when the button is pressed.
It is a good choice to use, for example, for an ON/OFF button.
USAGE:
import bcdaqwidgets ... widget = bcdaqwidgets.BcdaQToggleButton() widget.ca_connect("example:room_light") widget.SetReleasedValue(1)
-
class
bcdaqwidgets.bcdaqwidgets.
BcdaQWidgetSuper
(pvname=None, useAlarmState=False)[source]¶ superclass for EPICS-aware widgets
-
bcdaqwidgets.bcdaqwidgets.
RBV_BcdaQLabel
¶ alias of
BcdaQLabel_RBV
-
class
bcdaqwidgets.bcdaqwidgets.
StyleSheet
(widget, sty={})[source]¶ manage style sheet settings for a Qt widget
Example:
widget = QtGui.QLabel('example label') sty = bcdaqwidgets.StyleSheet(widget) sty.updateStyleSheet({ 'font': 'bold', 'color': 'white', 'background-color': 'dodgerblue', 'qproperty-alignment': 'AlignCenter', })
-
bcdaqwidgets.bcdaqwidgets.
typesafe_enum
(*sequential, **named)[source]¶ typesafe enum
EXAMPLE:
>>> Numbers = typesafe_enum('ZERO', 'ONE', 'TWO', four='IV') >>> Numbers.ZERO 0 >>> Numbers.ONE 1 >>> Numbers.four IV
See: http://stackoverflow.com/questions/36932/whats-the-best-way-to-implement-an-typesafe_enum-in-python
Demonstrations: bcdaqwidgets_demos¶
pvview¶
display one or more EPICS PVs in a PyQt4 GUI window as a table
vlinac¶
provide a basic GUI for the APS EPICS Virtual Linac demo software
Copyright (c) 2009 - 2013, UChicago Argonne, LLC. See LICENSE file for details.
pyqt4_probe¶
PyQt4 implementation of EPICS probe
author: | Matt Newville, CARS, University of Chicago |
---|---|
note: | Does not use bcdaqwidgets |
Dependencies¶
This software was built with various standard Python packages available in Python 2.7. Additionally, this program uses:
- PyEpics (EPICS interface)
- http://cars9.uchicago.edu/software/python/pyepics3/
- PyQt4 (Qt4 widget library)
- http://http://www.riverbankcomputing.com/software/pyqt/intro/
Changes¶
This describes user-visible changes between versions.
Production releases¶
2017.3.0: |
|
---|
Unreleased (development) Versions¶
2015.0415.0: | minor: convert QString to str |
---|---|
2015.0413.0: | replaced PySide support with PyQt4 since PySide project is decaying |
0.1.5: | changed packaging to simplify building docs at readthedocs.org |
0.1.4: | revised PyQt import to pick what has already been imported |
0.1.2: | add BcdaQLabel_RBV widget for motors |
0.1.1: | handle color of alarm severity for CALC_INVALID |
0.1: | initial trial |
License¶
Copyright (c) 2009-2017, UChicago Argonne, LLC
All Rights Reserved
BcdaQWidgets
BCDA, Advanced Photon Source, Argonne National Laboratory
OPEN SOURCE LICENSE
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. Software changes,
modifications, or derivative works, should be noted with comments and
the author and organization's name.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the names of UChicago Argonne, LLC or the Department of Energy
nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
4. The software and the end-user documentation included with the
redistribution, if any, must include the following acknowledgment:
"This product includes software produced by UChicago Argonne, LLC
under Contract No. DE-AC02-06CH11357 with the Department of Energy."
****************************************************************************
DISCLAIMER
THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT WARRANTY OF ANY KIND.
Neither the United States GOVERNMENT, nor the United States Department
of Energy, NOR uchicago argonne, LLC, nor any of their employees, makes
any warranty, express or implied, or assumes any legal liability or
responsibility for the accuracy, completeness, or usefulness of any
information, data, apparatus, product, or process disclosed, or
represents that its use would not infringe privately owned rights.
****************************************************************************