forked from slaclab/devPanel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
physics group account
committed
Jun 20, 2020
1 parent
acc37f6
commit 26c8519
Showing
3 changed files
with
103 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,23 @@ | ||
from pydm import Display | ||
from PyQt5 import QtGui | ||
|
||
class Example(Display): | ||
|
||
def __init__(self, parent=None, args=None): | ||
super(Example, self).__init__(parent=parent, args=args) | ||
self.ui.testButton.clicked.connect(lambda:self.updateOutput("Button Pushed")) | ||
self.ui.testCheckBox.stateChanged.connect(self.buttonToggled) | ||
|
||
def ui_filename(self): | ||
return 'example.ui' | ||
|
||
def updateOutput(self, output): | ||
print(output) | ||
self.ui.outputBox.setText(output) | ||
|
||
def buttonToggled(self): | ||
self.ui.outputBox.setText("Checkbox is " + ("checked" | ||
if self.ui.testCheckBox.isChecked() | ||
else "not checked")) | ||
|
||
intelclass = Example |
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,65 @@ | ||
<?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>640</width> | ||
<height>480</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Form</string> | ||
</property> | ||
<layout class="QGridLayout" name="gridLayout"> | ||
<item row="0" column="0"> | ||
<widget class="PyDMPushButton" name="testButton"> | ||
<property name="toolTip"> | ||
<string/> | ||
</property> | ||
<property name="text"> | ||
<string>Test Button</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="1" column="0"> | ||
<widget class="PyDMCheckbox" name="testCheckBox"> | ||
<property name="toolTip"> | ||
<string/> | ||
</property> | ||
<property name="text"> | ||
<string>Test Checkbox</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="2" column="0"> | ||
<widget class="PyDMLineEdit" name="outputBox"> | ||
<property name="toolTip"> | ||
<string/> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<customwidgets> | ||
<customwidget> | ||
<class>PyDMLineEdit</class> | ||
<extends>QLineEdit</extends> | ||
<header>pydm.widgets.line_edit</header> | ||
</customwidget> | ||
<customwidget> | ||
<class>PyDMPushButton</class> | ||
<extends>QPushButton</extends> | ||
<header>pydm.widgets.pushbutton</header> | ||
</customwidget> | ||
<customwidget> | ||
<class>PyDMCheckbox</class> | ||
<extends>QCheckBox</extends> | ||
<header>pydm.widgets.checkbox</header> | ||
</customwidget> | ||
</customwidgets> | ||
<resources/> | ||
<connections/> | ||
</ui> |
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