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

# Form implementation generated from reading ui file 'ui_app.ui'
#
Doerr, Kevin's avatar
Doerr, Kevin committed
5
# Created by: PyQt5 UI code generator 5.11.3
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")
Doerr, Kevin's avatar
Doerr, Kevin committed
15
        MainWindow.resize(1284, 709)
16
        icon = QtGui.QIcon()
Doerr, Kevin's avatar
Doerr, Kevin committed
17
18
19
        icon.addPixmap(
            QtGui.QPixmap(":/icons/default.png"), QtGui.QIcon.Normal,
            QtGui.QIcon.Off)
20
21
22
        MainWindow.setWindowIcon(icon)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
Tong Zhang's avatar
Tong Zhang committed
23
        self.matplotlibbaseWidget = MatplotlibBaseWidget(self.centralwidget)
Doerr, Kevin's avatar
Doerr, Kevin committed
24
25
26
27
28
29
30
31
        self.matplotlibbaseWidget.setGeometry(QtCore.QRect(0, 0, 640, 480))
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.matplotlibbaseWidget.sizePolicy().hasHeightForWidth())
        self.matplotlibbaseWidget.setSizePolicy(sizePolicy)
Tong Zhang's avatar
Tong Zhang committed
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
        font = QtGui.QFont()
        font.setFamily("sans-serif")
        font.setPointSize(14)
        font.setBold(False)
        font.setItalic(False)
        font.setWeight(50)
        self.matplotlibbaseWidget.setFigureXYlabelFont(font)
        font = QtGui.QFont()
        font.setFamily("sans-serif")
        font.setPointSize(16)
        font.setBold(False)
        font.setItalic(False)
        font.setWeight(50)
        self.matplotlibbaseWidget.setFigureTitleFont(font)
        font = QtGui.QFont()
        font.setFamily("sans-serif")
        font.setPointSize(12)
        font.setBold(False)
        font.setItalic(False)
        font.setWeight(50)
        self.matplotlibbaseWidget.setFigureXYticksFont(font)
Doerr, Kevin's avatar
Doerr, Kevin committed
53
        self.matplotlibbaseWidget.setProperty("figureToolbarToggle", False)
Tong Zhang's avatar
Tong Zhang committed
54
55
        self.matplotlibbaseWidget.setObjectName("matplotlibbaseWidget")
        self.label = QtWidgets.QLabel(self.centralwidget)
Doerr, Kevin's avatar
Doerr, Kevin committed
56
        self.label.setGeometry(QtCore.QRect(0, 480, 121, 19))
Tong Zhang's avatar
Tong Zhang committed
57
58
59
60
61
62
63
64
65
        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.quad1_name_cbb = QtWidgets.QComboBox(self.centralwidget)
Doerr, Kevin's avatar
Doerr, Kevin committed
66
        self.quad1_name_cbb.setGeometry(QtCore.QRect(120, 480, 79, 27))
Tong Zhang's avatar
Tong Zhang committed
67
68
        self.quad1_name_cbb.setObjectName("quad1_name_cbb")
        self.label_2 = QtWidgets.QLabel(self.centralwidget)
Doerr, Kevin's avatar
Doerr, Kevin committed
69
        self.label_2.setGeometry(QtCore.QRect(210, 480, 111, 19))
Tong Zhang's avatar
Tong Zhang committed
70
71
72
73
74
75
76
77
78
        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.quad1_grad_dsbox = QtWidgets.QDoubleSpinBox(self.centralwidget)
Doerr, Kevin's avatar
Doerr, Kevin committed
79
        self.quad1_grad_dsbox.setGeometry(QtCore.QRect(320, 480, 111, 28))
Tong Zhang's avatar
Tong Zhang committed
80
81
        self.quad1_grad_dsbox.setDecimals(3)
        self.quad1_grad_dsbox.setObjectName("quad1_grad_dsbox")
Doerr, Kevin's avatar
Doerr, Kevin committed
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
        self.matplotlibbaseWidget_1 = MatplotlibBaseWidget(self.centralwidget)
        self.matplotlibbaseWidget_1.setGeometry(QtCore.QRect(640, 0, 640, 480))
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.matplotlibbaseWidget_1.sizePolicy().hasHeightForWidth())
        self.matplotlibbaseWidget_1.setSizePolicy(sizePolicy)
        font = QtGui.QFont()
        font.setFamily("sans-serif")
        font.setPointSize(14)
        font.setBold(False)
        font.setItalic(False)
        font.setWeight(50)
        self.matplotlibbaseWidget_1.setFigureXYlabelFont(font)
        font = QtGui.QFont()
        font.setFamily("sans-serif")
        font.setPointSize(16)
        font.setBold(False)
        font.setItalic(False)
        font.setWeight(50)
        self.matplotlibbaseWidget_1.setFigureTitleFont(font)
        font = QtGui.QFont()
        font.setFamily("sans-serif")
        font.setPointSize(12)
        font.setBold(False)
        font.setItalic(False)
        font.setWeight(50)
        self.matplotlibbaseWidget_1.setFigureXYticksFont(font)
        self.matplotlibbaseWidget_1.setProperty("figureToolbarToggle", False)
        self.matplotlibbaseWidget_1.setObjectName("matplotlibbaseWidget_1")
114
115
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
Doerr, Kevin's avatar
Doerr, Kevin committed
116
        self.menubar.setGeometry(QtCore.QRect(0, 0, 1284, 24))
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
        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)
        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"))
Doerr, Kevin's avatar
Doerr, Kevin committed
148
149
150
151
        self.matplotlibbaseWidget.setFigureXlabel(
            _translate("MainWindow", "X (mm)"))
        self.matplotlibbaseWidget.setFigureYlabel(
            _translate("MainWindow", "X\' (mrad)"))
Tong Zhang's avatar
Tong Zhang committed
152
153
154
        self.label.setText(_translate("MainWindow", "Select quadrupole"))
        self.label_2.setText(_translate("MainWindow", "Gradient Setting"))
        self.quad1_grad_dsbox.setSuffix(_translate("MainWindow", " T/m"))
Doerr, Kevin's avatar
Doerr, Kevin committed
155
156
157
158
        self.matplotlibbaseWidget_1.setFigureXlabel(
            _translate("MainWindow", "Y (mm)"))
        self.matplotlibbaseWidget_1.setFigureYlabel(
            _translate("MainWindow", "Y\' (mrad)"))
159
160
161
162
163
164
165
166
167
168
169
        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
170
from mpl4qt.widgets.mplbasewidget import MatplotlibBaseWidget
171
172
173
174
175
176
177
178
179
180
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_())