-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a push button example that uses the testing IOC.
- Loading branch information
Showing
1 changed file
with
157 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>Form</class> | ||
<widget class="QWidget" name="Form"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>400</width> | ||
<height>300</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Form</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<widget class="PyDMPushButton" name="PyDMPushButton"> | ||
<property name="toolTip"> | ||
<string/> | ||
</property> | ||
<property name="whatsThis"> | ||
<string> | ||
Basic PushButton to send a fixed value. | ||
|
||
The PyDMPushButton is meant to hold a specific value, and send that value | ||
to a channel when it is clicked, much like the MessageButton does in EDM. | ||
The PyDMPushButton works in two different modes of operation, first, a | ||
fixed value can be given to the :attr:`.pressValue` attribute, whenever the | ||
button is clicked a signal containing this value will be sent to the | ||
connected channel. This is the default behavior of the button. However, if | ||
the :attr:`.relativeChange` is set to True, the fixed value will be added | ||
to the current value of the channel. This means that the button will | ||
increment a channel by a fixed amount with every click, a consistent | ||
relative move | ||
|
||
Parameters | ||
---------- | ||
pressValue : int, float, str | ||
Value to be sent when the button is clicked | ||
|
||
channel : str | ||
ID of channel to manipulate | ||
|
||
parent : QObject, optional | ||
Parent of PyDMPushButton | ||
|
||
label : str, optional | ||
String to place on button | ||
|
||
icon : QIcon, optional | ||
An Icon to display on the PyDMPushButton | ||
|
||
|
||
relative : bool, optional | ||
Choice to have the button peform a relative put, instead of always | ||
setting to an absolute value | ||
</string> | ||
</property> | ||
<property name="text"> | ||
<string>Start Test IOC</string> | ||
</property> | ||
<property name="channel" stdset="0"> | ||
<string>ca://MTEST:Run</string> | ||
</property> | ||
<property name="pressValue" stdset="0"> | ||
<string>1</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="PyDMPushButton" name="PyDMPushButton_2"> | ||
<property name="toolTip"> | ||
<string/> | ||
</property> | ||
<property name="whatsThis"> | ||
<string> | ||
Basic PushButton to send a fixed value. | ||
|
||
The PyDMPushButton is meant to hold a specific value, and send that value | ||
to a channel when it is clicked, much like the MessageButton does in EDM. | ||
The PyDMPushButton works in two different modes of operation, first, a | ||
fixed value can be given to the :attr:`.pressValue` attribute, whenever the | ||
button is clicked a signal containing this value will be sent to the | ||
connected channel. This is the default behavior of the button. However, if | ||
the :attr:`.relativeChange` is set to True, the fixed value will be added | ||
to the current value of the channel. This means that the button will | ||
increment a channel by a fixed amount with every click, a consistent | ||
relative move | ||
|
||
Parameters | ||
---------- | ||
pressValue : int, float, str | ||
Value to be sent when the button is clicked | ||
|
||
channel : str | ||
ID of channel to manipulate | ||
|
||
parent : QObject, optional | ||
Parent of PyDMPushButton | ||
|
||
label : str, optional | ||
String to place on button | ||
|
||
icon : QIcon, optional | ||
An Icon to display on the PyDMPushButton | ||
|
||
|
||
relative : bool, optional | ||
Choice to have the button peform a relative put, instead of always | ||
setting to an absolute value | ||
</string> | ||
</property> | ||
<property name="text"> | ||
<string>Stop Test IOC</string> | ||
</property> | ||
<property name="channel" stdset="0"> | ||
<string>ca://MTEST:Run</string> | ||
</property> | ||
<property name="pressValue" stdset="0"> | ||
<string>0</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="PyDMLabel" name="PyDMLabel"> | ||
<property name="toolTip"> | ||
<string/> | ||
</property> | ||
<property name="whatsThis"> | ||
<string/> | ||
</property> | ||
<property name="alignment"> | ||
<set>Qt::AlignCenter</set> | ||
</property> | ||
<property name="channel"> | ||
<string>ca://MTEST:Run</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<customwidgets> | ||
<customwidget> | ||
<class>PyDMPushButton</class> | ||
<extends>QPushButton</extends> | ||
<header>pydm.widgets.pushbutton</header> | ||
</customwidget> | ||
<customwidget> | ||
<class>PyDMLabel</class> | ||
<extends>QLabel</extends> | ||
<header>pydm.widgets.label</header> | ||
</customwidget> | ||
</customwidgets> | ||
<resources/> | ||
<connections/> | ||
</ui> |