Commit 2057df67 authored by Tong Zhang's avatar Tong Zhang
Browse files

UI: Update UI.

parent aab00e27
<RCC>
<qresource prefix="icons">
<file>info.png</file>
<file>default.png</file>
</qresource>
</RCC>
This diff is collapsed.
......@@ -12,7 +12,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(1341, 687)
MainWindow.resize(1337, 692)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/icons/default.png"),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
......@@ -21,44 +21,12 @@ class Ui_MainWindow(object):
self.centralwidget.setObjectName("centralwidget")
self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
self.gridLayout.setObjectName("gridLayout")
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)
self.tabWidget = QtWidgets.QTabWidget(self.centralwidget)
self.tabWidget.setObjectName("tabWidget")
self.tab = QtWidgets.QWidget()
self.tab.setObjectName("tab")
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.tab)
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.verticalLayout = QtWidgets.QVBoxLayout(self.tab)
self.verticalLayout.setObjectName("verticalLayout")
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.label_3 = QtWidgets.QLabel(self.tab)
......@@ -72,8 +40,20 @@ class Ui_MainWindow(object):
sizePolicy.setHeightForWidth(
self.elemlist_cbb.sizePolicy().hasHeightForWidth())
self.elemlist_cbb.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setFamily("Monospace")
self.elemlist_cbb.setFont(font)
self.elemlist_cbb.setObjectName("elemlist_cbb")
self.horizontalLayout_2.addWidget(self.elemlist_cbb)
self.elem_info_btn = QtWidgets.QToolButton(self.tab)
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(":/icons/info.png"), QtGui.QIcon.Normal,
QtGui.QIcon.Off)
self.elem_info_btn.setIcon(icon1)
self.elem_info_btn.setIconSize(QtCore.QSize(30, 30))
self.elem_info_btn.setAutoRaise(True)
self.elem_info_btn.setObjectName("elem_info_btn")
self.horizontalLayout_2.addWidget(self.elem_info_btn)
self.pos_lineEdit = QtWidgets.QLineEdit(self.tab)
self.pos_lineEdit.setReadOnly(True)
self.pos_lineEdit.setObjectName("pos_lineEdit")
......@@ -82,11 +62,9 @@ class Ui_MainWindow(object):
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.verticalLayout.addLayout(self.horizontalLayout_2)
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.x_ellipse_plot = MatplotlibBaseWidget(self.tab)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
QtWidgets.QSizePolicy.Fixed)
......@@ -119,10 +97,7 @@ class Ui_MainWindow(object):
self.x_ellipse_plot.setFigureXYticksFont(font)
self.x_ellipse_plot.setProperty("figureToolbarToggle", False)
self.x_ellipse_plot.setObjectName("x_ellipse_plot")
self.verticalLayout.addWidget(self.x_ellipse_plot)
self.horizontalLayout_4.addLayout(self.verticalLayout)
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.horizontalLayout_4.addWidget(self.x_ellipse_plot)
self.y_ellipse_plot = MatplotlibBaseWidget(self.tab)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
QtWidgets.QSizePolicy.Fixed)
......@@ -154,9 +129,8 @@ class Ui_MainWindow(object):
self.y_ellipse_plot.setFigureXYticksFont(font)
self.y_ellipse_plot.setProperty("figureToolbarToggle", False)
self.y_ellipse_plot.setObjectName("y_ellipse_plot")
self.verticalLayout_2.addWidget(self.y_ellipse_plot)
self.horizontalLayout_4.addLayout(self.verticalLayout_2)
self.verticalLayout_3.addLayout(self.horizontalLayout_4)
self.horizontalLayout_4.addWidget(self.y_ellipse_plot)
self.verticalLayout.addLayout(self.horizontalLayout_4)
self.tabWidget.addTab(self.tab, "")
self.tab_2 = QtWidgets.QWidget()
self.tab_2.setObjectName("tab_2")
......@@ -176,9 +150,62 @@ class Ui_MainWindow(object):
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)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(1)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(
self.quad1_name_cbb.sizePolicy().hasHeightForWidth())
self.quad1_name_cbb.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setFamily("Monospace")
self.quad1_name_cbb.setFont(font)
self.quad1_name_cbb.setObjectName("quad1_name_cbb")
self.horizontalLayout.addWidget(self.quad1_name_cbb)
self.quad_info_btn = QtWidgets.QToolButton(self.centralwidget)
self.quad_info_btn.setIcon(icon1)
self.quad_info_btn.setIconSize(QtCore.QSize(30, 30))
self.quad_info_btn.setAutoRaise(True)
self.quad_info_btn.setObjectName("quad_info_btn")
self.horizontalLayout.addWidget(self.quad_info_btn)
spacerItem = QtWidgets.QSpacerItem(40, 20,
QtWidgets.QSizePolicy.Expanding,
QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
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(-100.0)
self.quad1_grad_dsbox.setMaximum(100.0)
self.quad1_grad_dsbox.setSingleStep(0.1)
self.quad1_grad_dsbox.setObjectName("quad1_grad_dsbox")
self.horizontalLayout.addWidget(self.quad1_grad_dsbox)
self.gridLayout.addLayout(self.horizontalLayout, 1, 0, 1, 1)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 1341, 30))
self.menubar.setGeometry(QtCore.QRect(0, 0, 1337, 30))
self.menubar.setObjectName("menubar")
self.menu_File = QtWidgets.QMenu(self.menubar)
self.menu_File.setObjectName("menu_File")
......@@ -211,10 +238,11 @@ class Ui_MainWindow(object):
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
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"))
self.elem_info_btn.setToolTip(
_translate("MainWindow",
"Click to see the details of selected device."))
self.elem_info_btn.setText(_translate("MainWindow", "info"))
self.x_ellipse_plot.setFigureXlabel(_translate("MainWindow", "X (mm)"))
self.x_ellipse_plot.setFigureYlabel(
_translate("MainWindow", "X\' (mrad)"))
......@@ -228,6 +256,13 @@ class Ui_MainWindow(object):
_translate("MainWindow", "Envelop [mm]"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2),
_translate("MainWindow", "Beam Envelope"))
self.label.setText(_translate("MainWindow", "Select quadrupole"))
self.quad_info_btn.setToolTip(
_translate("MainWindow",
"Click to see the details of selected device."))
self.quad_info_btn.setText(_translate("MainWindow", "info"))
self.label_2.setText(_translate("MainWindow", "Gradient Setting"))
self.quad1_grad_dsbox.setSuffix(_translate("MainWindow", " T/m"))
self.menu_File.setTitle(_translate("MainWindow", "&File"))
self.menu_Help.setTitle(_translate("MainWindow", "&Help"))
self.action_About.setText(_translate("MainWindow", "&About"))
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1341</width>
<height>687</height>
<width>1337</width>
<height>692</height>
</rect>
</property>
<property name="windowTitle">
......@@ -19,55 +19,6 @@
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Select quadrupole</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="quad1_name_cbb"/>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Gradient Setting</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="quad1_grad_dsbox">
<property name="suffix">
<string> T/m</string>
</property>
<property name="decimals">
<number>3</number>
</property>
<property name="minimum">
<double>-200.000000000000000</double>
</property>
<property name="maximum">
<double>200.000000000000000</double>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
......@@ -77,7 +28,7 @@
<attribute name="title">
<string>Beam Ellipse</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
......@@ -95,6 +46,34 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Monospace</family>
</font>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="elem_info_btn">
<property name="toolTip">
<string>Click to see the details of selected device.</string>
</property>
<property name="text">
<string>info</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icons/info.png</normaloff>:/icons/info.png</iconset>
</property>
<property name="iconSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
......@@ -116,107 +95,99 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="MatplotlibBaseWidget" name="x_ellipse_plot">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="figureXlabel">
<string>X (mm)</string>
</property>
<property name="figureYlabel">
<string>X' (mrad)</string>
</property>
<property name="figureTitle">
<string/>
</property>
<property name="figureXYlabelFont">
<font>
<family>sans-serif</family>
<pointsize>14</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="figureTitleFont">
<font>
<family>sans-serif</family>
<pointsize>16</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="figureXYticksFont">
<font>
<family>sans-serif</family>
<pointsize>12</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="figureToolbarToggle" stdset="0">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
<widget class="MatplotlibBaseWidget" name="x_ellipse_plot">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="figureXlabel">
<string>X (mm)</string>
</property>
<property name="figureYlabel">
<string>X' (mrad)</string>
</property>
<property name="figureTitle">
<string/>
</property>
<property name="figureXYlabelFont">
<font>
<family>sans-serif</family>
<pointsize>14</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="figureTitleFont">
<font>
<family>sans-serif</family>
<pointsize>16</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="figureXYticksFont">
<font>
<family>sans-serif</family>
<pointsize>12</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="figureToolbarToggle" stdset="0">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="MatplotlibBaseWidget" name="y_ellipse_plot">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="figureXlabel">
<string>Y (mm)</string>
</property>
<property name="figureYlabel">
<string>Y' (mrad)</string>
</property>
<property name="figureXYlabelFont">
<font>
<family>sans-serif</family>
<pointsize>14</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="figureTitleFont">
<font>
<family>sans-serif</family>
<pointsize>16</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="figureXYticksFont">
<font>
<family>sans-serif</family>
<pointsize>12</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="figureToolbarToggle" stdset="0">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
<widget class="MatplotlibBaseWidget" name="y_ellipse_plot">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="figureXlabel">
<string>Y (mm)</string>
</property>
<property name="figureYlabel">
<string>Y' (mrad)</string>
</property>
<property name="figureXYlabelFont">
<font>
<family>sans-serif</family>
<pointsize>14</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="figureTitleFont">
<font>
<family>sans-serif</family>
<pointsize>16</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="figureXYticksFont">
<font>
<family>sans-serif</family>
<pointsize>12</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="figureToolbarToggle" stdset="0">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
......@@ -256,6 +227,106 @@
</widget>
</widget>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Select quadrupole</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="quad1_name_cbb">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Monospace</family>
</font>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="quad_info_btn">
<property name="toolTip">
<string>Click to see the details of selected device.</string>
</property>
<property name="text">
<string>info</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icons/info.png</normaloff>:/icons/info.png</iconset>
</property>
<property name="iconSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Gradient Setting</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="quad1_grad_dsbox">
<property name="suffix">
<string> T/m</string>
</property>
<property name="decimals">
<number>3</number>
</property>
<property name="minimum">
<double>-100.000000000000000</double>