Initial Round of Sandbox implementation
This commit is contained in:
@@ -1,158 +0,0 @@
|
||||
#!/opt/gfa/python-3.5/latest/bin/python
|
||||
|
||||
import sys
|
||||
import datetime
|
||||
import os.path
|
||||
import time
|
||||
from os import walk
|
||||
import numpy as np
|
||||
import sys
|
||||
import re
|
||||
|
||||
|
||||
from matplotlib.figure import Figure
|
||||
import matplotlib.patches as patches
|
||||
|
||||
from matplotlib.backends.backend_qt5agg import (
|
||||
FigureCanvasQTAgg as FigureCanvas,
|
||||
NavigationToolbar2QT as NavigationToolbar)
|
||||
|
||||
|
||||
|
||||
|
||||
class OpticsPlotting:
|
||||
|
||||
def initmpl(self,mplvl,mplwindow):
|
||||
self.fig=Figure()
|
||||
self.axes=self.fig.add_subplot(111)
|
||||
self.axes2 = self.axes.twinx()
|
||||
self.canvas = FigureCanvas(self.fig)
|
||||
mplvl.addWidget(self.canvas)
|
||||
self.canvas.draw()
|
||||
self.toolbar=NavigationToolbar(self.canvas,mplwindow, coordinates=True)
|
||||
mplvl.addWidget(self.toolbar)
|
||||
|
||||
|
||||
def plotSingle(self,x,y,color,legend,dashed=False):
|
||||
|
||||
if dashed:
|
||||
self.axes.plot(x,y,'--',color=color,label=legend)
|
||||
else:
|
||||
self.axes.plot(x,y,color=color,label=legend)
|
||||
|
||||
|
||||
|
||||
|
||||
def plot(self,data,filt,z0,z1):
|
||||
|
||||
self.axes.clear()
|
||||
self.axes2.clear()
|
||||
|
||||
s=np.array(data['S'])
|
||||
if z0>z1:
|
||||
tmp=z1
|
||||
z1=z0
|
||||
z0=tmp
|
||||
|
||||
i1=np.argmin(np.abs(s-z0))
|
||||
i2=np.argmin(np.abs(s-z1))
|
||||
|
||||
ylabel=r''
|
||||
if filt['BETX']:
|
||||
self.plotSingle(s[i1:i2],data['BETX'][i1:i2],(0,0,1,1),r'$\beta_{x}$')
|
||||
ylabel=ylabel+r'$\beta_x$ (m), '
|
||||
if filt['BETY']:
|
||||
self.plotSingle(s[i1:i2],data['BETY'][i1:i2],(1,0,0,1),r'$\beta_{y}$')
|
||||
ylabel=ylabel+r'$\beta_y$ (m), '
|
||||
if filt['ALFX']:
|
||||
self.plotSingle(s[i1:i2],data['ALFX'][i1:i2],(0,0,1,1),r'$\alpha_{x}$')
|
||||
ylabel=ylabel+r'$\alpha_x$ (rad), '
|
||||
if filt['ALFY']:
|
||||
self.plotSingle(s[i1:i2],data['ALFY'][i1:i2],(1,0,0,1),r'$\alpha_{y}$')
|
||||
ylabel=ylabel+r'$\alpha_y$ (rad), '
|
||||
if filt['DX']:
|
||||
self.plotSingle(s[i1:i2],data['DX'][i1:i2],(0,0,1,1),r'$\eta_{x}$')
|
||||
ylabel=ylabel+r'$\eta_x$ (m), '
|
||||
if filt['DY']:
|
||||
self.plotSingle(s[i1:i2],data['DY'][i1:i2],(1,0,0,1),r'$\eta_{y}$')
|
||||
ylabel=ylabel+r'$\eta_y$ (m), '
|
||||
if filt['RE56']:
|
||||
self.plotSingle(s[i1:i2],data['RE56'][i1:i2],(0,0,0,1),r'$R_{56}$')
|
||||
ylabel=ylabel+r'$R_{56}$ (m), '
|
||||
if filt['Energy']:
|
||||
self.plotSingle(s[i1:i2],data['Energy'][i1:i2],(0,1,0,1),r'$E$')
|
||||
ylabel=ylabel+r'$E$ (MeV), '
|
||||
|
||||
|
||||
if len(ylabel) < 3:
|
||||
self.canvas.draw()
|
||||
return
|
||||
|
||||
self.axes.legend(bbox_to_anchor=(0.15,0.85))
|
||||
self.axes.set_xlabel('s (m)')
|
||||
self.axes.set_ylabel(ylabel[0:-2])
|
||||
|
||||
self.plotLayout(s,data['NAME'])
|
||||
self.axes.set_xlim([s[i1],s[i2]])
|
||||
ylim=self.axes.get_ylim()
|
||||
dl=np.abs(ylim[1]-ylim[0])
|
||||
yl=[ylim[0],ylim[1]+0.2*dl]
|
||||
self.axes.set_ylim(yl)
|
||||
self.axes2.set_xlim([s[i1],s[i2]])
|
||||
self.canvas.draw()
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
||||
def plotLayout(self,s,elements):
|
||||
splitquads=False
|
||||
sstart=0
|
||||
|
||||
s1=[np.min(s),np.max(s)]
|
||||
s2=[0.9,0.9]
|
||||
self.axes2.plot(s1,s2,'k')
|
||||
for i,name in enumerate(elements):
|
||||
if 'MBND' in name:
|
||||
s1=s[i-1]
|
||||
s2=s[i]
|
||||
self.axes2.add_patch(patches.Rectangle((s1, 0.9), (s2-s1),0.03,facecolor='blue',edgecolor="none"))
|
||||
if 'MSEX' in name:
|
||||
s1=s[i-1]
|
||||
s2=s[i]
|
||||
self.axes2.add_patch(patches.Rectangle((s1, 0.87), (s2-s1),0.06,facecolor='green',edgecolor="none"))
|
||||
|
||||
if 'UIND' in name:
|
||||
s1=s[i-1]
|
||||
s2=s[i]
|
||||
self.axes2.add_patch(patches.Rectangle((s1, 0.88), (s2-s1),0.04,facecolor='purple',edgecolor="none"))
|
||||
|
||||
if 'ACC' in name or 'TDS' in name:
|
||||
s1=s[i-1]
|
||||
s2=s[i]
|
||||
self.axes2.add_patch(patches.Rectangle((s1, 0.89), (s2-s1),0.02,facecolor='cyan',edgecolor="none"))
|
||||
|
||||
if 'MQUA' in name:
|
||||
if splitquads == True:
|
||||
if 'END' in name:
|
||||
s1=sstart
|
||||
s2=s[i]
|
||||
self.axes2.add_patch(patches.Rectangle((s1, 0.85), (s2-s1),0.1,facecolor='red',edgecolor="none"))
|
||||
splitquads=False
|
||||
else:
|
||||
if 'START' in name:
|
||||
splitquads=True
|
||||
sstart=s[i]
|
||||
else:
|
||||
s1=s[i-1]
|
||||
s2=s[i]
|
||||
self.axes2.add_patch(patches.Rectangle((s1, 0.85), (s2-s1),0.1,facecolor='red',edgecolor="none"))
|
||||
|
||||
self.axes2.set_ylim([0,1])
|
||||
self.axes2.yaxis.set_visible(False)
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
#
|
||||
@@ -6,9 +6,9 @@ import time
|
||||
from PyQt5 import QtWidgets,QtGui
|
||||
|
||||
from ui.OpticsToolsGui import Ui_OpticsGUI
|
||||
from OpticsPlot import OpticsPlot
|
||||
from OpticsModel import Model
|
||||
from OpticsMachine import Machine
|
||||
from plot import OpticsPlot
|
||||
from model import Model
|
||||
from machine import Machine
|
||||
from reference import ReferenceManager
|
||||
from sandbox import Sandbox
|
||||
|
||||
@@ -20,9 +20,8 @@ class OpticsTools(QtWidgets.QMainWindow, Ui_OpticsGUI):
|
||||
|
||||
self.version = '1.0.1'
|
||||
self.setWindowIcon(QtGui.QIcon("rsc/iconoptics.png"))
|
||||
self.setWindowTitle("SwissFEL Optics Tools")
|
||||
|
||||
self.plot = OpticsPlot()
|
||||
self.plot = OpticsPlot(parent=self)
|
||||
self.plot.show()
|
||||
|
||||
# initialize online model
|
||||
@@ -31,12 +30,14 @@ class OpticsTools(QtWidgets.QMainWindow, Ui_OpticsGUI):
|
||||
office = True
|
||||
self.machine = Machine(parent = True, office = office)
|
||||
self.machine.initPVs(self.model.getElements())
|
||||
|
||||
|
||||
|
||||
self.reference = ReferenceManager(parent = self)
|
||||
self.sandbox = Sandbox(parent = self, machine = self.machine)
|
||||
|
||||
title = "SwissFEL Optics Tools - Lattice %s (Phase %d)" % (self.model.getLatticeVersion(),phase)
|
||||
if office:
|
||||
title += " - offline"
|
||||
self.setWindowTitle(title)
|
||||
|
||||
# initialization
|
||||
self.loadSettingsdirect("/sf/data/applications/BD-OpticsTools/reference/settings/ReferenceSetting.json")
|
||||
self.sandbox.updateSandbox()
|
||||
|
||||
99244
SwissFELRef.json
99244
SwissFELRef.json
File diff suppressed because it is too large
Load Diff
@@ -15,7 +15,7 @@ class Machine:
|
||||
self.PVNames.clear()
|
||||
for ele0 in elements:
|
||||
ele = ele0.Name.replace('.','-').upper()
|
||||
if 'MQUA' in ele:
|
||||
if 'MQUA' in ele or 'MQSK' in ele:
|
||||
self.PVNames += [ele+':K1L-SET']
|
||||
if 'MSEX' in ele:
|
||||
self.PVNames += [ele+':K2L-SET']
|
||||
@@ -54,7 +54,7 @@ class Machine:
|
||||
und={}
|
||||
energy={}
|
||||
for key in self.PVs.keys():
|
||||
if 'MQUA' in key or 'MSEX' in key:
|
||||
if 'MQUA' in key or 'MQSK' in key or 'MSEX' in key:
|
||||
magnets[key[0:15]]=values[key]
|
||||
if 'MBND' in key:
|
||||
if 'SINBC' in key or 'SINLH' in key or 'S10BC' in key or 'SATMA' in key or 'SATUN' in key:
|
||||
@@ -16,15 +16,20 @@ class Model:
|
||||
# hook up events
|
||||
self.eventHandling()
|
||||
|
||||
def getLatticeVersion(self):
|
||||
return self.om.Version
|
||||
|
||||
def updateEnergy(self,E0):
|
||||
self.om.forceEnergyAt('SINLH02.MBND100', E0*1e6)
|
||||
|
||||
def updateElement(self,name,val):
|
||||
|
||||
if 'MQUA' in name:
|
||||
self.om.setRegExpElement(name[0:7], name[8:15], 'k1', float(val[0]))
|
||||
if 'MQUA' in name or 'MQSK' in name:
|
||||
L = self.om.getRegExpElement(name[0:7], name[8:15],'Length')[0]
|
||||
self.om.setRegExpElement(name[0:7], name[8:15], 'k1', float(val[0])/L)
|
||||
if 'MSEX' in name:
|
||||
self.om.setRegExpElement(name[0:7], name[8:15], 'k2', float(val[0]))
|
||||
L = self.om.getRegExpElement(name[0:7], name[8:15], 'Length')[0]
|
||||
self.om.setRegExpElement(name[0:7], name[8:15], 'k2', float(val[0])/L)
|
||||
if 'MBND' in name:
|
||||
self.om.setRegExpElement(name[0:7], 'MBND', 'angle', float(val[0]))
|
||||
if 'UMOD' in name:
|
||||
@@ -49,7 +54,8 @@ class Model:
|
||||
grad = grad/ 4.
|
||||
elif 'XB' in name[0:7] or 'SINSB03' in name or 'SINSB04' in name:
|
||||
grad = grad/2
|
||||
self.om.setRegExpElement(name[0:7], 'RACC', 'Gradient', grad)
|
||||
L = self.om.getRegExpElement(name[0:7], 'RACC', 'Length')[0]
|
||||
self.om.setRegExpElement(name[0:7], 'RACC', 'Gradient', grad/L)
|
||||
self.om.setRegExpElement(name[0:7], 'RACC', 'Phase', phase)
|
||||
|
||||
|
||||
@@ -67,7 +73,7 @@ class Model:
|
||||
loc = 'SINLH02.MBND100'
|
||||
energy={'location': loc, 'energy':self.om.EnergyAt(loc)[0]}
|
||||
for ele in elements:
|
||||
if 'MQUA' in ele.Name:
|
||||
if 'MQUA' in ele.Name or 'MQSK' in ele.Name:
|
||||
quadrupoles[ele.Name]={'k1':ele.k1,'k1L':ele.k1*ele.Length}
|
||||
elif 'MSEX' in ele.Name:
|
||||
sextupoles[ele.Name]={'k2':ele.k2,'k2L':ele.k2*ele.Length}
|
||||
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
|
||||
import copy
|
||||
from PyQt5 import QtWidgets,QtGui
|
||||
|
||||
|
||||
@@ -12,15 +12,15 @@ from matplotlib.backends.backend_qt5agg import (
|
||||
|
||||
from ui.OpticsPlotGui import Ui_OpticsPlotGUI
|
||||
import numpy as np
|
||||
|
||||
import h5py
|
||||
|
||||
|
||||
|
||||
class OpticsPlot(QtWidgets.QMainWindow, Ui_OpticsPlotGUI):
|
||||
def __init__(self,phase=0):
|
||||
def __init__(self,parent=None):
|
||||
super(OpticsPlot, self).__init__()
|
||||
self.setupUi(self)
|
||||
|
||||
self.parent=parent
|
||||
self.version = '1.0.1'
|
||||
self.setWindowIcon(QtGui.QIcon("rsc/iconoptics.png"))
|
||||
self.setWindowTitle("SwissFEL Optics Plotting Window")
|
||||
@@ -28,6 +28,7 @@ class OpticsPlot(QtWidgets.QMainWindow, Ui_OpticsPlotGUI):
|
||||
self.initmpl(self.mplvl, self.mplwindow)
|
||||
|
||||
self.twiss=None
|
||||
self.twissref = None
|
||||
self.energy=None
|
||||
|
||||
# all action for optics plotting
|
||||
@@ -42,6 +43,59 @@ class OpticsPlot(QtWidgets.QMainWindow, Ui_OpticsPlotGUI):
|
||||
self.PStart.editingFinished.connect(self.doplot)
|
||||
self.PEnd.editingFinished.connect(self.doplot)
|
||||
|
||||
self.UIPlotExportOptics.clicked.connect(self.exportOptics)
|
||||
self.UIPLotNewReference.clicked.connect(self.saveReference)
|
||||
self.UIPlotSaveReference.clicked.connect(self.newReference)
|
||||
self.UIPlotClearReference.clicked.connect(self.clearReference)
|
||||
|
||||
def saveReference(self):
|
||||
irow = self.UITwissValues.currentRow()
|
||||
if irow < 0:
|
||||
return
|
||||
twiss={}
|
||||
col = ['betax', 'betay', 'alphax', 'alphay', 'etax', 'etay']
|
||||
for i, col in enumerate(col):
|
||||
twiss[col] = float(str(self.UITwissValues.item(irow,i+2).text()))
|
||||
location = str(self.UITwissValues.item(irow,0).text())
|
||||
self.parent.reference.swithToUserDefinedLocation()
|
||||
self.parent.reference.updateReferenceLocation(location)
|
||||
self.parent.reference.updateReferencePoint(twiss)
|
||||
|
||||
|
||||
def exportOptics(self):
|
||||
|
||||
options = QtWidgets.QFileDialog.Options()
|
||||
options |= QtWidgets.QFileDialog.DontUseNativeDialog
|
||||
fileName, _ = QtWidgets.QFileDialog.getSaveFileName(self, "Save Optics","optics.h5","HDF5 Files (*.h5)", options=options)
|
||||
if not fileName:
|
||||
return
|
||||
data={}
|
||||
data['s']=np.array(self.twiss.s)
|
||||
data['betax']=np.array(self.twiss.betx)
|
||||
data['betay'] = np.array(self.twiss.bety)
|
||||
data['alphax'] = np.array(self.twiss.alfx)
|
||||
data['alphay'] = np.array(self.twiss.alfy)
|
||||
data['etax'] = np.array(self.twiss.dx)
|
||||
data['etay'] = np.array(self.twiss.dy)
|
||||
data['r56'] = np.array(self.twiss.re56)
|
||||
data['x'] = np.array(self.twiss.x)
|
||||
data['y'] = np.array(self.twiss.y)
|
||||
data['energy'] = np.array(self.energy)
|
||||
# data['names'] = np.array(self.twiss.name
|
||||
with h5py.File(fileName, 'w') as f:
|
||||
for keys in data.keys():
|
||||
f.create_dataset(keys, data=data[keys])
|
||||
|
||||
|
||||
|
||||
def clearReference(self):
|
||||
self.twissref=None
|
||||
self.energyref=None
|
||||
self.doplot()
|
||||
|
||||
def newReference(self):
|
||||
self.twissref=copy.deepcopy(self.twiss)
|
||||
self.energyref=copy.deepcopy(self.energy)
|
||||
|
||||
def newData(self,twiss,energy):
|
||||
self.twiss=twiss
|
||||
@@ -134,6 +188,32 @@ class OpticsPlot(QtWidgets.QMainWindow, Ui_OpticsPlotGUI):
|
||||
self.canvas.draw()
|
||||
return
|
||||
|
||||
if not self.twissref is None:
|
||||
if filt['BETX']:
|
||||
self.plotSingle(s[i1:i2], self.twissref.betx[i1:i2], (0, 0, 1, 1), r'$\beta_{x}$',dashed=True)
|
||||
ylabel = ylabel + r'$\beta_x$ (m), '
|
||||
if filt['BETY']:
|
||||
self.plotSingle(s[i1:i2], self.twissref.bety[i1:i2], (1, 0, 0, 1), r'$\beta_{y}$',dashed=True)
|
||||
ylabel = ylabel + r'$\beta_y$ (m), '
|
||||
if filt['ALFX']:
|
||||
self.plotSingle(s[i1:i2], self.twissref.alfx[i1:i2], (0, 0, 1, 1), r'$\alpha_{x}$',dashed=True)
|
||||
ylabel = ylabel + r'$\alpha_x$ (rad), '
|
||||
if filt['ALFY']:
|
||||
self.plotSingle(s[i1:i2], self.twissref.alfy[i1:i2], (1, 0, 0, 1), r'$\alpha_{y}$',dashed=True)
|
||||
ylabel = ylabel + r'$\alpha_y$ (rad), '
|
||||
if filt['DX']:
|
||||
self.plotSingle(s[i1:i2], self.twissref.dx[i1:i2], (0, 0, 1, 1), r'$\eta_{x}$',dashed=True)
|
||||
ylabel = ylabel + r'$\eta_x$ (m), '
|
||||
if filt['DY']:
|
||||
self.plotSingle(s[i1:i2], self.twissref.dy[i1:i2], (1, 0, 0, 1), r'$\eta_{y}$',dashed=True)
|
||||
ylabel = ylabel + r'$\eta_y$ (m), '
|
||||
if filt['RE56']:
|
||||
self.plotSingle(s[i1:i2], self.twissref.re56[i1:i2], (0, 0, 0, 1), r'$R_{56}$',dashed=True)
|
||||
ylabel = ylabel + r'$R_{56}$ (m), '
|
||||
if filt['Energy']:
|
||||
self.plotSingle(s[i1:i2], self.energyref[i1:i2], (0, 1, 0, 1), r'$E$',dashed=True)
|
||||
ylabel = ylabel + r'$E$ (MeV), '
|
||||
|
||||
self.axes.legend(bbox_to_anchor=(0.15, 0.85))
|
||||
self.axes.set_xlabel('s (m)')
|
||||
self.axes.set_ylabel(ylabel[0:-2])
|
||||
@@ -21,6 +21,12 @@ class ReferenceManager:
|
||||
|
||||
|
||||
#### all event selecting some tracking points
|
||||
def swithToUserDefinedLocation(self):
|
||||
n = self.parent.UITrackReference.count()
|
||||
self.parent.UITrackReference.setCurrentIndex(n-1)
|
||||
|
||||
def updateReferenceLocation(self,location):
|
||||
self.parent.UITrackLocation.setText(location)
|
||||
|
||||
def updateReferencePoint(self,twiss):
|
||||
for key in self.twisswidget.keys():
|
||||
@@ -47,7 +53,7 @@ class ReferenceManager:
|
||||
return
|
||||
twiss = self.reference['Reference'][key]['twiss']
|
||||
name = self.reference['Reference'][key]['location']
|
||||
self.parent.UITrackLocation.setText(name)
|
||||
self.updateReferenceLocation(name)
|
||||
self.updateReferencePoint(twiss)
|
||||
|
||||
def updateReferenceComboBox(self):
|
||||
|
||||
@@ -187,6 +187,8 @@ class Sandbox:
|
||||
mokey = key.replace('-','.')
|
||||
if 'MQUA' in key and mokey in magnets['Quadrupole'].keys():
|
||||
moval = magnets['Quadrupole'][mokey]['k1L']
|
||||
if 'MQSK' in key and mokey in magnets['Quadrupole'].keys():
|
||||
moval = magnets['Quadrupole'][mokey]['k1L']
|
||||
if 'MSEX' in key and mokey in magnets['Sextupole'].keys():
|
||||
moval = magnets['Sextupole'][mokey]['k2L']
|
||||
if 'MBND' in key and mokey in magnets['Dipole'].keys():
|
||||
|
||||
@@ -17,8 +17,8 @@ class Ui_OpticsPlotGUI(object):
|
||||
OpticsPlotGUI.resize(1605, 1023)
|
||||
self.centralwidget = QtWidgets.QWidget(OpticsPlotGUI)
|
||||
self.centralwidget.setObjectName("centralwidget")
|
||||
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.centralwidget)
|
||||
self.verticalLayout_4.setObjectName("verticalLayout_4")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.centralwidget)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.TabMaster = QtWidgets.QTabWidget(self.centralwidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
@@ -102,15 +102,15 @@ class Ui_OpticsPlotGUI(object):
|
||||
self.verticalLayout_5.addLayout(self.gridLayout_5)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 175, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.verticalLayout_5.addItem(spacerItem)
|
||||
self.pushButton = QtWidgets.QPushButton(self.widget_2)
|
||||
self.pushButton.setObjectName("pushButton")
|
||||
self.verticalLayout_5.addWidget(self.pushButton)
|
||||
self.pushButton_2 = QtWidgets.QPushButton(self.widget_2)
|
||||
self.pushButton_2.setObjectName("pushButton_2")
|
||||
self.verticalLayout_5.addWidget(self.pushButton_2)
|
||||
self.pushButton_3 = QtWidgets.QPushButton(self.widget_2)
|
||||
self.pushButton_3.setObjectName("pushButton_3")
|
||||
self.verticalLayout_5.addWidget(self.pushButton_3)
|
||||
self.UIPlotSaveReference = QtWidgets.QPushButton(self.widget_2)
|
||||
self.UIPlotSaveReference.setObjectName("UIPlotSaveReference")
|
||||
self.verticalLayout_5.addWidget(self.UIPlotSaveReference)
|
||||
self.UIPlotClearReference = QtWidgets.QPushButton(self.widget_2)
|
||||
self.UIPlotClearReference.setObjectName("UIPlotClearReference")
|
||||
self.verticalLayout_5.addWidget(self.UIPlotClearReference)
|
||||
self.UIPlotExportOptics = QtWidgets.QPushButton(self.widget_2)
|
||||
self.UIPlotExportOptics.setObjectName("UIPlotExportOptics")
|
||||
self.verticalLayout_5.addWidget(self.UIPlotExportOptics)
|
||||
self.horizontalLayout.addWidget(self.widget_2)
|
||||
self.mplwindow = QtWidgets.QWidget(self.tab_3)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding)
|
||||
@@ -126,8 +126,8 @@ class Ui_OpticsPlotGUI(object):
|
||||
self.TabMaster.addTab(self.tab_3, "")
|
||||
self.tab_4 = QtWidgets.QWidget()
|
||||
self.tab_4.setObjectName("tab_4")
|
||||
self.verticalLayout_13 = QtWidgets.QVBoxLayout(self.tab_4)
|
||||
self.verticalLayout_13.setObjectName("verticalLayout_13")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.tab_4)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.verticalLayout_12 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_12.setObjectName("verticalLayout_12")
|
||||
self.UITwissValues = QtWidgets.QTableWidget(self.tab_4)
|
||||
@@ -140,9 +140,17 @@ class Ui_OpticsPlotGUI(object):
|
||||
self.UITwissValues.setColumnCount(0)
|
||||
self.UITwissValues.setRowCount(0)
|
||||
self.verticalLayout_12.addWidget(self.UITwissValues)
|
||||
self.verticalLayout_13.addLayout(self.verticalLayout_12)
|
||||
self.verticalLayout.addLayout(self.verticalLayout_12)
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.UIPLotNewReference = QtWidgets.QPushButton(self.tab_4)
|
||||
self.UIPLotNewReference.setObjectName("UIPLotNewReference")
|
||||
self.horizontalLayout_2.addWidget(self.UIPLotNewReference)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout_2.addItem(spacerItem1)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_2)
|
||||
self.TabMaster.addTab(self.tab_4, "")
|
||||
self.verticalLayout_4.addWidget(self.TabMaster)
|
||||
self.verticalLayout_2.addWidget(self.TabMaster)
|
||||
OpticsPlotGUI.setCentralWidget(self.centralwidget)
|
||||
self.menubar = QtWidgets.QMenuBar(OpticsPlotGUI)
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 1605, 22))
|
||||
@@ -277,10 +285,11 @@ class Ui_OpticsPlotGUI(object):
|
||||
self.PStart.setText(_translate("OpticsPlotGUI", "0"))
|
||||
self.label_21.setText(_translate("OpticsPlotGUI", "Plot End"))
|
||||
self.PEnd.setText(_translate("OpticsPlotGUI", "1000"))
|
||||
self.pushButton.setText(_translate("OpticsPlotGUI", "Save Current Optics as Reference"))
|
||||
self.pushButton_2.setText(_translate("OpticsPlotGUI", "Export Optics"))
|
||||
self.pushButton_3.setText(_translate("OpticsPlotGUI", "Copy Entry as New Reference Point"))
|
||||
self.UIPlotSaveReference.setText(_translate("OpticsPlotGUI", "Save Current Optics as Reference"))
|
||||
self.UIPlotClearReference.setText(_translate("OpticsPlotGUI", "Clear Reference"))
|
||||
self.UIPlotExportOptics.setText(_translate("OpticsPlotGUI", "Export Optics"))
|
||||
self.TabMaster.setTabText(self.TabMaster.indexOf(self.tab_3), _translate("OpticsPlotGUI", "Plot"))
|
||||
self.UIPLotNewReference.setText(_translate("OpticsPlotGUI", "Copy Entry as New Reference Point"))
|
||||
self.TabMaster.setTabText(self.TabMaster.indexOf(self.tab_4), _translate("OpticsPlotGUI", "Values"))
|
||||
self.actionNew.setText(_translate("OpticsPlotGUI", "New Model"))
|
||||
self.actionNew.setShortcut(_translate("OpticsPlotGUI", "Ctrl+N"))
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<string>SwissFEL Optics</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QTabWidget" name="TabMaster">
|
||||
<property name="sizePolicy">
|
||||
@@ -192,23 +192,23 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<widget class="QPushButton" name="UIPlotSaveReference">
|
||||
<property name="text">
|
||||
<string>Save Current Optics as Reference</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<widget class="QPushButton" name="UIPlotClearReference">
|
||||
<property name="text">
|
||||
<string>Export Optics</string>
|
||||
<string>Clear Reference</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_3">
|
||||
<widget class="QPushButton" name="UIPlotExportOptics">
|
||||
<property name="text">
|
||||
<string>Copy Entry as New Reference Point</string>
|
||||
<string>Export Optics</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -238,7 +238,7 @@
|
||||
<attribute name="title">
|
||||
<string>Values</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_13">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_12">
|
||||
<item>
|
||||
@@ -253,6 +253,30 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QPushButton" name="UIPLotNewReference">
|
||||
<property name="text">
|
||||
<string>Copy Entry as New Reference Point</string>
|
||||
</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>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
@@ -34,7 +34,25 @@ class Ui_OpticsGUI(object):
|
||||
self.widget_2.setObjectName("widget_2")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.widget_2)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.UISettingState = QtWidgets.QComboBox(self.widget_2)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(12)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.UISettingState.setFont(font)
|
||||
self.UISettingState.setObjectName("UISettingState")
|
||||
self.UISettingState.addItem("")
|
||||
self.UISettingState.addItem("")
|
||||
self.UISettingState.addItem("")
|
||||
self.UISettingState.addItem("")
|
||||
self.verticalLayout.addWidget(self.UISettingState)
|
||||
self.UITrack = QtWidgets.QPushButton(self.widget_2)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(12)
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.UITrack.setFont(font)
|
||||
self.UITrack.setStyleSheet("background-color: rgb(255, 255, 127);")
|
||||
self.UITrack.setObjectName("UITrack")
|
||||
self.verticalLayout.addWidget(self.UITrack)
|
||||
self.gridLayout_4 = QtWidgets.QGridLayout()
|
||||
@@ -457,13 +475,18 @@ class Ui_OpticsGUI(object):
|
||||
self.menubar.addAction(self.menuHelp.menuAction())
|
||||
|
||||
self.retranslateUi(OpticsGUI)
|
||||
self.TabMaster.setCurrentIndex(1)
|
||||
self.TabMaster.setCurrentIndex(0)
|
||||
self.UISettingState.setCurrentIndex(1)
|
||||
self.actionQuit.triggered.connect(OpticsGUI.close) # type: ignore
|
||||
QtCore.QMetaObject.connectSlotsByName(OpticsGUI)
|
||||
|
||||
def retranslateUi(self, OpticsGUI):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
OpticsGUI.setWindowTitle(_translate("OpticsGUI", "SwissFEL Optics"))
|
||||
self.UISettingState.setItemText(0, _translate("OpticsGUI", "Machine"))
|
||||
self.UISettingState.setItemText(1, _translate("OpticsGUI", "Reference"))
|
||||
self.UISettingState.setItemText(2, _translate("OpticsGUI", "User Settings"))
|
||||
self.UISettingState.setItemText(3, _translate("OpticsGUI", "Sandbox"))
|
||||
self.UITrack.setText(_translate("OpticsGUI", "Track"))
|
||||
self.UITrackStart.setText(_translate("OpticsGUI", "SINLH01"))
|
||||
self.label_2.setText(_translate("OpticsGUI", "End-Section"))
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_3">
|
||||
<attribute name="title">
|
||||
@@ -34,8 +34,52 @@
|
||||
<item>
|
||||
<widget class="QWidget" name="widget_2" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QComboBox" name="UISettingState">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Machine</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Reference</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>User Settings</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Sandbox</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="UITrack">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(255, 255, 127);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Track</string>
|
||||
</property>
|
||||
|
||||
Reference in New Issue
Block a user