ui_app.py 10.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")
15
        MainWindow.resize(1381, 641)
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
24
25
26
27
28
29
30
        self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
        self.gridLayout.setObjectName("gridLayout")
        self.tabWidget = QtWidgets.QTabWidget(self.centralwidget)
        self.tabWidget.setObjectName("tabWidget")
        self.tab = QtWidgets.QWidget()
        self.tab.setObjectName("tab")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.tab)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.x_ellipse_plot = MatplotlibBaseWidget(self.tab)
Doerr, Kevin's avatar
Doerr, Kevin committed
31
32
33
34
35
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
36
37
38
            self.x_ellipse_plot.sizePolicy().hasHeightForWidth())
        self.x_ellipse_plot.setSizePolicy(sizePolicy)
        self.x_ellipse_plot.setFigureTitle("")
Tong Zhang's avatar
Tong Zhang committed
39
40
41
42
43
44
        font = QtGui.QFont()
        font.setFamily("sans-serif")
        font.setPointSize(14)
        font.setBold(False)
        font.setItalic(False)
        font.setWeight(50)
45
        self.x_ellipse_plot.setFigureXYlabelFont(font)
Tong Zhang's avatar
Tong Zhang committed
46
47
48
49
50
51
        font = QtGui.QFont()
        font.setFamily("sans-serif")
        font.setPointSize(16)
        font.setBold(False)
        font.setItalic(False)
        font.setWeight(50)
52
        self.x_ellipse_plot.setFigureTitleFont(font)
Tong Zhang's avatar
Tong Zhang committed
53
54
55
56
57
58
        font = QtGui.QFont()
        font.setFamily("sans-serif")
        font.setPointSize(12)
        font.setBold(False)
        font.setItalic(False)
        font.setWeight(50)
59
60
61
62
63
        self.x_ellipse_plot.setFigureXYticksFont(font)
        self.x_ellipse_plot.setProperty("figureToolbarToggle", False)
        self.x_ellipse_plot.setObjectName("x_ellipse_plot")
        self.horizontalLayout_2.addWidget(self.x_ellipse_plot)
        self.y_ellipse_plot = MatplotlibBaseWidget(self.tab)
Doerr, Kevin's avatar
Doerr, Kevin committed
64
65
66
67
68
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
69
70
            self.y_ellipse_plot.sizePolicy().hasHeightForWidth())
        self.y_ellipse_plot.setSizePolicy(sizePolicy)
Doerr, Kevin's avatar
Doerr, Kevin committed
71
72
73
74
75
76
        font = QtGui.QFont()
        font.setFamily("sans-serif")
        font.setPointSize(14)
        font.setBold(False)
        font.setItalic(False)
        font.setWeight(50)
77
        self.y_ellipse_plot.setFigureXYlabelFont(font)
Doerr, Kevin's avatar
Doerr, Kevin committed
78
79
80
81
82
83
        font = QtGui.QFont()
        font.setFamily("sans-serif")
        font.setPointSize(16)
        font.setBold(False)
        font.setItalic(False)
        font.setWeight(50)
84
        self.y_ellipse_plot.setFigureTitleFont(font)
Doerr, Kevin's avatar
Doerr, Kevin committed
85
86
87
88
89
90
        font = QtGui.QFont()
        font.setFamily("sans-serif")
        font.setPointSize(12)
        font.setBold(False)
        font.setItalic(False)
        font.setWeight(50)
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
        self.y_ellipse_plot.setFigureXYticksFont(font)
        self.y_ellipse_plot.setProperty("figureToolbarToggle", False)
        self.y_ellipse_plot.setObjectName("y_ellipse_plot")
        self.horizontalLayout_2.addWidget(self.y_ellipse_plot)
        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)
        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)
        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.setObjectName("quad1_grad_dsbox")
        self.horizontalLayout.addWidget(self.quad1_grad_dsbox)
        self.gridLayout.addLayout(self.horizontalLayout, 1, 0, 1, 1)
143
144
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
145
        self.menubar.setGeometry(QtCore.QRect(0, 0, 1381, 30))
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
        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)
169
        self.tabWidget.setCurrentIndex(0)
170
171
172
173
174
175
176
177
        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"))
178
179
        self.x_ellipse_plot.setFigureXlabel(_translate("MainWindow", "X (mm)"))
        self.x_ellipse_plot.setFigureYlabel(
Doerr, Kevin's avatar
Doerr, Kevin committed
180
            _translate("MainWindow", "X\' (mrad)"))
181
182
183
184
185
186
187
188
189
190
        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"))
Tong Zhang's avatar
Tong Zhang committed
191
192
193
        self.label.setText(_translate("MainWindow", "Select quadrupole"))
        self.label_2.setText(_translate("MainWindow", "Gradient Setting"))
        self.quad1_grad_dsbox.setSuffix(_translate("MainWindow", " T/m"))
194
195
196
197
198
199
200
201
202
203
204
        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
205
from mpl4qt.widgets.mplbasewidget import MatplotlibBaseWidget
206
from mpl4qt.widgets.mplcurvewidget import MatplotlibCurveWidget
207
208
209
210
211
212
213
214
215
216
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_())