From 171b19280ae3dfba5c2d1f9ecc3415dadba770e2 Mon Sep 17 00:00:00 2001 From: reiche Date: Thu, 8 May 2025 17:56:34 +0200 Subject: [PATCH] Some further debugging and some nice optics --- matchingmanager.py | 14 +++++++------- plot.py | 4 +++- sandbox.py | 2 +- ui/OpticsToolsGui.ui | 15 ++++++++++++++- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/matchingmanager.py b/matchingmanager.py index 6772a7e..9c638ae 100644 --- a/matchingmanager.py +++ b/matchingmanager.py @@ -58,12 +58,12 @@ class MatchManager: return self.FODO[reference] def defineFODO(self): - self.FODO.clear() - self.FODO['Injector']={'Sequence':'SINSB04','Destination': 'SARBD01', - 'Quads':['sinsb04.mqua130.k1','sinsb04.mqua230.k1'], - 'Init':[0.722,-0.7156],'FlipPol':False,'mu':0.2,'Result':None,'Twiss':None} + Periodic={} + Periodic['Injector']={'Sequence':'SINSB04','Destination': 'SARBD01', + 'Quads':['sinsb04.mqua130.k1','sinsb04.mqua230.k1'], + 'Init':[0.722,-0.7156],'FlipPol':False,'mu':0.2,'Matched':False, 'Twiss':None} - self.FODO['Linac 1']={'Sequence':'S10CB01','Destination': 'SARBD01', - 'Quads':['s10cb01.mqua230.k1','s10cb01.mqua430.k1'], - 'Init':[-1.491,1.4905],'FlipPol':False,'mu':0.1883,'Result':None,'Twiss':None} + Periodic['Linac 1']={'Sequence':'S10CB01','Destination': 'SARBD01', + 'Quads':['s10cb01.mqua230.k1','s10cb01.mqua430.k1'], + 'Init':[-1.491,1.4905],'FlipPol':False,'mu':0.1883,'Result':None,'Twiss':None} diff --git a/plot.py b/plot.py index 1370555..015b797 100644 --- a/plot.py +++ b/plot.py @@ -38,6 +38,8 @@ class OpticsPlot(QtWidgets.QMainWindow, Ui_OpticsPlotGUI): self.PAlphay.toggled.connect(self.doplot) self.PEtax.toggled.connect(self.doplot) self.PEtay.toggled.connect(self.doplot) + self.PMux.toggled.connect(self.doplot) + self.PMuy.toggled.connect(self.doplot) self.PR56.toggled.connect(self.doplot) self.PEnergy.toggled.connect(self.doplot) self.PStart.editingFinished.connect(self.doplot) @@ -96,7 +98,7 @@ class OpticsPlot(QtWidgets.QMainWindow, Ui_OpticsPlotGUI): self.doplot() def newReference(self): - self.twissref=copy.deepcopy(self.twiss) + self.twissref=self.twiss self.energyref=copy.deepcopy(self.energy) def newData(self,twiss,energy): diff --git a/sandbox.py b/sandbox.py index bb06ce9..0aaf622 100644 --- a/sandbox.py +++ b/sandbox.py @@ -56,7 +56,7 @@ class Sandbox: self.updateEnergySandbox(model['Energy'],machine['Energy']) def updateEnergySandbox(self,model,machine): - E0=1.e-6*model['energy'] + E0=model['energy'] self.parent.SBE0Model.setText('%7.3f' % E0) E0 = None for key in machine.keys(): diff --git a/ui/OpticsToolsGui.ui b/ui/OpticsToolsGui.ui index d7c8579..b13f107 100644 --- a/ui/OpticsToolsGui.ui +++ b/ui/OpticsToolsGui.ui @@ -24,7 +24,7 @@ - 0 + 3 @@ -774,6 +774,19 @@ Relative Matching + + + + 10 + 10 + 301 + 241 + + + + GroupBox + +