forked from timkrins/grblfeedr
/
outp.py
202 lines (196 loc) · 11.8 KB
/
outp.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
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mainwindow.ui'
#
# Created: Fri Sep 23 18:31:21 2011
# by: pyside-uic 0.2.13 running on PySide 1.0.6
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(730, 350)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
MainWindow.setSizePolicy(sizePolicy)
MainWindow.setMinimumSize(QtCore.QSize(300, 300))
MainWindow.setMouseTracking(True)
MainWindow.setAcceptDrops(True)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap("grblico.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
MainWindow.setWindowIcon(icon)
MainWindow.setWindowOpacity(0.95)
self.centralWidget = QtGui.QWidget(MainWindow)
self.centralWidget.setObjectName("centralWidget")
self.splitter = QtGui.QSplitter(self.centralWidget)
self.splitter.setGeometry(QtCore.QRect(10, 10, 481, 321))
self.splitter.setOrientation(QtCore.Qt.Vertical)
self.splitter.setObjectName("splitter")
self.layoutWidget = QtGui.QWidget(self.splitter)
self.layoutWidget.setObjectName("layoutWidget")
self.topHoriz = QtGui.QHBoxLayout(self.layoutWidget)
self.topHoriz.setContentsMargins(0, 0, 0, 0)
self.topHoriz.setObjectName("topHoriz")
self.termWindow = QtGui.QTextEdit(self.layoutWidget)
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(255, 255, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(120, 120, 120))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush)
brush = QtGui.QBrush(QtGui.QColor(240, 240, 240))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
self.termWindow.setPalette(palette)
font = QtGui.QFont()
font.setFamily("Terminal_Hex")
font.setPointSize(11)
font.setWeight(50)
font.setBold(False)
self.termWindow.setFont(font)
self.termWindow.setProperty("cursor", QtCore.Qt.ArrowCursor)
self.termWindow.setMouseTracking(True)
self.termWindow.setFocusPolicy(QtCore.Qt.NoFocus)
self.termWindow.setAcceptDrops(True)
self.termWindow.setFrameShadow(QtGui.QFrame.Plain)
self.termWindow.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.termWindow.setLineWrapMode(QtGui.QTextEdit.NoWrap)
self.termWindow.setReadOnly(True)
self.termWindow.setTextInteractionFlags(QtCore.Qt.NoTextInteraction)
self.termWindow.setObjectName("termWindow")
self.topHoriz.addWidget(self.termWindow)
self.controlVert = QtGui.QVBoxLayout()
self.controlVert.setObjectName("controlVert")
self.loadButton = QtGui.QPushButton(self.layoutWidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.loadButton.sizePolicy().hasHeightForWidth())
self.loadButton.setSizePolicy(sizePolicy)
self.loadButton.setMinimumSize(QtCore.QSize(0, 40))
self.loadButton.setFocusPolicy(QtCore.Qt.TabFocus)
self.loadButton.setFlat(False)
self.loadButton.setObjectName("loadButton")
self.controlVert.addWidget(self.loadButton)
self.sendOne = QtGui.QPushButton(self.layoutWidget)
self.sendOne.setFocusPolicy(QtCore.Qt.TabFocus)
self.sendOne.setObjectName("sendOne")
self.controlVert.addWidget(self.sendOne)
self.sendCont = QtGui.QPushButton(self.layoutWidget)
self.sendCont.setMinimumSize(QtCore.QSize(90, 0))
self.sendCont.setFocusPolicy(QtCore.Qt.TabFocus)
self.sendCont.setObjectName("sendCont")
self.controlVert.addWidget(self.sendCont)
self.sendStop = QtGui.QPushButton(self.layoutWidget)
self.sendStop.setFocusPolicy(QtCore.Qt.TabFocus)
self.sendStop.setFlat(False)
self.sendStop.setObjectName("sendStop")
self.controlVert.addWidget(self.sendStop)
self.clearButton = QtGui.QPushButton(self.layoutWidget)
self.clearButton.setObjectName("clearButton")
self.controlVert.addWidget(self.clearButton)
self.clearTerm = QtGui.QPushButton(self.layoutWidget)
self.clearTerm.setObjectName("clearTerm")
self.controlVert.addWidget(self.clearTerm)
self.topHoriz.addLayout(self.controlVert)
self.termLine = QtGui.QLineEdit(self.splitter)
font = QtGui.QFont()
font.setFamily("Terminal_Hex")
font.setPointSize(10)
self.termLine.setFont(font)
self.termLine.setObjectName("termLine")
self.layoutWidget1 = QtGui.QWidget(self.splitter)
self.layoutWidget1.setObjectName("layoutWidget1")
self.bottomHoriz = QtGui.QHBoxLayout(self.layoutWidget1)
self.bottomHoriz.setContentsMargins(0, 0, 0, 0)
self.bottomHoriz.setObjectName("bottomHoriz")
self.label = QtGui.QLabel(self.layoutWidget1)
self.label.setMaximumSize(QtCore.QSize(220, 100))
self.label.setText("")
self.label.setPixmap(QtGui.QPixmap("grblfeeder.png"))
self.label.setScaledContents(True)
self.label.setObjectName("label")
self.bottomHoriz.addWidget(self.label)
spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.bottomHoriz.addItem(spacerItem)
self.exitButton = QtGui.QPushButton(self.layoutWidget1)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(50)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.exitButton.sizePolicy().hasHeightForWidth())
self.exitButton.setSizePolicy(sizePolicy)
self.exitButton.setMinimumSize(QtCore.QSize(50, 0))
self.exitButton.setMaximumSize(QtCore.QSize(100, 50))
self.exitButton.setObjectName("exitButton")
self.bottomHoriz.addWidget(self.exitButton)
self.textEdit = QtGui.QTextEdit(self.centralWidget)
self.textEdit.setGeometry(QtCore.QRect(500, 10, 251, 281))
self.textEdit.setProperty("cursor", QtCore.Qt.ArrowCursor)
self.textEdit.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.textEdit.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.textEdit.setLineWrapMode(QtGui.QTextEdit.NoWrap)
self.textEdit.setTextInteractionFlags(QtCore.Qt.NoTextInteraction)
self.textEdit.setObjectName("textEdit")
self.currentProgress = QtGui.QProgressBar(self.centralWidget)
self.currentProgress.setGeometry(QtCore.QRect(500, 300, 251, 31))
self.currentProgress.setProperty("value", 0)
self.currentProgress.setAlignment(QtCore.Qt.AlignCenter)
self.currentProgress.setOrientation(QtCore.Qt.Horizontal)
self.currentProgress.setObjectName("currentProgress")
MainWindow.setCentralWidget(self.centralWidget)
self.menuBar = QtGui.QMenuBar(MainWindow)
self.menuBar.setGeometry(QtCore.QRect(0, 0, 760, 21))
self.menuBar.setObjectName("menuBar")
self.menuQt = QtGui.QMenu(self.menuBar)
self.menuQt.setObjectName("menuQt")
self.menuAbout = QtGui.QMenu(self.menuBar)
self.menuAbout.setObjectName("menuAbout")
MainWindow.setMenuBar(self.menuBar)
self.actionLoad_GCode = QtGui.QAction(MainWindow)
self.actionLoad_GCode.setObjectName("actionLoad_GCode")
self.actionExit = QtGui.QAction(MainWindow)
self.actionExit.setObjectName("actionExit")
self.actionConnect = QtGui.QAction(MainWindow)
self.actionConnect.setObjectName("actionConnect")
self.menuQt.addAction(self.actionConnect)
self.menuQt.addAction(self.actionLoad_GCode)
self.menuQt.addAction(self.actionExit)
self.menuBar.addAction(self.menuQt.menuAction())
self.menuBar.addAction(self.menuAbout.menuAction())
self.retranslateUi(MainWindow)
QtCore.QObject.connect(self.exitButton, QtCore.SIGNAL("clicked()"), MainWindow.close)
QtCore.QObject.connect(self.actionExit, QtCore.SIGNAL("activated()"), MainWindow.close)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "qtSerialFeeder", None, QtGui.QApplication.UnicodeUTF8))
self.termWindow.setHtml(QtGui.QApplication.translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'Terminal_Hex\'; font-size:11pt; font-weight:400; font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">termWindow</p></body></html>", None, QtGui.QApplication.UnicodeUTF8))
self.loadButton.setText(QtGui.QApplication.translate("MainWindow", "Load File", None, QtGui.QApplication.UnicodeUTF8))
self.sendOne.setText(QtGui.QApplication.translate("MainWindow", "Send One Line", None, QtGui.QApplication.UnicodeUTF8))
self.sendCont.setText(QtGui.QApplication.translate("MainWindow", "Send Continous", None, QtGui.QApplication.UnicodeUTF8))
self.sendStop.setText(QtGui.QApplication.translate("MainWindow", "Stop Sending", None, QtGui.QApplication.UnicodeUTF8))
self.clearButton.setText(QtGui.QApplication.translate("MainWindow", "Clear Queue", None, QtGui.QApplication.UnicodeUTF8))
self.clearTerm.setText(QtGui.QApplication.translate("MainWindow", "Clear Terminal", None, QtGui.QApplication.UnicodeUTF8))
self.termLine.setText(QtGui.QApplication.translate("MainWindow", "Enter Command", None, QtGui.QApplication.UnicodeUTF8))
self.exitButton.setText(QtGui.QApplication.translate("MainWindow", "Exit", None, QtGui.QApplication.UnicodeUTF8))
self.currentProgress.setFormat(QtGui.QApplication.translate("MainWindow", "Queue Progress: %p%", None, QtGui.QApplication.UnicodeUTF8))
self.menuQt.setTitle(QtGui.QApplication.translate("MainWindow", "File", None, QtGui.QApplication.UnicodeUTF8))
self.menuAbout.setTitle(QtGui.QApplication.translate("MainWindow", "About", None, QtGui.QApplication.UnicodeUTF8))
self.actionLoad_GCode.setText(QtGui.QApplication.translate("MainWindow", "Load GCode", None, QtGui.QApplication.UnicodeUTF8))
self.actionExit.setText(QtGui.QApplication.translate("MainWindow", "Exit", None, QtGui.QApplication.UnicodeUTF8))
self.actionConnect.setText(QtGui.QApplication.translate("MainWindow", "Connect", None, QtGui.QApplication.UnicodeUTF8))