ui_app.py 12.1 KB
Newer Older
1
2
3
4
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'ui_app.ui'
#
5
# Created by: PyQt5 UI code generator 5.14.1
6
7
8
9
10
11
12
13
14
#
# 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")
Tong Zhang's avatar
Tong Zhang committed
15
        MainWindow.resize(1341, 687)
16
        icon = QtGui.QIcon()
17
18
        icon.addPixmap(QtGui.QPixmap(":/icons/default.png"),
                       QtGui.QIcon.Normal, QtGui.QIcon.Off)
19
20
21
        MainWindow.setWindowIcon(icon)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
22
23
        self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
        self.gridLayout.setObjectName("gridLayout")
Tong Zhang's avatar
Tong Zhang committed
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
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.label = QtWidgets.QLabel(self.centralwidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.label.sizePolicy().hasHeightForWidth())
        self.label.setSizePolicy(sizePolicy)
        self.label.setObjectName("label")
        self.horizontalLayout.addWidget(self.label)
        self.quad1_name_cbb = QtWidgets.QComboBox(self.centralwidget)
        self.quad1_name_cbb.setObjectName("quad1_name_cbb")
        self.horizontalLayout.addWidget(self.quad1_name_cbb)
        self.label_2 = QtWidgets.QLabel(self.centralwidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.label_2.sizePolicy().hasHeightForWidth())
        self.label_2.setSizePolicy(sizePolicy)
        self.label_2.setObjectName("label_2")
        self.horizontalLayout.addWidget(self.label_2)
        self.quad1_grad_dsbox = QtWidgets.QDoubleSpinBox(self.centralwidget)
        self.quad1_grad_dsbox.setDecimals(3)
        self.quad1_grad_dsbox.setMinimum(-200.0)
        self.quad1_grad_dsbox.setMaximum(200.0)
        self.quad1_grad_dsbox.setObjectName("quad1_grad_dsbox")
        self.horizontalLayout.addWidget(self.quad1_grad_dsbox)
        self.gridLayout.addLayout(self.horizontalLayout, 1, 0, 1, 1)
56
57
58
59
        self.tabWidget = QtWidgets.QTabWidget(self.centralwidget)
        self.tabWidget.setObjectName("tabWidget")
        self.tab = QtWidgets.QWidget()
        self.tab.setObjectName("tab")
Tong Zhang's avatar
Tong Zhang committed
60
61
62
        self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.tab)
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
63
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
Tong Zhang's avatar
Tong Zhang committed
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
        self.label_3 = QtWidgets.QLabel(self.tab)
        self.label_3.setObjectName("label_3")
        self.horizontalLayout_2.addWidget(self.label_3)
        self.elemlist_cbb = QtWidgets.QComboBox(self.tab)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(1)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.elemlist_cbb.sizePolicy().hasHeightForWidth())
        self.elemlist_cbb.setSizePolicy(sizePolicy)
        self.elemlist_cbb.setObjectName("elemlist_cbb")
        self.horizontalLayout_2.addWidget(self.elemlist_cbb)
        self.pos_lineEdit = QtWidgets.QLineEdit(self.tab)
        self.pos_lineEdit.setReadOnly(True)
        self.pos_lineEdit.setObjectName("pos_lineEdit")
        self.horizontalLayout_2.addWidget(self.pos_lineEdit)
        self.family_lineEdit = QtWidgets.QLineEdit(self.tab)
        self.family_lineEdit.setReadOnly(True)
        self.family_lineEdit.setObjectName("family_lineEdit")
        self.horizontalLayout_2.addWidget(self.family_lineEdit)
        self.verticalLayout_3.addLayout(self.horizontalLayout_2)
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
90
        self.x_ellipse_plot = MatplotlibBaseWidget(self.tab)
Doerr, Kevin's avatar
Doerr, Kevin committed
91
92
93
94
95
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
96
97
98
            self.x_ellipse_plot.sizePolicy().hasHeightForWidth())
        self.x_ellipse_plot.setSizePolicy(sizePolicy)
        self.x_ellipse_plot.setFigureTitle("")
Tong Zhang's avatar
Tong Zhang committed
99
100
101
102
103
104
        font = QtGui.QFont()
        font.setFamily("sans-serif")
        font.setPointSize(14)
        font.setBold(False)
        font.setItalic(False)
        font.setWeight(50)
