-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathHvGUI.py
294 lines (288 loc) · 16.9 KB
/
HvGUI.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'HvGUI.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(465, 649)
MainWindow.setAnimated(True)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
self.gridLayout.setObjectName("gridLayout")
self.verticalLayout_4 = QtWidgets.QVBoxLayout()
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.formLayout = QtWidgets.QFormLayout()
self.formLayout.setObjectName("formLayout")
self.prtNameLabel = QtWidgets.QLabel(self.centralwidget)
self.prtNameLabel.setObjectName("prtNameLabel")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.prtNameLabel)
self.prtList = QtWidgets.QComboBox(self.centralwidget)
self.prtList.setObjectName("prtList")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.prtList)
self.prtOpenBtn = QtWidgets.QPushButton(self.centralwidget)
self.prtOpenBtn.setObjectName("prtOpenBtn")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.prtOpenBtn)
self.prtCloseBtn = QtWidgets.QPushButton(self.centralwidget)
self.prtCloseBtn.setObjectName("prtCloseBtn")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.prtCloseBtn)
self.verticalLayout_2.addLayout(self.formLayout)
self.line_3 = QtWidgets.QFrame(self.centralwidget)
self.line_3.setFrameShape(QtWidgets.QFrame.HLine)
self.line_3.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line_3.setObjectName("line_3")
self.verticalLayout_2.addWidget(self.line_3)
self.formLayout_2 = QtWidgets.QFormLayout()
self.formLayout_2.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)
self.formLayout_2.setObjectName("formLayout_2")
self.voltLabel = QtWidgets.QLabel(self.centralwidget)
self.voltLabel.setScaledContents(False)
self.voltLabel.setObjectName("voltLabel")
self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.voltLabel)
self.voltValueToSet = QtWidgets.QDoubleSpinBox(self.centralwidget)
self.voltValueToSet.setAccelerated(True)
self.voltValueToSet.setKeyboardTracking(False)
self.voltValueToSet.setDecimals(1)
self.voltValueToSet.setSingleStep(0.1)
self.voltValueToSet.setObjectName("voltValueToSet")
self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.voltValueToSet)
self.curLabel = QtWidgets.QLabel(self.centralwidget)
self.curLabel.setObjectName("curLabel")
self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.curLabel)
self.curValueToSet = QtWidgets.QDoubleSpinBox(self.centralwidget)
self.curValueToSet.setAccelerated(True)
self.curValueToSet.setKeyboardTracking(False)
self.curValueToSet.setDecimals(1)
self.curValueToSet.setSingleStep(0.1)
self.curValueToSet.setObjectName("curValueToSet")
self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.curValueToSet)
self.setBtn = QtWidgets.QPushButton(self.centralwidget)
self.setBtn.setObjectName("setBtn")
self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.setBtn)
self.resetBtn = QtWidgets.QPushButton(self.centralwidget)
self.resetBtn.setObjectName("resetBtn")
self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.resetBtn)
self.verticalLayout_2.addLayout(self.formLayout_2)
self.line = QtWidgets.QFrame(self.centralwidget)
self.line.setFrameShape(QtWidgets.QFrame.HLine)
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line.setObjectName("line")
self.verticalLayout_2.addWidget(self.line)
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.queryBtn = QtWidgets.QPushButton(self.centralwidget)
self.queryBtn.setObjectName("queryBtn")
self.verticalLayout.addWidget(self.queryBtn)
self.formLayout_3 = QtWidgets.QFormLayout()
self.formLayout_3.setObjectName("formLayout_3")
self.voltValuelabel = QtWidgets.QLabel(self.centralwidget)
self.voltValuelabel.setObjectName("voltValuelabel")
self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.voltValuelabel)
self.voltValueRead = QtWidgets.QLCDNumber(self.centralwidget)
self.voltValueRead.setEnabled(False)
self.voltValueRead.setFrameShape(QtWidgets.QFrame.Box)
self.voltValueRead.setFrameShadow(QtWidgets.QFrame.Plain)
self.voltValueRead.setSmallDecimalPoint(True)
self.voltValueRead.setDigitCount(5)
self.voltValueRead.setMode(QtWidgets.QLCDNumber.Dec)
self.voltValueRead.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
self.voltValueRead.setObjectName("voltValueRead")
self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.voltValueRead)
self.curValuelabel = QtWidgets.QLabel(self.centralwidget)
self.curValuelabel.setObjectName("curValuelabel")
self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.curValuelabel)
self.curValueRead = QtWidgets.QLCDNumber(self.centralwidget)
self.curValueRead.setEnabled(False)
self.curValueRead.setFrameShape(QtWidgets.QFrame.Box)
self.curValueRead.setFrameShadow(QtWidgets.QFrame.Plain)
self.curValueRead.setSmallDecimalPoint(True)
self.curValueRead.setDigitCount(5)
self.curValueRead.setMode(QtWidgets.QLCDNumber.Dec)
self.curValueRead.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
self.curValueRead.setObjectName("curValueRead")
self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.curValueRead)
self.verticalLayout.addLayout(self.formLayout_3)
self.verticalLayout_2.addLayout(self.verticalLayout)
self.formLayout_4 = QtWidgets.QFormLayout()
self.formLayout_4.setObjectName("formLayout_4")
self.hvOnLabel = QtWidgets.QLabel(self.centralwidget)
self.hvOnLabel.setObjectName("hvOnLabel")
self.formLayout_4.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.hvOnLabel)
self.faultLabel = QtWidgets.QLabel(self.centralwidget)
self.faultLabel.setObjectName("faultLabel")
self.formLayout_4.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.faultLabel)
self.ctrlModeLabel = QtWidgets.QLabel(self.centralwidget)
self.ctrlModeLabel.setObjectName("ctrlModeLabel")
self.formLayout_4.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.ctrlModeLabel)
self.ctrlModeVoltBtn = QtWidgets.QRadioButton(self.centralwidget)
self.ctrlModeVoltBtn.setEnabled(False)
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush)
self.ctrlModeVoltBtn.setPalette(palette)
self.ctrlModeVoltBtn.setCheckable(True)
self.ctrlModeVoltBtn.setChecked(True)
self.ctrlModeVoltBtn.setObjectName("ctrlModeVoltBtn")
self.formLayout_4.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.ctrlModeVoltBtn)
self.ctrlModeCurBtn = QtWidgets.QRadioButton(self.centralwidget)
self.ctrlModeCurBtn.setEnabled(False)
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush)
self.ctrlModeCurBtn.setPalette(palette)
self.ctrlModeCurBtn.setObjectName("ctrlModeCurBtn")
self.formLayout_4.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.ctrlModeCurBtn)
self.hvOnLed = QtWidgets.QLabel(self.centralwidget)
self.hvOnLed.setMaximumSize(QtCore.QSize(21, 21))
self.hvOnLed.setText("")
self.hvOnLed.setPixmap(QtGui.QPixmap(":/icons/green-led-on.png"))
self.hvOnLed.setScaledContents(True)
self.hvOnLed.setObjectName("hvOnLed")
self.formLayout_4.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.hvOnLed)
self.faultLed = QtWidgets.QLabel(self.centralwidget)
self.faultLed.setMaximumSize(QtCore.QSize(21, 21))
self.faultLed.setText("")
self.faultLed.setPixmap(QtGui.QPixmap(":/icons/led-red-on.png"))
self.faultLed.setScaledContents(True)
self.faultLed.setObjectName("faultLed")
self.formLayout_4.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.faultLed)
self.verticalLayout_2.addLayout(self.formLayout_4)
self.horizontalLayout.addLayout(self.verticalLayout_2)
self.line_2 = QtWidgets.QFrame(self.centralwidget)
self.line_2.setFrameShape(QtWidgets.QFrame.VLine)
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line_2.setObjectName("line_2")
self.horizontalLayout.addWidget(self.line_2)
self.verticalLayout_3 = QtWidgets.QVBoxLayout()
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.label = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.label.setFont(font)
self.label.setObjectName("label")
self.verticalLayout_3.addWidget(self.label)
self.formLayout_5 = QtWidgets.QFormLayout()
self.formLayout_5.setObjectName("formLayout_5")
self.prgSelectBtn = QtWidgets.QPushButton(self.centralwidget)
self.prgSelectBtn.setObjectName("prgSelectBtn")
self.formLayout_5.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.prgSelectBtn)
self.prgStartBtn = QtWidgets.QPushButton(self.centralwidget)
self.prgStartBtn.setObjectName("prgStartBtn")
self.formLayout_5.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.prgStartBtn)
self.prgStopBtn = QtWidgets.QPushButton(self.centralwidget)
self.prgStopBtn.setObjectName("prgStopBtn")
self.formLayout_5.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.prgStopBtn)
self.prgFilenameLineEdit = QtWidgets.QLineEdit(self.centralwidget)
self.prgFilenameLineEdit.setObjectName("prgFilenameLineEdit")
self.formLayout_5.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.prgFilenameLineEdit)
self.verticalLayout_3.addLayout(self.formLayout_5)
self.prgPlotVoltBtn = QtWidgets.QPushButton(self.centralwidget)
self.prgPlotVoltBtn.setObjectName("prgPlotVoltBtn")
self.verticalLayout_3.addWidget(self.prgPlotVoltBtn)
self.prgVoltGraph = QtWidgets.QGraphicsView(self.centralwidget)
self.prgVoltGraph.setObjectName("prgVoltGraph")
self.verticalLayout_3.addWidget(self.prgVoltGraph)
self.horizontalLayout.addLayout(self.verticalLayout_3)
self.verticalLayout_4.addLayout(self.horizontalLayout)
self.cmdOutLabel = QtWidgets.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.cmdOutLabel.setFont(font)
self.cmdOutLabel.setObjectName("cmdOutLabel")
self.verticalLayout_4.addWidget(self.cmdOutLabel)
self.cmdOutText = QtWidgets.QTextEdit(self.centralwidget)
self.cmdOutText.setReadOnly(True)
self.cmdOutText.setObjectName("cmdOutText")
self.verticalLayout_4.addWidget(self.cmdOutText)
self.gridLayout.addLayout(self.verticalLayout_4, 0, 0, 1, 1)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 465, 20))
self.menubar.setObjectName("menubar")
self.menuExit = QtWidgets.QMenu(self.menubar)
self.menuExit.setObjectName("menuExit")
self.menuHelp = QtWidgets.QMenu(self.menubar)
self.menuHelp.setObjectName("menuHelp")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.actionExit = QtWidgets.QAction(MainWindow)
self.actionExit.setObjectName("actionExit")
self.actionSettings = QtWidgets.QAction(MainWindow)
self.actionSettings.setObjectName("actionSettings")
self.actionHV_firmware_version = QtWidgets.QAction(MainWindow)
self.actionHV_firmware_version.setObjectName("actionHV_firmware_version")
self.actionOnline_documentation = QtWidgets.QAction(MainWindow)
self.actionOnline_documentation.setObjectName("actionOnline_documentation")
self.actionAbout = QtWidgets.QAction(MainWindow)
self.actionAbout.setObjectName("actionAbout")
self.menuExit.addAction(self.actionSettings)
self.menuExit.addAction(self.actionExit)
self.menuHelp.addAction(self.actionHV_firmware_version)
self.menuHelp.addAction(self.actionOnline_documentation)
self.menuHelp.addAction(self.actionAbout)
self.menubar.addAction(self.menuExit.menuAction())
self.menubar.addAction(self.menuHelp.menuAction())
self.voltLabel.setBuddy(self.voltValueToSet)
self.curLabel.setBuddy(self.curValueToSet)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "HV controller - Glassman FJ 40 kV 3 mA"))
self.prtNameLabel.setText(_translate("MainWindow", "Port name"))
self.prtOpenBtn.setText(_translate("MainWindow", "Open port"))
self.prtCloseBtn.setText(_translate("MainWindow", "Close port"))
self.voltLabel.setText(_translate("MainWindow", "Voltage (kV)"))
self.curLabel.setText(_translate("MainWindow", "Current (mA)"))
self.setBtn.setText(_translate("MainWindow", "Set values"))
self.resetBtn.setText(_translate("MainWindow", "Reset"))
self.queryBtn.setText(_translate("MainWindow", "Query HV status"))
self.voltValuelabel.setText(_translate("MainWindow", "V (kV)"))
self.curValuelabel.setText(_translate("MainWindow", "I (mA)"))
self.hvOnLabel.setText(_translate("MainWindow", "HV on"))
self.faultLabel.setText(_translate("MainWindow", "Fault"))
self.ctrlModeLabel.setText(_translate("MainWindow", "Ctrl mode"))
self.ctrlModeVoltBtn.setText(_translate("MainWindow", "Voltage"))
self.ctrlModeCurBtn.setText(_translate("MainWindow", "Current"))
self.label.setText(_translate("MainWindow", "Set a program"))
self.prgSelectBtn.setText(_translate("MainWindow", "Select file :"))
self.prgStartBtn.setText(_translate("MainWindow", "Start"))
self.prgStopBtn.setText(_translate("MainWindow", "Stop"))
self.prgPlotVoltBtn.setText(_translate("MainWindow", "Plot current HV program"))
self.cmdOutLabel.setText(_translate("MainWindow", "Command output"))
self.menuExit.setTitle(_translate("MainWindow", "&Menu"))
self.menuHelp.setTitle(_translate("MainWindow", "Help"))
self.actionExit.setText(_translate("MainWindow", "Exit"))
self.actionExit.setStatusTip(_translate("MainWindow", "\'Exit application\'"))
self.actionExit.setShortcut(_translate("MainWindow", "Ctrl+Q"))
self.actionSettings.setText(_translate("MainWindow", "Settings"))
self.actionHV_firmware_version.setText(_translate("MainWindow", "HV firmware version"))
self.actionOnline_documentation.setText(_translate("MainWindow", "Online documentation"))
self.actionAbout.setText(_translate("MainWindow", "About"))
import resources_rc