forked from goatsofnaxos/VBAcmd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwindow.pyw
More file actions
334 lines (324 loc) · 19.4 KB
/
window.pyw
File metadata and controls
334 lines (324 loc) · 19.4 KB
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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'C:\Users\All\Desktop\pyscript\eclipse\VBAcmd\VBAcmd.ui'
#
# Created: Thu Nov 03 11:00:41 2016
# by: PyQt4 UI code generator 4.9.6
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow"))
MainWindow.resize(604, 528)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
MainWindow.setSizePolicy(sizePolicy)
MainWindow.setAutoFillBackground(False)
self.centralwidget = QtGui.QWidget(MainWindow)
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
self.verticalLayout_11 = QtGui.QVBoxLayout(self.centralwidget)
self.verticalLayout_11.setObjectName(_fromUtf8("verticalLayout_11"))
self.horizontalLayout_4 = QtGui.QHBoxLayout()
self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4"))
self.verticalLayout = QtGui.QVBoxLayout()
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
spacerItem = QtGui.QSpacerItem(20, 10, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem)
self.label = QtGui.QLabel(self.centralwidget)
self.label.setAlignment(QtCore.Qt.AlignCenter)
self.label.setObjectName(_fromUtf8("label"))
self.verticalLayout.addWidget(self.label)
self.laserThresholdDoubleSpinBox = QtGui.QDoubleSpinBox(self.centralwidget)
self.laserThresholdDoubleSpinBox.setDecimals(1)
self.laserThresholdDoubleSpinBox.setMinimum(0.0)
self.laserThresholdDoubleSpinBox.setMaximum(10000.0)
self.laserThresholdDoubleSpinBox.setSingleStep(1.0)
self.laserThresholdDoubleSpinBox.setObjectName(_fromUtf8("laserThresholdDoubleSpinBox"))
self.verticalLayout.addWidget(self.laserThresholdDoubleSpinBox)
spacerItem1 = QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
self.verticalLayout.addItem(spacerItem1)
self.label_2 = QtGui.QLabel(self.centralwidget)
self.label_2.setAlignment(QtCore.Qt.AlignCenter)
self.label_2.setObjectName(_fromUtf8("label_2"))
self.verticalLayout.addWidget(self.label_2)
self.laserWaitTimeDoubleSpinBox = QtGui.QDoubleSpinBox(self.centralwidget)
self.laserWaitTimeDoubleSpinBox.setDecimals(1)
self.laserWaitTimeDoubleSpinBox.setMinimum(0.0)
self.laserWaitTimeDoubleSpinBox.setMaximum(10000.0)
self.laserWaitTimeDoubleSpinBox.setSingleStep(1.0)
self.laserWaitTimeDoubleSpinBox.setObjectName(_fromUtf8("laserWaitTimeDoubleSpinBox"))
self.verticalLayout.addWidget(self.laserWaitTimeDoubleSpinBox)
self.label_4 = QtGui.QLabel(self.centralwidget)
self.label_4.setAlignment(QtCore.Qt.AlignCenter)
self.label_4.setObjectName(_fromUtf8("label_4"))
self.verticalLayout.addWidget(self.label_4)
self.servoWaitTimeDoubleSpinBox = QtGui.QDoubleSpinBox(self.centralwidget)
self.servoWaitTimeDoubleSpinBox.setDecimals(1)
self.servoWaitTimeDoubleSpinBox.setMinimum(0.0)
self.servoWaitTimeDoubleSpinBox.setMaximum(10000.0)
self.servoWaitTimeDoubleSpinBox.setSingleStep(1.0)
self.servoWaitTimeDoubleSpinBox.setObjectName(_fromUtf8("servoWaitTimeDoubleSpinBox"))
self.verticalLayout.addWidget(self.servoWaitTimeDoubleSpinBox)
spacerItem2 = QtGui.QSpacerItem(20, 10, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem2)
self.horizontalLayout_4.addLayout(self.verticalLayout)
self.verticalLayout_7 = QtGui.QVBoxLayout()
self.verticalLayout_7.setObjectName(_fromUtf8("verticalLayout_7"))
self.horizontalLayout_2 = QtGui.QHBoxLayout()
self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
self.chartTitle_laserPosition = QtGui.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(False)
font.setWeight(50)
self.chartTitle_laserPosition.setFont(font)
self.chartTitle_laserPosition.setAlignment(QtCore.Qt.AlignCenter)
self.chartTitle_laserPosition.setObjectName(_fromUtf8("chartTitle_laserPosition"))
self.horizontalLayout_2.addWidget(self.chartTitle_laserPosition)
self.chartTitle_servoPosition = QtGui.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(False)
font.setWeight(50)
self.chartTitle_servoPosition.setFont(font)
self.chartTitle_servoPosition.setAlignment(QtCore.Qt.AlignCenter)
self.chartTitle_servoPosition.setObjectName(_fromUtf8("chartTitle_servoPosition"))
self.horizontalLayout_2.addWidget(self.chartTitle_servoPosition)
self.verticalLayout_7.addLayout(self.horizontalLayout_2)
self.positionPlot = Qwt5.QwtPlot(self.centralwidget)
self.positionPlot.setMinimumSize(QtCore.QSize(300, 150))
self.positionPlot.setMaximumSize(QtCore.QSize(16777215, 200))
self.positionPlot.setObjectName(_fromUtf8("positionPlot"))
self.verticalLayout_7.addWidget(self.positionPlot)
self.horizontalLayout_4.addLayout(self.verticalLayout_7)
self.verticalLayout_11.addLayout(self.horizontalLayout_4)
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
self.verticalLayout_10 = QtGui.QVBoxLayout()
self.verticalLayout_10.setObjectName(_fromUtf8("verticalLayout_10"))
spacerItem3 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout_10.addItem(spacerItem3)
self.verticalLayout_2 = QtGui.QVBoxLayout()
self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
self.label_3 = QtGui.QLabel(self.centralwidget)
self.label_3.setAlignment(QtCore.Qt.AlignCenter)
self.label_3.setObjectName(_fromUtf8("label_3"))
self.verticalLayout_2.addWidget(self.label_3)
self.forceThresholdDoubleSpinBox = QtGui.QDoubleSpinBox(self.centralwidget)
self.forceThresholdDoubleSpinBox.setDecimals(1)
self.forceThresholdDoubleSpinBox.setMinimum(0.0)
self.forceThresholdDoubleSpinBox.setMaximum(10000.0)
self.forceThresholdDoubleSpinBox.setSingleStep(1.0)
self.forceThresholdDoubleSpinBox.setObjectName(_fromUtf8("forceThresholdDoubleSpinBox"))
self.verticalLayout_2.addWidget(self.forceThresholdDoubleSpinBox)
self.label_5 = QtGui.QLabel(self.centralwidget)
self.label_5.setAlignment(QtCore.Qt.AlignCenter)
self.label_5.setObjectName(_fromUtf8("label_5"))
self.verticalLayout_2.addWidget(self.label_5)
self.forceTimeBeforeSlackDoubleSpinBox = QtGui.QDoubleSpinBox(self.centralwidget)
self.forceTimeBeforeSlackDoubleSpinBox.setDecimals(1)
self.forceTimeBeforeSlackDoubleSpinBox.setMinimum(0.0)
self.forceTimeBeforeSlackDoubleSpinBox.setMaximum(10000.0)
self.forceTimeBeforeSlackDoubleSpinBox.setSingleStep(1.0)
self.forceTimeBeforeSlackDoubleSpinBox.setObjectName(_fromUtf8("forceTimeBeforeSlackDoubleSpinBox"))
self.verticalLayout_2.addWidget(self.forceTimeBeforeSlackDoubleSpinBox)
self.verticalLayout_10.addLayout(self.verticalLayout_2)
spacerItem4 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.verticalLayout_10.addItem(spacerItem4)
self.horizontalLayout.addLayout(self.verticalLayout_10)
self.verticalLayout_3 = QtGui.QVBoxLayout()
self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3"))
self.chartTitle_force = QtGui.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(False)
font.setWeight(50)
self.chartTitle_force.setFont(font)
self.chartTitle_force.setAlignment(QtCore.Qt.AlignCenter)
self.chartTitle_force.setObjectName(_fromUtf8("chartTitle_force"))
self.verticalLayout_3.addWidget(self.chartTitle_force)
self.forcePlot = Qwt5.QwtPlot(self.centralwidget)
self.forcePlot.setMinimumSize(QtCore.QSize(300, 150))
self.forcePlot.setMaximumSize(QtCore.QSize(16777215, 200))
self.forcePlot.setObjectName(_fromUtf8("forcePlot"))
self.verticalLayout_3.addWidget(self.forcePlot)
self.horizontalLayout.addLayout(self.verticalLayout_3)
self.verticalLayout_11.addLayout(self.horizontalLayout)
self.line_3 = QtGui.QFrame(self.centralwidget)
self.line_3.setFrameShape(QtGui.QFrame.HLine)
self.line_3.setFrameShadow(QtGui.QFrame.Sunken)
self.line_3.setObjectName(_fromUtf8("line_3"))
self.verticalLayout_11.addWidget(self.line_3)
self.horizontalLayout_7 = QtGui.QHBoxLayout()
self.horizontalLayout_7.setObjectName(_fromUtf8("horizontalLayout_7"))
self.controlModeGroupBox = QtGui.QGroupBox(self.centralwidget)
self.controlModeGroupBox.setObjectName(_fromUtf8("controlModeGroupBox"))
self.verticalLayout_6 = QtGui.QVBoxLayout(self.controlModeGroupBox)
self.verticalLayout_6.setObjectName(_fromUtf8("verticalLayout_6"))
self.manualRadioButton = QtGui.QRadioButton(self.controlModeGroupBox)
self.manualRadioButton.setChecked(False)
self.manualRadioButton.setAutoExclusive(True)
self.manualRadioButton.setObjectName(_fromUtf8("manualRadioButton"))
self.verticalLayout_6.addWidget(self.manualRadioButton)
self.automaticRadioButton = QtGui.QRadioButton(self.controlModeGroupBox)
self.automaticRadioButton.setAutoExclusive(True)
self.automaticRadioButton.setObjectName(_fromUtf8("automaticRadioButton"))
self.verticalLayout_6.addWidget(self.automaticRadioButton)
self.horizontalLayout_7.addWidget(self.controlModeGroupBox)
self.line = QtGui.QFrame(self.centralwidget)
self.line.setFrameShape(QtGui.QFrame.VLine)
self.line.setFrameShadow(QtGui.QFrame.Sunken)
self.line.setObjectName(_fromUtf8("line"))
self.horizontalLayout_7.addWidget(self.line)
self.servoStateGroupBox = QtGui.QGroupBox(self.centralwidget)
self.servoStateGroupBox.setObjectName(_fromUtf8("servoStateGroupBox"))
self.verticalLayout_5 = QtGui.QVBoxLayout(self.servoStateGroupBox)
self.verticalLayout_5.setObjectName(_fromUtf8("verticalLayout_5"))
self.slackPositionRadioButton = QtGui.QRadioButton(self.servoStateGroupBox)
self.slackPositionRadioButton.setChecked(False)
self.slackPositionRadioButton.setAutoExclusive(True)
self.slackPositionRadioButton.setObjectName(_fromUtf8("slackPositionRadioButton"))
self.verticalLayout_5.addWidget(self.slackPositionRadioButton)
self.pullPositionRadioButton = QtGui.QRadioButton(self.servoStateGroupBox)
self.pullPositionRadioButton.setAutoExclusive(True)
self.pullPositionRadioButton.setObjectName(_fromUtf8("pullPositionRadioButton"))
self.verticalLayout_5.addWidget(self.pullPositionRadioButton)
self.horizontalLayout_7.addWidget(self.servoStateGroupBox)
self.line_2 = QtGui.QFrame(self.centralwidget)
self.line_2.setFrameShape(QtGui.QFrame.VLine)
self.line_2.setFrameShadow(QtGui.QFrame.Sunken)
self.line_2.setObjectName(_fromUtf8("line_2"))
self.horizontalLayout_7.addWidget(self.line_2)
self.horizontalLayout_3 = QtGui.QHBoxLayout()
self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
self.verticalLayout_9 = QtGui.QVBoxLayout()
self.verticalLayout_9.setObjectName(_fromUtf8("verticalLayout_9"))
self.label_7 = QtGui.QLabel(self.centralwidget)
self.label_7.setAlignment(QtCore.Qt.AlignCenter)
self.label_7.setObjectName(_fromUtf8("label_7"))
self.verticalLayout_9.addWidget(self.label_7)
self.label_6 = QtGui.QLabel(self.centralwidget)
self.label_6.setAlignment(QtCore.Qt.AlignCenter)
self.label_6.setObjectName(_fromUtf8("label_6"))
self.verticalLayout_9.addWidget(self.label_6)
self.horizontalLayout_3.addLayout(self.verticalLayout_9)
self.verticalLayout_8 = QtGui.QVBoxLayout()
self.verticalLayout_8.setObjectName(_fromUtf8("verticalLayout_8"))
self.slackPositionDoubleSpinBox = QtGui.QDoubleSpinBox(self.centralwidget)
self.slackPositionDoubleSpinBox.setDecimals(1)
self.slackPositionDoubleSpinBox.setMinimum(0.0)
self.slackPositionDoubleSpinBox.setMaximum(30.0)
self.slackPositionDoubleSpinBox.setSingleStep(0.1)
self.slackPositionDoubleSpinBox.setProperty("value", 0.0)
self.slackPositionDoubleSpinBox.setObjectName(_fromUtf8("slackPositionDoubleSpinBox"))
self.verticalLayout_8.addWidget(self.slackPositionDoubleSpinBox)
self.pullPositionDoubleSpinBox = QtGui.QDoubleSpinBox(self.centralwidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.pullPositionDoubleSpinBox.sizePolicy().hasHeightForWidth())
self.pullPositionDoubleSpinBox.setSizePolicy(sizePolicy)
self.pullPositionDoubleSpinBox.setDecimals(1)
self.pullPositionDoubleSpinBox.setMinimum(0.0)
self.pullPositionDoubleSpinBox.setMaximum(30.0)
self.pullPositionDoubleSpinBox.setSingleStep(0.1)
self.pullPositionDoubleSpinBox.setProperty("value", 0.0)
self.pullPositionDoubleSpinBox.setObjectName(_fromUtf8("pullPositionDoubleSpinBox"))
self.verticalLayout_8.addWidget(self.pullPositionDoubleSpinBox)
self.horizontalLayout_3.addLayout(self.verticalLayout_8)
self.horizontalLayout_7.addLayout(self.horizontalLayout_3)
self.line_4 = QtGui.QFrame(self.centralwidget)
self.line_4.setFrameShape(QtGui.QFrame.VLine)
self.line_4.setFrameShadow(QtGui.QFrame.Sunken)
self.line_4.setObjectName(_fromUtf8("line_4"))
self.horizontalLayout_7.addWidget(self.line_4)
self.verticalLayout_4 = QtGui.QVBoxLayout()
self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4"))
spacerItem5 = QtGui.QSpacerItem(20, 3, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
self.verticalLayout_4.addItem(spacerItem5)
self.horizontalLayout_6 = QtGui.QHBoxLayout()
self.horizontalLayout_6.setObjectName(_fromUtf8("horizontalLayout_6"))
spacerItem6 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_6.addItem(spacerItem6)
self.tubeStateTextLabel = QtGui.QLabel(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.tubeStateTextLabel.setFont(font)
self.tubeStateTextLabel.setAlignment(QtCore.Qt.AlignCenter)
self.tubeStateTextLabel.setObjectName(_fromUtf8("tubeStateTextLabel"))
self.horizontalLayout_6.addWidget(self.tubeStateTextLabel)
spacerItem7 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_6.addItem(spacerItem7)
self.verticalLayout_4.addLayout(self.horizontalLayout_6)
self.horizontalLayout_5 = QtGui.QHBoxLayout()
self.horizontalLayout_5.setObjectName(_fromUtf8("horizontalLayout_5"))
spacerItem8 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_5.addItem(spacerItem8)
self.startSig = QtGui.QLineEdit(self.centralwidget)
self.startSig.setEnabled(False)
self.startSig.setMinimumSize(QtCore.QSize(140, 0))
self.startSig.setMaximumSize(QtCore.QSize(75, 16777215))
self.startSig.setFocusPolicy(QtCore.Qt.NoFocus)
self.startSig.setObjectName(_fromUtf8("startSig"))
self.horizontalLayout_5.addWidget(self.startSig)
spacerItem9 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout_5.addItem(spacerItem9)
self.verticalLayout_4.addLayout(self.horizontalLayout_5)
spacerItem10 = QtGui.QSpacerItem(20, 3, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
self.verticalLayout_4.addItem(spacerItem10)
self.horizontalLayout_7.addLayout(self.verticalLayout_4)
self.verticalLayout_11.addLayout(self.horizontalLayout_7)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtGui.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 604, 21))
self.menubar.setObjectName(_fromUtf8("menubar"))
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtGui.QStatusBar(MainWindow)
self.statusbar.setObjectName(_fromUtf8("statusbar"))
MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(_translate("MainWindow", "VBAcmd", None))
self.label.setText(_translate("MainWindow", "Laser θ", None))
self.label_2.setText(_translate("MainWindow", "Laser wait (s)", None))
self.label_4.setText(_translate("MainWindow", "Servo wait (s)", None))
self.chartTitle_laserPosition.setText(_translate("MainWindow", "Laser position (mm)", None))
self.chartTitle_servoPosition.setText(_translate("MainWindow", "Servo position (mm)", None))
self.label_3.setText(_translate("MainWindow", "Force θ", None))
self.label_5.setText(_translate("MainWindow", "Force wait (s)", None))
self.chartTitle_force.setText(_translate("MainWindow", "Force (g)", None))
self.controlModeGroupBox.setTitle(_translate("MainWindow", "Control mode", None))
self.manualRadioButton.setText(_translate("MainWindow", "Stick shift", None))
self.automaticRadioButton.setText(_translate("MainWindow", "Automatic", None))
self.servoStateGroupBox.setTitle(_translate("MainWindow", "Servo state", None))
self.slackPositionRadioButton.setText(_translate("MainWindow", "Slackening", None))
self.pullPositionRadioButton.setText(_translate("MainWindow", "Pulling", None))
self.label_7.setText(_translate("MainWindow", "Slack position", None))
self.label_6.setText(_translate("MainWindow", "Pull position", None))
self.tubeStateTextLabel.setText(_translate("MainWindow", "FSM state", None))
from PyQt4 import Qwt5
if __name__ == "__main__":
import sys
app = QtGui.QApplication(sys.argv)
MainWindow = QtGui.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())