105
        self.x_ellipse_plot.setFigureXYlabelFont(font)
Tong Zhang's avatar
Tong Zhang committed
106
107
108
109
110
111
        font = QtGui.QFont()
        font.setFamily("sans-serif")
        font.setPointSize(16)
        font.setBold(False)
        font.setItalic(False)
        font.setWeight(50)
112
        self.x_ellipse_plot.setFigureTitleFont(font)
Tong Zhang's avatar
Tong Zhang committed
113
114
115
116
117
118
        font = QtGui.QFont()
        font.setFamily("sans-serif")
        font.setPointSize(12)
        font.setBold(False)
        font.setItalic(False)
        font.setWeight(50)
119
120
121
        self.x_ellipse_plot.setFigureXYticksFont(font)
        self.x_ellipse_plot.setProperty("figureToolbarToggle", False)
        self.x_ellipse_plot.setObjectName("x_ellipse_plot")
Tong Zhang's avatar
Tong Zhang committed
122
123
124
125
        self.verticalLayout.addWidget(self.x_ellipse_plot)
        self.horizontalLayout_4.addLayout(self.verticalLayout)
        self.verticalLayout_2 = QtWidgets.QVBoxLayout()
        self.verticalLayout_2.setObjectName("verticalLayout_2")
126
        self.y_ellipse_plot = MatplotlibBaseWidget(self.tab)
Doerr, Kevin's avatar
Doerr, Kevin committed
127
128
129
130
131
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
132
133
            self.y_ellipse_plot.sizePolicy().hasHeightForWidth())
        self.y_ellipse_plot.setSizePolicy(sizePolicy)
Doerr, Kevin's avatar
Doerr, Kevin committed
134
135
136
137
138
139
        font = QtGui.QFont()
        font.setFamily("sans-serif")
        font.setPointSize(14)
        font.setBold(False)
        font.setItalic(False)
        font.setWeight(50)
140
        self.y_ellipse_plot.setFigureXYlabelFont(font)
Doerr, Kevin's avatar
Doerr, Kevin committed
141
142
143
144
145
146
        font = QtGui.QFont()
        font.setFamily("sans-serif")
        font.setPointSize(16)
        font.setBold(False)
        font.setItalic(False)
        font.setWeight(50)
147
        self.y_ellipse_plot.setFigureTitleFont(font)
Doerr, Kevin's avatar
Doerr, Kevin committed
148
149
150
151
152
153
        font = QtGui.QFont()
        font.setFamily("sans-serif")
        font.setPointSize(12)
        font.setBold(False)
        font.setItalic(False)
        font.setWeight(50)
154
155
156
        self.y_ellipse_plot.setFigureXYticksFont(font)
        self.y_ellipse_plot.setProperty("figureToolbarToggle", False)
        self.y_ellipse_plot.setObjectName("y_ellipse_plot")
Tong Zhang's avatar
Tong Zhang committed
157
158
159
        self.verticalLayout_2.addWidget(self.y_ellipse_plot)
        self.horizontalLayout_4.addLayout(self.verticalLayout_2)
        self.verticalLayout_3.addLayout(self.horizontalLayout_4)
160
161
162
163
164
165
        self.tabWidget.addTab(self.tab, "")
        self.tab_2 = QtWidgets.QWidget()
        self.tab_2.setObjectName("tab_2")
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.tab_2)
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.envelope_plot = MatplotlibCurveWidget(self.tab_2)
Tong Zhang's avatar
Tong Zhang committed
166
        self.envelope_plot.setFigureAutoScale(True)
167
168
169
170
171
172
173
174
175
176
177
178
        font = QtGui.QFont()
        font.setFamily("sans-serif")
        font.setPointSize(14)
        font.setBold(False)
        font.setItalic(False)
        font.setWeight(50)
        self.envelope_plot.setFigureXYlabelFont(font)
        self.envelope_plot.setProperty("figureLegendToggle", True)
        self.envelope_plot.setObjectName("envelope_plot")
        self.horizontalLayout_3.addWidget(self.envelope_plot)
        self.tabWidget.addTab(self.tab_2, "")
        self.gridLayout.addWidget(self.tabWidget, 0, 0, 1, 1)
179
180
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
Tong Zhang's avatar
Tong Zhang committed
181
        self.menubar.setGeometry(QtCore.QRect(0, 0, 1341, 30))
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
        self.menubar.setObjectName("menubar")
        self.menu_File = QtWidgets.QMenu(self.menubar)
        self.menu_File.setObjectName("menu_File")
        self.menu_Help = QtWidgets.QMenu(self.menubar)
        self.menu_Help.setObjectName("menu_Help")
        MainWindow.setMenuBar(self.menubar)
        self.action_About = QtWidgets.QAction(MainWindow)
        self.action_About.setObjectName("action_About")
        self.actionAbout_Qt = QtWidgets.QAction(MainWindow)
        self.actionAbout_Qt.setObjectName("actionAbout_Qt")
        self.actionE_xit = QtWidgets.QAction(MainWindow)
        self.actionE_xit.setObjectName("actionE_xit")
        self.actionContents = QtWidgets.QAction(MainWindow)
        self.actionContents.setObjectName("actionContents")
        self.menu_File.addAction(self.actionE_xit)
        self.menu_Help.addAction(self.actionContents)
        self.menu_Help.addSeparator()
        self.menu_Help.addAction(self.action_About)
        self.menu_Help.addAction(self.actionAbout_Qt)
        self.menubar.addAction(self.menu_File.menuAction())
        self.menubar.addAction(self.menu_Help.menuAction())

        self.retranslateUi(MainWindow)
205
        self.tabWidget.setCurrentIndex(0)
206
207
208
209
210
211
212
213
        self.actionAbout_Qt.triggered.connect(MainWindow.onAboutQt)
        self.actionE_xit.triggered.connect(MainWindow.close)
        self.action_About.triggered.connect(MainWindow.onAbout)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
Tong Zhang's avatar
Tong Zhang committed
214
215
216
217
        self.label.setText(_translate("MainWindow", "Select quadrupole"))
        self.label_2.setText(_translate("MainWindow", "Gradient Setting"))
        self.quad1_grad_dsbox.setSuffix(_translate("MainWindow", " T/m"))
        self.label_3.setText(_translate("MainWindow", "Show results after"))
218
219
        self.x_ellipse_plot.setFigureXlabel(_translate("MainWindow", "X (mm)"))
        self.x_ellipse_plot.setFigureYlabel(
Doerr, Kevin's avatar
Doerr, Kevin committed
220
            _translate("MainWindow", "X\' (mrad)"))
221
222
223
224
225
226
227
228
229
230
        self.y_ellipse_plot.setFigureXlabel(_translate("MainWindow", "Y (mm)"))
        self.y_ellipse_plot.setFigureYlabel(
            _translate("MainWindow", "Y\' (mrad)"))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab),
                                  _translate("MainWindow", "Beam Ellipse"))
        self.envelope_plot.setFigureXlabel(_translate("MainWindow", "s [m]"))
        self.envelope_plot.setFigureYlabel(
            _translate("MainWindow", "Envelop [mm]"))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2),
                                  _translate("MainWindow", "Beam Envelope"))
231
232
233
234
235
236
237
238
239
240
241
        self.menu_File.setTitle(_translate("MainWindow", "&File"))
        self.menu_Help.setTitle(_translate("MainWindow", "&Help"))
        self.action_About.setText(_translate("MainWindow", "&About"))
        self.action_About.setShortcut(_translate("MainWindow", "Ctrl+A"))
        self.actionAbout_Qt.setText(_translate("MainWindow", "About Qt"))
        self.actionE_xit.setText(_translate("MainWindow", "E&xit"))
        self.actionE_xit.setShortcut(_translate("MainWindow", "Ctrl+W"))
        self.actionContents.setText(_translate("MainWindow", "Contents"))
        self.actionContents.setShortcut(_translate("MainWindow", "F1"))


Tong Zhang's avatar
Tong Zhang committed
242
from mpl4qt.widgets.mplbasewidget import MatplotlibBaseWidget
243
from mpl4qt.widgets.mplcurvewidget import MatplotlibCurveWidget
244
245
246
247
248
249
250
251
252
253
from . import resources_rc

if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    MainWindow = QtWidgets.QMainWindow()
    ui = Ui_MainWindow()
    ui.setupUi(MainWindow)
    MainWindow.show()
    sys.exit(app.exec_())