Initial test of matching
This commit is contained in:
@@ -1,26 +1,32 @@
|
||||
import json
|
||||
|
||||
varypar={'min:':-1e-6,'max:':1e-6,'preset':0}
|
||||
|
||||
def MatchStep(ref,id,end, dest,sequence='SwissFEL',saveTwiss=None):
|
||||
def MatchStep(ref,id,end, dest,sequence=None,saveTwiss=None):
|
||||
match={'Reference':ref,'MatchID':id,'End':end, 'Destination':dest,'Sequence':sequence,'Save':saveTwiss}
|
||||
return match
|
||||
|
||||
def MatchParameter(var0,tar0):
|
||||
var={key: varypar for key in var0}
|
||||
tar= tar0
|
||||
return {'Variable':var,'Target':tar}
|
||||
|
||||
def MatchReference(loc,twiss):
|
||||
def MatchReference(loc,twiss,limit=None): # limit 1 -> smaller than, 2 -> larger than (default is euqal)
|
||||
match ={'Location': loc, 'Twiss': twiss}
|
||||
if not limit is None:
|
||||
match['Limit'] = limit
|
||||
return match
|
||||
|
||||
|
||||
def MatchParameter(var0,tar0):
|
||||
return {'Variable':var0,'Target':tar0}
|
||||
|
||||
path ="Settings/"
|
||||
label='Reference'
|
||||
|
||||
order = []
|
||||
# order of elements:
|
||||
# - Match starting point with Twiss, None has no initial condition and starts with #s
|
||||
# - ID to find additional parameteters
|
||||
# - Last section in tracking/matching. If none it tracks to the end (#e)
|
||||
# - destination: selection of branch by giving a unique section name (e.g. SARBD01 for Aramis)
|
||||
# - sequence: sequence to use. If it is a list of sequence then a temporary sequence is used. Default to swissfel
|
||||
# - flag to last twiss parameters, needed for other routines to refer to.
|
||||
|
||||
order.append(MatchStep('Start', 'Laser Heater','SINLH02','SATBD01'))
|
||||
order.append(MatchStep(None, 'SINSB04', None,'SATBD01','SINSB04',True))
|
||||
order.append(MatchStep('Laser Heater', 'Match to SINSB04','SINSB04','SATBD01'))
|
||||
@@ -31,49 +37,89 @@ order.append(MatchStep('Bunch Compressor 1', 'End of Linac 1','S10BC01','SATBD01
|
||||
order.append(MatchStep('Bunch Compressor 1', 'Bunch Compressor 2','S10MA01','SATBD01'))
|
||||
order.append(MatchStep(None, 'Linac 2', None,'SATBD01',['S20CB01','S20CB02'],True))
|
||||
order.append(MatchStep('Bunch Compressor 2', 'Match to Linac 2','S20CB04','SATBD01'))
|
||||
order.append(MatchStep(None, 'Resonant Kicker',None,'SATBD01','S20SY02'))
|
||||
order.append(MatchStep('Bunch Compressor 2', 'Match to Switchyard','S20SY02','SATBD01'))
|
||||
order.append(MatchStep('Switchyard', 'Resonant Kicker','S20SY02','SATBD01'))
|
||||
#order.append(MatchStep('Switchyard', 'Switchyard','SATSY03','SATBD01'))
|
||||
|
||||
# list of references with fixed twiss parameters
|
||||
reference={}
|
||||
reference['Start'] = MatchReference('start',{'betax':29.971,'alphax':0.003,'betay':26.00,'alphay':-0.288})
|
||||
reference['Laser Heater'] = MatchReference('sinlh02.mqua410$start',{'betax': 11.2, 'alphax': 3.2,'betay': 0.8, 'alphay': 0.75,})
|
||||
reference['Bunch Compressor 1'] = MatchReference('sindi02.mqua020$start',{'betax': 11.1557, 'alphax': -1.17,'betay': 50, 'alphay': 0.})
|
||||
reference['Bunch Compressor 2'] = MatchReference('s10ma01.mqua020$start',{'betax': 6.14, 'alphax': -0.83,'betay': 22.86, 'alphay': -1.18})
|
||||
reference['Switchyard'] = MatchReference('s20sy02$start',{'betax': 48.26, 'alphax': 7.322,'betay': 14.293, 'alphay': -3.513})
|
||||
reference['Linac3'] = MatchReference('s30cb10.mqua430$start',{'betax': 8.83,'alphax': 0.548,'betay': 30.44,'alphay': -1.866})
|
||||
reference['Aramis Stopper'] = MatchReference('sarma01.mqua010$start',{'betax': 2.304, 'alphax': -1.4045, 'betay': 25.929, 'alphay': -6.363})
|
||||
reference['Athos HERO'] = MatchReference('satdi01.mqua250$start',{'betax': 35.76, 'alphax': -1.166,'betay': 24.087, 'alphay': 0.648})
|
||||
reference['Athos Deflector'] = MatchReference('satbd01.mqua010$start',{'betax': 50, 'alphax': 0,'betay': 50, 'alphay': 0})
|
||||
|
||||
|
||||
|
||||
|
||||
parameter={}
|
||||
var = ['SINLH01-MQUA020', 'SINLH01-MQUA040','SINLH01-MQUA050','SINLH01-MQUA070','SINLH02-MQUA010']
|
||||
parameter['Laser Heater'] = MatchParameter(var,[{'Reference':'Laser Heater'}])
|
||||
tar = [reference['Laser Heater']]
|
||||
parameter['Laser Heater'] = MatchParameter(var,tar)
|
||||
|
||||
var = ['SINSB04-MQUA130','SINSB04-MQUA230']
|
||||
parameter['SINSB04'] = MatchParameter(var,[{'Fixed':{'Location':'#e','Twiss':{'MUX':0.2,'MUY':0.2}}}])
|
||||
tar =[MatchReference('#e',{'MUX':0.2,'MUY':0.2})]
|
||||
parameter['SINSB04'] = MatchParameter(var,tar)
|
||||
|
||||
var = ['SINLH02-MQUA410','SINLH03-MQUA030','SINLH03-MQUA040','SINLH03-MQUA060','SINLH03-MQUA080','SINSB03-MQUA130']
|
||||
parameter['Match to SINSB04']=MatchParameter(var,[{'Save':{'Location':'sinsb04$start','SaveID':'SINSB04'}}])
|
||||
tar =[{'Location':'sinsb04$start','SavedID':'SINSB04'}]
|
||||
parameter['Match to SINSB04']=MatchParameter(var,tar)
|
||||
|
||||
var = ['SINBC01-MQUA020','SINBC01-MQUA050','SINBC01-MQUA070','SINBC01-MQUA090','SINBC01-MQUA110','SINDI01-MQUA020','SINDI01-MQUA070']
|
||||
parameter['Bunch Compressor 1']=MatchParameter(var,[{'Reference':'Bunch Compressor 1'},
|
||||
{'Fixed':{'Location':'sinbc02.mbnd400','Limit':1,'Twiss':{'betax':5.1,'betay':100}}},
|
||||
{'Fixed':{'Location':'sinbc01.mqua110$end','Limit':1,'Twiss':{'betax':100}}}])
|
||||
tar =[reference['Bunch Compressor 1'],
|
||||
MatchReference('sinbc02.mbnd400',{'betax':5.1,'betay':100},1),
|
||||
MatchReference('sinbc01.mqua110$end',{'betax':100},1)]
|
||||
parameter['Bunch Compressor 1']=MatchParameter(var, tar)
|
||||
|
||||
var = ['S10CB02-MQUA230','S10CB02-MQUA430']
|
||||
parameter['Linac 1'] = MatchParameter(var,[{'Fixed':{'Location':'#e','Twiss':{'MUX':0.1883,'MUY':0.1883}}}])
|
||||
tar = [MatchReference('#e',{'MUX':0.1883,'MUY':0.1883})]
|
||||
parameter['Linac 1'] = MatchParameter(var, tar)
|
||||
|
||||
|
||||
var = ['S10CB01-MQUA230','S10CB01-MQUA430','SINDI02-MQUA020','SINDI02-MQUA030','SINDI02-MQUA050','SINDI02-MQUA060','SINDI02-MQUA090']
|
||||
parameter['Match to Linac 1']=MatchParameter(var,[{'Save':{'Location':'s10cb02$start','SaveID':'Linac 1'}}])
|
||||
tar =[{'Location':'s10cb02$start','SavedID':'Linac 1'}]
|
||||
parameter['Match to Linac 1']=MatchParameter(var,tar)
|
||||
|
||||
|
||||
var = ['S10CB07-MQUA430','S10CB08-MQUA230','S10CB08-MQUA430','S10CB09-MQUA230']
|
||||
parameter['End of Linac 1']=MatchParameter(var,[{'Fixed':{'Location':'s10bc01.mqua020$start','Twiss':{'betax':4.88,'betay':16.11,'alphax':0.5546,'alphay':-1.81}}}])
|
||||
tar = [MatchReference('s10bc01.mqua020$start',{'betax':4.88,'betay':16.11,'alphax':0.5546,'alphay':-1.81})]
|
||||
parameter['End of Linac 1']=MatchParameter(var, tar)
|
||||
|
||||
|
||||
var = ['S10BC01-MQUA020','S10BC01-MQUA040','S10BC01-MQUA060','S10BC01-MQUA080','S10BC01-MQUA100']
|
||||
parameter['Bunch Compressor 2']=MatchParameter(var,[{'Reference':'Bunch Compressor 2'}])
|
||||
tar = [reference['Bunch Compressor 2']]
|
||||
parameter['Bunch Compressor 2']=MatchParameter(var,tar)
|
||||
|
||||
var = ['S20CB01-MQUA430','S20CB02-MQUA430']
|
||||
tar = [MatchReference('#e', {'MUX': 0.2, 'MUY': 0.2})]
|
||||
parameter['Linac 2'] = MatchParameter(var, tar)
|
||||
|
||||
var = ['S20CB02-MQUA430','S20CB02-MQUA430']
|
||||
parameter['Linac 2'] = MatchParameter(var,[{'Fixed':{'Location':'#e','Twiss':{'MUX':0.2,'MUY':0.2}}}])
|
||||
|
||||
var = ['S10MA01-MQUA020','S10MA01-MQUA050','S10MA01-MQUA070','S10MA01-MQUA110','S10MA01-MQUA130']
|
||||
parameter['Match to Linac 2']=MatchParameter(var,[{'Save':{'Location':'s20cb01$start','SaveID':'Linac 2'}}])
|
||||
tar =[{'Location':'s20cb01$start','SavedID':'Linac 2'}]
|
||||
parameter['Match to Linac 2']=MatchParameter(var, tar)
|
||||
|
||||
var = ['S20SY02-MQUA070','S20SY02-MQUA100','S20SY02-MQUA140','S20SY02-MQUA180','S20SY02-MKDC010','S20SY02-MKDC020','S20SY02-MKDC030','S20SY02-MKDC040','S20SY02-MKDC050']
|
||||
parameter['Resonant Kicker']=MatchParameter(var,[{'Script':{'Location':'File','Script':'Scripts/switchyard.madx'}}])
|
||||
var = ['S20SY01-MQUA020','S20SY01-MQUA030','S20SY01-MQUA050','S20SY01-MQUA080']
|
||||
tar = [reference['Switchyard']]
|
||||
parameter['Match to Switchyard']=MatchParameter(var, tar)
|
||||
|
||||
|
||||
var = ['S20SY02-MQUA070','S20SY02-MQUA100','S20SY02-MQUA140','S20SY02-MQUA180','S20SY02-MKDC010','S20SY02-MKAC020','S20SY02-MKDC030','S20SY02-MKAC040','S20SY02-MKDC050']
|
||||
tar=[{'Script':'Scripts/switchyard_kicker.madx'}]
|
||||
parameter['Resonant Kicker']=MatchParameter(var, tar)
|
||||
|
||||
dependence={}
|
||||
dependence['SINSB04-MQUA230']=['SINSB03-MQUA230']
|
||||
dependence['S10CB02-MQUA230']=['S10DI01-MQUA120'] + ['S10CB%2.2d-MQUA430' % i for i in range(3,9)]
|
||||
dependence['S10CB02-MQUA430']=['S10CB%2.2d-MQUA230' % i for i in range(3,9)]
|
||||
dependence['S20CB01-MQUA430']=['S20CB03-MQUA430']
|
||||
dependence['SATSY01-MQUA090']=['SATSY01-MQUA210']
|
||||
dependence['SATSY01-MQUA070']=['SATSY01-MQUA230']
|
||||
dependence['SATSY01-MQUA040']=['SATSY01-MQUA260']
|
||||
|
||||
|
||||
reference={}
|
||||
@@ -81,7 +127,7 @@ reference['Start'] = MatchReference('start',{'betax':29.971,'alphax':0.003,'beta
|
||||
reference['Laser Heater'] = MatchReference('sinlh02.mqua410$start',{'betax': 11.2, 'alphax': 3.2,'betay': 0.8, 'alphay': 0.75,})
|
||||
reference['Bunch Compressor 1'] = MatchReference('sindi02.mqua020$start',{'betax': 11.1557, 'alphax': -1.17,'betay': 50, 'alphay': 0.})
|
||||
reference['Bunch Compressor 2'] = MatchReference('s10ma01.mqua020$start',{'betax': 6.14, 'alphax': -0.83,'betay': 22.86, 'alphay': -1.18})
|
||||
reference['Switchyard'] = MatchReference('s20sy02.mqua070$start',{'betax': 12.99, 'alphax': 3.7011,'betay': 46.339, 'alphay': -6.501})
|
||||
reference['Switchyard'] = MatchReference('s20sy02$start',{'betax': 48.26, 'alphax': 7.322,'betay': 14.293, 'alphay': -3.513})
|
||||
reference['Linac3'] = MatchReference('s30cb10.mqua430$start',{'betax': 8.83,'alphax': 0.548,'betay': 30.44,'alphay': -1.866})
|
||||
reference['Aramis Stopper'] = MatchReference('sarma01.mqua010$start',{'betax': 2.304, 'alphax': -1.4045, 'betay': 25.929, 'alphay': -6.363})
|
||||
reference['Athos HERO'] = MatchReference('satdi01.mqua250$start',{'betax': 35.76, 'alphax': -1.166,'betay': 24.087, 'alphay': 0.648})
|
||||
|
||||
139
model.py
139
model.py
@@ -4,12 +4,15 @@ import numpy as np
|
||||
|
||||
from onlinemodel.core import Facility
|
||||
from onlinemodel.madx import CMadX
|
||||
from sipbuild.generator.outputs.formatters import variable
|
||||
|
||||
converttwiss= {'betax':'betx','betay':'bety','alphax':'alfx','alphay':'alfy',
|
||||
'etax':'dx','etay':'dy','etapx':'dpx','etapy':'dpy','mux':'mux','muy':'muy',
|
||||
'x':'x','y':'y','px':'px','py':'py','energy':'energy'}
|
||||
|
||||
|
||||
maxgradient= {'QFF':50.,'QFM':50,'QFD':20,'QFS':20,'QFDM':20,'QFA':31.75,'HFA':37.,'HFB':1445}
|
||||
|
||||
class Model:
|
||||
def __init__(self, phase=0, parent=None):
|
||||
print('Initializing online model ...')
|
||||
@@ -24,6 +27,7 @@ class Model:
|
||||
self.energyReference ='SINLH02.MBND100'
|
||||
|
||||
# hook up events
|
||||
self.matchplot=True
|
||||
self.eventHandling()
|
||||
|
||||
def eventHandling(self):
|
||||
@@ -34,6 +38,29 @@ class Model:
|
||||
def getLatticeVersion(self):
|
||||
return self.om.Version
|
||||
|
||||
def getVariableInfo(self,varlist):
|
||||
variable = {}
|
||||
for var in varlist:
|
||||
ele = self.om.getElement(var.replace('-','.'))
|
||||
if ele is None:
|
||||
variable[var]={'Val':0,'Max':None}
|
||||
else:
|
||||
if 'MQUA' in var or 'MQSK' in var or 'MSEX' in var:
|
||||
bg = ele.Baugruppe
|
||||
Brho = self.om.EnergyAt(var.replace('-','.'))[0]/3e8
|
||||
if bg in maxgradient.keys():
|
||||
mgrad=maxgradient[bg]/Brho
|
||||
else:
|
||||
mgrad=None
|
||||
if 'MSEX' in var:
|
||||
variable[var]={'Val':ele.k2,'Max':mgrad}
|
||||
else:
|
||||
variable[var] = {'Val': ele.k1, 'Max': mgrad}
|
||||
else:
|
||||
variable[var]={'Val':0,'Max':None}
|
||||
return variable
|
||||
|
||||
|
||||
def updateEnergy(self,E0):
|
||||
if isinstance(E0,list):
|
||||
E0=E0[0]
|
||||
@@ -169,28 +196,27 @@ class Model:
|
||||
|
||||
|
||||
def match(self):
|
||||
config,ID, status = self.parent.reference.getMatchingPoint()
|
||||
if status is False:
|
||||
config = self.parent.reference.getMatchingPoint()
|
||||
if config is False:
|
||||
return
|
||||
self.setBranch(config['Destination'])
|
||||
sequence = config['Sequence']
|
||||
if isinstance(sequence,list):
|
||||
length = [self.om.getSection(ele).LengthRes for ele in sequence]
|
||||
sequence =self.madx.buildSequence(sequence,length,'seqcompund')
|
||||
|
||||
if config['Reference'] is None:
|
||||
start='#s'
|
||||
end='#e'
|
||||
itwiss=None
|
||||
self.setBranch(config['destination'])
|
||||
sequence = config['sequence']
|
||||
ID = config['ID']
|
||||
start=config['start']['Location']
|
||||
end=config['end']
|
||||
if len(end) == 7:
|
||||
end=end+'$end'
|
||||
if 'Twiss' in config['start']:
|
||||
itwiss = {converttwiss[key.lower()]: config['start']['Twiss'][key] for key in
|
||||
config['start']['Twiss'].keys()}
|
||||
else:
|
||||
start=config['Reference']['Location']
|
||||
if start.upper() == 'START':
|
||||
start='#s'
|
||||
end = config['End']+'$end'
|
||||
itwiss = {converttwiss[key.lower()]:config['Reference']['Twiss'][key] for key in config['Reference']['Twiss'].keys()}
|
||||
itwiss = None
|
||||
|
||||
|
||||
var={}
|
||||
random = self.parent.UIMatchRandom.isChecked()
|
||||
for key in config['Variable'].keys():
|
||||
nvar=0
|
||||
for key in config['variable'].keys():
|
||||
nvar+=1
|
||||
key0=key.replace('-','.').lower()
|
||||
if 'mqua' in key0 or 'mqsk' in key0:
|
||||
key0+='.k1'
|
||||
@@ -198,32 +224,64 @@ class Model:
|
||||
key0+='.k2'
|
||||
elif 'mkac' in key0 or 'mkdc' in key0:
|
||||
key0+='.cory'
|
||||
var[key0]=config['variable'][key]
|
||||
|
||||
var[key0]=config['Variable'][key]
|
||||
conf0={}
|
||||
if 'File' in config['Target'].keys():
|
||||
twiss,err=self.madx.callScript(config['Target']['File']['File'],sequence,start,end)
|
||||
else:
|
||||
for key in config['Target'].keys():
|
||||
sconf = config['Target'][key]
|
||||
conf0[key] = {converttwiss[key0.lower()]:sconf[key0] for key0 in sconf.keys()}
|
||||
res,twiss,err=self.madx.match(sequence=sequence, start=start, end=end,
|
||||
init=itwiss, var=var, const=conf0,
|
||||
preset=False,random=random)
|
||||
if not config['Save'] == False:
|
||||
target = config['target']
|
||||
if 'Script' in target.keys():
|
||||
res,twiss,err = self.madx.callScript(script = target['Script'],sequence=sequence, start=start, end=end,var=var)
|
||||
self.endMatching()
|
||||
return
|
||||
|
||||
ncon = 0
|
||||
condilist = {}
|
||||
for key in target.keys():
|
||||
condi={}
|
||||
for ele in target[key]:
|
||||
if isinstance(ele,tuple):
|
||||
condi[converttwiss[ele[0].lower()]]={'Condition': ele[1],'Val':ele[2]}
|
||||
ncon+=1
|
||||
elif isinstance(ele,str):
|
||||
print('Needs matching results from', ele)
|
||||
return
|
||||
condilist[key]=condi
|
||||
print('Variables:',nvar)
|
||||
print('Conditions:',ncon)
|
||||
if nvar > ncon:
|
||||
print('Adding dummy constraints from initial conditions')
|
||||
if not start in condilist.keys():
|
||||
condilist[start]={}
|
||||
condi={}
|
||||
for twkey in itwiss.keys():
|
||||
if ncon < nvar:
|
||||
condi[twkey]={'Condition':0,'Val':itwiss[twkey]}
|
||||
ncon+=1
|
||||
condilist[start]=condi
|
||||
|
||||
for key in condilist.keys():
|
||||
print(key,condilist[key])
|
||||
|
||||
random = self.parent.UIMatchRandom.isChecked()
|
||||
res,twiss,err=self.madx.match(sequence=sequence, start=start, end=end,
|
||||
init=itwiss, var=var, const=condilist,
|
||||
preset=False,random=random)
|
||||
self.endMatching()
|
||||
|
||||
def endMatching(self):
|
||||
self.updateModelFromMatching(res)
|
||||
if config['save'] == True:
|
||||
self.parent.reference.saveTwiss(ID,twiss)
|
||||
self.parent.reference.updateMatchPoint(ID,err)
|
||||
#self.updateModelFromMatching(res)
|
||||
if self.matchplot:
|
||||
energy = self.calcEnergyProfile(twiss)
|
||||
self.parent.plot.newData(twiss,energy)
|
||||
|
||||
energy = self.calcEnergyProfile(twiss)
|
||||
self.parent.plot.newData(twiss,energy)
|
||||
|
||||
def updateModelFromMatching(self,var):
|
||||
for magm in var.keys():
|
||||
mag0 = magm[0:15]
|
||||
val = var[magm]
|
||||
ele = self.om.getElement(mag0)
|
||||
if 'mqua' in magm or 'mqsk' in magm:
|
||||
mag0 = magm[0:15]
|
||||
val = var[magm]
|
||||
ele=self.om.getElement(mag0)
|
||||
if not ele is None:
|
||||
ele.k1 = val
|
||||
print('Updating %s to k1: %8.4f' % (mag0, val))
|
||||
@@ -234,8 +292,11 @@ class Model:
|
||||
if not ele is None:
|
||||
ele.k1 = val
|
||||
print('Updating %s to k1: %8.4f' % (magd, val))
|
||||
|
||||
|
||||
elif 'mkac' in magm or 'mkdc' in magm:
|
||||
if not ele is None:
|
||||
ele.design_kick = val
|
||||
ele.cory = val
|
||||
print('Updating %s to design_kick: %8.4f' % (mag0, val))
|
||||
##################
|
||||
# tracking
|
||||
|
||||
|
||||
190
reference.py
190
reference.py
@@ -49,7 +49,7 @@ class ReferenceManager:
|
||||
with open(filename) as f:
|
||||
self.settings = json.load(f)
|
||||
self.order={ele['MatchID']:i for i,ele in enumerate(self.settings['Order'])}
|
||||
self.reference=self.settings['Reference']
|
||||
self.reference=self.settings['Reference'] # this are fixed points in the lattice
|
||||
self.label=self.settings['Label']
|
||||
self.parameter=self.settings['Parameter']
|
||||
self.dependence=self.settings['Dependence']
|
||||
@@ -66,63 +66,69 @@ class ReferenceManager:
|
||||
def getMatchingPoint(self):
|
||||
idx = self.parent.UIMatchOrder.currentRow()
|
||||
if idx < 0:
|
||||
return None,None,False
|
||||
return None
|
||||
|
||||
status = True
|
||||
ID = str(self.parent.UIMatchOrder.item(idx).text())
|
||||
idx = self.order[ID] # get index in the list
|
||||
order = copy.deepcopy(self.settings['Order'][idx]) # getting the specific entry from the order list
|
||||
if not order['Reference'] is None: # has a fixed referenc epoint instead of periodic solution
|
||||
twiss0 = self.getReferenceByTag(order['Reference']) # get the starting parameters by its reference
|
||||
order['Reference'] = twiss0 # put it back into the order variable
|
||||
order['Variable'] = self.parameter[ID]['Variable']
|
||||
nvar = len(order['Variable'].keys())
|
||||
target0= self.parameter[ID]['Target']
|
||||
target = {}
|
||||
ncon = 0
|
||||
for tar in target0:
|
||||
if 'Reference' in tar.keys():
|
||||
par=self.getReferenceByTag(tar['Reference'])
|
||||
loc = par['Location']
|
||||
con = {key:{'Val':par['Twiss'][key],'Condition':0} for key in par['Twiss'].keys()}
|
||||
target[loc]=con
|
||||
ncon += len(con.keys())
|
||||
elif 'Script' in tar.keys():
|
||||
loc = tar['Script']['Location']
|
||||
file = tar['Script']['Script']
|
||||
target[loc] = {'File':file} # all condition are in the script
|
||||
ncon += 100
|
||||
elif 'Fixed' in tar.keys():
|
||||
loc=tar['Fixed']['Location']
|
||||
if 'Limit' in tar['Fixed'].keys():
|
||||
condi = tar['Fixed']['Limit']
|
||||
order = copy.deepcopy(self.settings['Order'][idx])
|
||||
destination = order['Destination']
|
||||
save = order['Save']
|
||||
|
||||
sequence = order['Sequence']
|
||||
if not sequence is None:
|
||||
if isinstance(sequence,str):
|
||||
start = sequence+'$start'
|
||||
end = sequence+'$end'
|
||||
elif isinstance(sequence,list):
|
||||
start = sequence[0]+'$start'
|
||||
end = sequence[-1]+'$end'
|
||||
twiss0 = {'Location': start, 'twiss': {}}
|
||||
else:
|
||||
end = order['End']
|
||||
if end is None:
|
||||
end = '#e'
|
||||
start = order['Reference']
|
||||
if start is None:
|
||||
twiss0 = {'Location':'#s','twiss':{}}
|
||||
else:
|
||||
twiss0 = self.getReferenceByTag(order['Reference'])
|
||||
if twiss0['Location'].upper() == 'START':
|
||||
twiss0['Location']= '#s'
|
||||
sequence='swissfel'
|
||||
|
||||
varlist = self.parameter[ID]['Variable']
|
||||
variable = self.parent.model.getVariableInfo(varlist)
|
||||
|
||||
cond = {}
|
||||
targets = self.parameter[ID]['Target']
|
||||
for target in targets:
|
||||
if 'Location' in target.keys():
|
||||
loc = target['Location']
|
||||
if not loc in cond.keys():
|
||||
cond[loc]=[]
|
||||
if 'Limit' in target.keys():
|
||||
limit = target['Limit']
|
||||
else:
|
||||
condi = 0
|
||||
con = {key: {'Val': tar['Fixed']['Twiss'][key], 'Condition': condi} for key in tar['Fixed']['Twiss'].keys()}
|
||||
target[loc]=con
|
||||
ncon += len(con.keys())
|
||||
elif 'Save' in tar.keys():
|
||||
loc=tar['Save']['Location']
|
||||
IDsave = tar['Save']['SaveID']
|
||||
if not IDsave in self.save.keys():
|
||||
print('Needs first the matching point of',IDsave)
|
||||
status = False
|
||||
con = {}
|
||||
ncon+=100 # make sure that this will abort any matching and not filled by dummy constraints
|
||||
else:
|
||||
con = {key:{'Val': self.save[IDsave][key],'Condition':0} for key in self.save[IDsave].keys()}
|
||||
ncon += len(con.keys())
|
||||
target[loc]=con
|
||||
print('Saved Target',loc,target[loc])
|
||||
if nvar>ncon:
|
||||
dummycon={}
|
||||
for key in order['Reference']['Twiss'].keys():
|
||||
if ncon < nvar:
|
||||
dummycon[key]={'Val':order['Reference']['Twiss'][key],'Condition':0}
|
||||
ncon+=1
|
||||
target['#s']=dummycon
|
||||
order['Target'] = target
|
||||
return order, ID, status
|
||||
limit = 0
|
||||
if 'Twiss' in target.keys():
|
||||
for key0 in target['Twiss'].keys():
|
||||
cond[loc].append((key0,limit,target['Twiss'][key0]))
|
||||
elif 'SavedID':
|
||||
if target['SavedID'] in self.save.keys():
|
||||
twisssaved = self.save[target['SavedID']]
|
||||
for twkey in twisssaved.keys():
|
||||
cond[loc].append((twkey,0,twisssaved[twkey]))
|
||||
else:
|
||||
cond[loc].append(target['SavedID'])
|
||||
elif 'Script' in target.keys():
|
||||
cond['Script']=target['Script']
|
||||
|
||||
config={'ID':ID,'start':twiss0,'end':end,
|
||||
'destination':destination,'sequence':sequence,
|
||||
'variable':variable,'target':cond,'save':save}
|
||||
return config
|
||||
|
||||
|
||||
|
||||
def updateMatchPoint(self,ID,val):
|
||||
idx = self.order[ID]
|
||||
@@ -150,42 +156,56 @@ class ReferenceManager:
|
||||
# match info
|
||||
|
||||
def displayMatchingPoint(self):
|
||||
order,ID,status = self.getMatchingPoint()
|
||||
if status is None:
|
||||
return
|
||||
self.parent.UIMatchLabel.setText(ID)
|
||||
if order['Reference'] is None:
|
||||
self.parent.UIMatchStart.setText('Start')
|
||||
else:
|
||||
self.parent.UIMatchStart.setText(order['Reference']['Location'])
|
||||
self.parent.UIMatchKnobs.clear()
|
||||
for ele in order['Variable'].keys():
|
||||
self.parent.UIMatchKnobs.addItem(ele)
|
||||
self.parent.UIMatchTargets.clear()
|
||||
config = self.getMatchingPoint()
|
||||
if config is None:
|
||||
return
|
||||
self.parent.UIMatchLabel.setText(config['ID'])
|
||||
self.parent.UIMatchStart.setText(config['start']['Location'])
|
||||
self.parent.UIMatchEnd.setText(config['end'])
|
||||
self.parent.UIMatchSequence.setText(config['sequence'])
|
||||
|
||||
self.parent.UIMatchKnobs.setColumnCount(3)
|
||||
self.parent.UIMatchKnobs.setRowCount(len(config['variable'].keys()))
|
||||
for i , key in enumerate(config['variable'].keys()):
|
||||
self.parent.UIMatchKnobs.setItem(i, 0, QtWidgets.QTableWidgetItem(key))
|
||||
self.parent.UIMatchKnobs.setItem(i, 1, QtWidgets.QTableWidgetItem('%7.3f' % config['variable'][key]['Val']))
|
||||
arg = config['variable'][key]['Max']
|
||||
if arg is None:
|
||||
self.parent.UIMatchKnobs.setItem(i, 2, QtWidgets.QTableWidgetItem(''))
|
||||
else:
|
||||
self.parent.UIMatchKnobs.setItem(i, 2, QtWidgets.QTableWidgetItem('%7.3f' % arg))
|
||||
self.parent.UIMatchKnobs.resizeColumnsToContents()
|
||||
self.parent.UIMatchKnobs.verticalHeader().hide()
|
||||
|
||||
self.parent.UIMatchTargets.setColumnCount(2)
|
||||
self.parent.UIMatchTargets.setRowCount(0)
|
||||
irow = 0
|
||||
sym=['=','<','>']
|
||||
for key0 in order['Target'].keys():
|
||||
info = order['Target'][key0]
|
||||
for key in info.keys():
|
||||
self.parent.UIMatchTargets.insertRow(irow)
|
||||
if key == 'File':
|
||||
self.parent.UIMatchTargets.setItem(irow, 0, QtWidgets.QTableWidgetItem('Script'))
|
||||
self.parent.UIMatchTargets.setItem(irow, 1, QtWidgets.QTableWidgetItem(info['File']))
|
||||
else:
|
||||
self.parent.UIMatchTargets.setItem(irow, 0, QtWidgets.QTableWidgetItem(key0))
|
||||
val = '%7.3f' % info[key]['Val']
|
||||
txt = key + sym[info[key]['Condition']] + val.strip()
|
||||
self.parent.UIMatchTargets.setItem(irow, 1, QtWidgets.QTableWidgetItem(txt))
|
||||
irow+=1
|
||||
if irow == 0:
|
||||
self.parent.UIMatchTargets.insertRow(irow)
|
||||
self.parent.UIMatchTargets.setItem(0, 0, QtWidgets.QTableWidgetItem('Needs previous matching'))
|
||||
if 'Script' in config['target'].keys():
|
||||
self.parent.UIMatchTargets.insertRow(0)
|
||||
self.parent.UIMatchTargets.setItem(0, 0, QtWidgets.QTableWidgetItem('Script'))
|
||||
self.parent.UIMatchTargets.setItem(0, 1, QtWidgets.QTableWidgetItem(config['target']['Script']))
|
||||
else:
|
||||
irow = 0
|
||||
for key in config['target'].keys():
|
||||
for ele in config['target'][key]:
|
||||
self.parent.UIMatchTargets.insertRow(irow)
|
||||
self.parent.UIMatchTargets.setItem(irow, 0, QtWidgets.QTableWidgetItem(key))
|
||||
if isinstance(ele, tuple):
|
||||
fld = self.convertTargetTuple(ele)
|
||||
self.parent.UIMatchTargets.setItem(irow, 1, QtWidgets.QTableWidgetItem(fld))
|
||||
elif isinstance(ele,str):
|
||||
self.parent.UIMatchTargets.setItem(irow, 1, QtWidgets.QTableWidgetItem('Result from: %s ' % ele))
|
||||
self.parent.UIMatchTargets.resizeColumnsToContents()
|
||||
self.parent.UIMatchTargets.verticalHeader().hide()
|
||||
self.parent.UIMatchTargets.horizontalHeader().hide()
|
||||
return
|
||||
|
||||
def convertTargetTuple(self,tuple_in):
|
||||
sym = ['=', '<', '>']
|
||||
retval = tuple_in[0]+sym[int(tuple_in[1])]
|
||||
if tuple_in[2] is None:
|
||||
return retval+'undefined'
|
||||
flt = '%7.3f' % tuple_in[2]
|
||||
return retval + flt.strip()
|
||||
|
||||
#--------------------------------
|
||||
# obtaining reference data
|
||||
def getReference(self):
|
||||
|
||||
@@ -39,57 +39,89 @@ class Ui_OpticsPlotGUI(object):
|
||||
self.verticalLayout_5.addWidget(self.label_31)
|
||||
self.gridLayout_4 = QtWidgets.QGridLayout()
|
||||
self.gridLayout_4.setObjectName("gridLayout_4")
|
||||
self.PEtax = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PEtax.setCheckable(True)
|
||||
self.PEtax.setObjectName("PEtax")
|
||||
self.gridLayout_4.addWidget(self.PEtax, 2, 0, 1, 1)
|
||||
self.PEtay = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PEtay.setCheckable(True)
|
||||
self.PEtay.setObjectName("PEtay")
|
||||
self.gridLayout_4.addWidget(self.PEtay, 2, 1, 1, 1)
|
||||
self.PBetax = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PBetax.setCheckable(True)
|
||||
self.PBetax.setChecked(True)
|
||||
self.PBetax.setObjectName("PBetax")
|
||||
self.gridLayout_4.addWidget(self.PBetax, 0, 0, 1, 1)
|
||||
self.PR56 = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PR56.setCheckable(True)
|
||||
self.PR56.setObjectName("PR56")
|
||||
self.gridLayout_4.addWidget(self.PR56, 5, 0, 1, 1)
|
||||
self.PMux = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PMux.setCheckable(True)
|
||||
self.PMux.setObjectName("PMux")
|
||||
self.gridLayout_4.addWidget(self.PMux, 4, 0, 1, 1)
|
||||
self.PMuy = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PMuy.setCheckable(True)
|
||||
self.PMuy.setObjectName("PMuy")
|
||||
self.gridLayout_4.addWidget(self.PMuy, 4, 1, 1, 1)
|
||||
self.PAlphax = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PAlphax.setCheckable(True)
|
||||
self.PAlphax.setObjectName("PAlphax")
|
||||
self.gridLayout_4.addWidget(self.PAlphax, 1, 0, 1, 1)
|
||||
self.PBetay = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PBetay.setCheckable(True)
|
||||
self.PBetay.setChecked(True)
|
||||
self.PBetay.setObjectName("PBetay")
|
||||
self.gridLayout_4.addWidget(self.PBetay, 0, 1, 1, 1)
|
||||
self.PY = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PY.setCheckable(True)
|
||||
self.PY.setObjectName("PY")
|
||||
self.gridLayout_4.addWidget(self.PY, 3, 1, 1, 1)
|
||||
self.PR22 = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PR22.setEnabled(False)
|
||||
self.PR22.setObjectName("PR22")
|
||||
self.gridLayout_4.addWidget(self.PR22, 7, 1, 1, 1)
|
||||
self.PAlphay = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PAlphay.setCheckable(True)
|
||||
self.PAlphay.setObjectName("PAlphay")
|
||||
self.gridLayout_4.addWidget(self.PAlphay, 1, 1, 1, 1)
|
||||
self.PR12 = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PR12.setEnabled(False)
|
||||
self.PR12.setObjectName("PR12")
|
||||
self.gridLayout_4.addWidget(self.PR12, 6, 1, 1, 1)
|
||||
self.PEnergy = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PEnergy.setEnabled(True)
|
||||
self.PEnergy.setCheckable(True)
|
||||
self.PEnergy.setObjectName("PEnergy")
|
||||
self.gridLayout_4.addWidget(self.PEnergy, 5, 1, 1, 1)
|
||||
self.PAlphay = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PAlphay.setCheckable(True)
|
||||
self.PAlphay.setObjectName("PAlphay")
|
||||
self.gridLayout_4.addWidget(self.PAlphay, 1, 1, 1, 1)
|
||||
self.PMux = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PMux.setCheckable(True)
|
||||
self.PMux.setObjectName("PMux")
|
||||
self.gridLayout_4.addWidget(self.PMux, 4, 0, 1, 1)
|
||||
self.PBetax = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PBetax.setCheckable(True)
|
||||
self.PBetax.setChecked(True)
|
||||
self.PBetax.setObjectName("PBetax")
|
||||
self.gridLayout_4.addWidget(self.PBetax, 0, 0, 1, 1)
|
||||
self.PAlphax = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PAlphax.setCheckable(True)
|
||||
self.PAlphax.setObjectName("PAlphax")
|
||||
self.gridLayout_4.addWidget(self.PAlphax, 1, 0, 1, 1)
|
||||
self.PR56 = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PR56.setCheckable(True)
|
||||
self.PR56.setObjectName("PR56")
|
||||
self.gridLayout_4.addWidget(self.PR56, 5, 0, 1, 1)
|
||||
self.PR33 = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PR33.setEnabled(False)
|
||||
self.PR33.setObjectName("PR33")
|
||||
self.gridLayout_4.addWidget(self.PR33, 8, 0, 1, 1)
|
||||
self.PR34 = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PR34.setEnabled(False)
|
||||
self.PR34.setObjectName("PR34")
|
||||
self.gridLayout_4.addWidget(self.PR34, 8, 1, 1, 1)
|
||||
self.PEtax = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PEtax.setCheckable(True)
|
||||
self.PEtax.setObjectName("PEtax")
|
||||
self.gridLayout_4.addWidget(self.PEtax, 2, 0, 1, 1)
|
||||
self.PX = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PX.setCheckable(True)
|
||||
self.PX.setObjectName("PX")
|
||||
self.gridLayout_4.addWidget(self.PX, 3, 0, 1, 1)
|
||||
self.PY = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PY.setCheckable(True)
|
||||
self.PY.setObjectName("PY")
|
||||
self.gridLayout_4.addWidget(self.PY, 3, 1, 1, 1)
|
||||
self.PEtay = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PEtay.setCheckable(True)
|
||||
self.PEtay.setObjectName("PEtay")
|
||||
self.gridLayout_4.addWidget(self.PEtay, 2, 1, 1, 1)
|
||||
self.PR11 = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PR11.setEnabled(False)
|
||||
self.PR11.setObjectName("PR11")
|
||||
self.gridLayout_4.addWidget(self.PR11, 6, 0, 1, 1)
|
||||
self.PBetay = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PBetay.setCheckable(True)
|
||||
self.PBetay.setChecked(True)
|
||||
self.PBetay.setObjectName("PBetay")
|
||||
self.gridLayout_4.addWidget(self.PBetay, 0, 1, 1, 1)
|
||||
self.PR21 = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PR21.setEnabled(False)
|
||||
self.PR21.setObjectName("PR21")
|
||||
self.gridLayout_4.addWidget(self.PR21, 7, 0, 1, 1)
|
||||
self.PMuy = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PMuy.setCheckable(True)
|
||||
self.PMuy.setObjectName("PMuy")
|
||||
self.gridLayout_4.addWidget(self.PMuy, 4, 1, 1, 1)
|
||||
self.PR43 = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PR43.setEnabled(False)
|
||||
self.PR43.setObjectName("PR43")
|
||||
self.gridLayout_4.addWidget(self.PR43, 9, 0, 1, 1)
|
||||
self.PR44 = QtWidgets.QPushButton(self.widget_2)
|
||||
self.PR44.setEnabled(False)
|
||||
self.PR44.setObjectName("PR44")
|
||||
self.gridLayout_4.addWidget(self.PR44, 9, 1, 1, 1)
|
||||
self.verticalLayout_5.addLayout(self.gridLayout_4)
|
||||
self.gridLayout_5 = QtWidgets.QGridLayout()
|
||||
self.gridLayout_5.setObjectName("gridLayout_5")
|
||||
@@ -289,18 +321,26 @@ class Ui_OpticsPlotGUI(object):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
OpticsPlotGUI.setWindowTitle(_translate("OpticsPlotGUI", "SwissFEL Optics"))
|
||||
self.label_31.setText(_translate("OpticsPlotGUI", "Plotting"))
|
||||
self.PEtax.setText(_translate("OpticsPlotGUI", "Etax"))
|
||||
self.PEtay.setText(_translate("OpticsPlotGUI", "Etay"))
|
||||
self.PBetax.setText(_translate("OpticsPlotGUI", "Betax"))
|
||||
self.PR56.setText(_translate("OpticsPlotGUI", "R56"))
|
||||
self.PMux.setText(_translate("OpticsPlotGUI", "Mux"))
|
||||
self.PMuy.setText(_translate("OpticsPlotGUI", "Muy"))
|
||||
self.PAlphax.setText(_translate("OpticsPlotGUI", "Alphax"))
|
||||
self.PBetay.setText(_translate("OpticsPlotGUI", "Betay"))
|
||||
self.PEnergy.setText(_translate("OpticsPlotGUI", "Energy"))
|
||||
self.PAlphay.setText(_translate("OpticsPlotGUI", "AlphaY"))
|
||||
self.PX.setText(_translate("OpticsPlotGUI", "X"))
|
||||
self.PY.setText(_translate("OpticsPlotGUI", "Y"))
|
||||
self.PR22.setText(_translate("OpticsPlotGUI", "R22"))
|
||||
self.PAlphay.setText(_translate("OpticsPlotGUI", "AlphaY"))
|
||||
self.PR12.setText(_translate("OpticsPlotGUI", "R12"))
|
||||
self.PEnergy.setText(_translate("OpticsPlotGUI", "Energy"))
|
||||
self.PMux.setText(_translate("OpticsPlotGUI", "Mux"))
|
||||
self.PBetax.setText(_translate("OpticsPlotGUI", "Betax"))
|
||||
self.PAlphax.setText(_translate("OpticsPlotGUI", "Alphax"))
|
||||
self.PR56.setText(_translate("OpticsPlotGUI", "R56"))
|
||||
self.PR33.setText(_translate("OpticsPlotGUI", "R33"))
|
||||
self.PR34.setText(_translate("OpticsPlotGUI", "R34"))
|
||||
self.PEtax.setText(_translate("OpticsPlotGUI", "Etax"))
|
||||
self.PX.setText(_translate("OpticsPlotGUI", "X"))
|
||||
self.PEtay.setText(_translate("OpticsPlotGUI", "Etay"))
|
||||
self.PR11.setText(_translate("OpticsPlotGUI", "R11"))
|
||||
self.PBetay.setText(_translate("OpticsPlotGUI", "Betay"))
|
||||
self.PR21.setText(_translate("OpticsPlotGUI", "R21"))
|
||||
self.PMuy.setText(_translate("OpticsPlotGUI", "Muy"))
|
||||
self.PR43.setText(_translate("OpticsPlotGUI", "R43"))
|
||||
self.PR44.setText(_translate("OpticsPlotGUI", "R44"))
|
||||
self.label_22.setText(_translate("OpticsPlotGUI", "Plot Start"))
|
||||
self.PStart.setText(_translate("OpticsPlotGUI", "0"))
|
||||
self.label_21.setText(_translate("OpticsPlotGUI", "Plot End"))
|
||||
|
||||
@@ -43,20 +43,63 @@
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="2" column="0">
|
||||
<widget class="QPushButton" name="PEtax">
|
||||
<item row="3" column="1">
|
||||
<widget class="QPushButton" name="PY">
|
||||
<property name="text">
|
||||
<string>Etax</string>
|
||||
<string>Y</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QPushButton" name="PEtay">
|
||||
<item row="7" column="1">
|
||||
<widget class="QPushButton" name="PR22">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Etay</string>
|
||||
<string>R22</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="PAlphay">
|
||||
<property name="text">
|
||||
<string>AlphaY</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QPushButton" name="PR12">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>R12</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QPushButton" name="PEnergy">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Energy</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QPushButton" name="PMux">
|
||||
<property name="text">
|
||||
<string>Mux</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
@@ -76,36 +119,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QPushButton" name="PR56">
|
||||
<property name="text">
|
||||
<string>R56</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QPushButton" name="PMux">
|
||||
<property name="text">
|
||||
<string>Mux</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QPushButton" name="PMuy">
|
||||
<property name="text">
|
||||
<string>Muy</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="PAlphax">
|
||||
<property name="text">
|
||||
@@ -116,36 +129,40 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="PBetay">
|
||||
<item row="5" column="0">
|
||||
<widget class="QPushButton" name="PR56">
|
||||
<property name="text">
|
||||
<string>Betay</string>
|
||||
<string>R56</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QPushButton" name="PEnergy">
|
||||
<item row="8" column="0">
|
||||
<widget class="QPushButton" name="PR33">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Energy</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
<string>R33</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="PAlphay">
|
||||
<item row="8" column="1">
|
||||
<widget class="QPushButton" name="PR34">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>AlphaY</string>
|
||||
<string>R34</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QPushButton" name="PEtax">
|
||||
<property name="text">
|
||||
<string>Etax</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
@@ -162,16 +179,79 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QPushButton" name="PY">
|
||||
<item row="2" column="1">
|
||||
<widget class="QPushButton" name="PEtay">
|
||||
<property name="text">
|
||||
<string>Y</string>
|
||||
<string>Etay</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QPushButton" name="PR11">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>R11</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="PBetay">
|
||||
<property name="text">
|
||||
<string>Betay</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QPushButton" name="PR21">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>R21</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QPushButton" name="PMuy">
|
||||
<property name="text">
|
||||
<string>Muy</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QPushButton" name="PR43">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>R43</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QPushButton" name="PR44">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>R44</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
@@ -389,34 +389,58 @@ class Ui_OpticsGUI(object):
|
||||
self.label_17 = QtWidgets.QLabel(self.tab_2)
|
||||
self.label_17.setObjectName("label_17")
|
||||
self.gridLayout_5.addWidget(self.label_17, 1, 0, 1, 1)
|
||||
self.UIMatchSequence = QtWidgets.QLineEdit(self.tab_2)
|
||||
self.UIMatchSequence.setObjectName("UIMatchSequence")
|
||||
self.gridLayout_5.addWidget(self.UIMatchSequence, 3, 1, 1, 1)
|
||||
self.UIMatchLabel = QtWidgets.QLineEdit(self.tab_2)
|
||||
self.UIMatchLabel.setObjectName("UIMatchLabel")
|
||||
self.gridLayout_5.addWidget(self.UIMatchLabel, 0, 1, 1, 1)
|
||||
self.label_11 = QtWidgets.QLabel(self.tab_2)
|
||||
self.label_11.setObjectName("label_11")
|
||||
self.gridLayout_5.addWidget(self.label_11, 3, 0, 1, 1)
|
||||
self.label_16 = QtWidgets.QLabel(self.tab_2)
|
||||
self.label_16.setObjectName("label_16")
|
||||
self.gridLayout_5.addWidget(self.label_16, 0, 0, 1, 1)
|
||||
self.UIMatchStart = QtWidgets.QLineEdit(self.tab_2)
|
||||
self.UIMatchStart.setObjectName("UIMatchStart")
|
||||
self.gridLayout_5.addWidget(self.UIMatchStart, 1, 1, 1, 1)
|
||||
self.label_12 = QtWidgets.QLabel(self.tab_2)
|
||||
self.label_12.setObjectName("label_12")
|
||||
self.gridLayout_5.addWidget(self.label_12, 2, 0, 1, 1)
|
||||
self.UIMatchEnd = QtWidgets.QLineEdit(self.tab_2)
|
||||
self.UIMatchEnd.setObjectName("UIMatchEnd")
|
||||
self.gridLayout_5.addWidget(self.UIMatchEnd, 2, 1, 1, 1)
|
||||
self.verticalLayout_7.addLayout(self.gridLayout_5)
|
||||
self.label_19 = QtWidgets.QLabel(self.tab_2)
|
||||
self.label_19.setObjectName("label_19")
|
||||
self.verticalLayout_7.addWidget(self.label_19)
|
||||
self.UIMatchKnobs = QtWidgets.QListWidget(self.tab_2)
|
||||
self.UIMatchKnobs = QtWidgets.QTableWidget(self.tab_2)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.UIMatchKnobs.sizePolicy().hasHeightForWidth())
|
||||
self.UIMatchKnobs.setSizePolicy(sizePolicy)
|
||||
self.UIMatchKnobs.setObjectName("UIMatchKnobs")
|
||||
self.UIMatchKnobs.setColumnCount(3)
|
||||
self.UIMatchKnobs.setRowCount(0)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.UIMatchKnobs.setHorizontalHeaderItem(0, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.UIMatchKnobs.setHorizontalHeaderItem(1, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.UIMatchKnobs.setHorizontalHeaderItem(2, item)
|
||||
self.verticalLayout_7.addWidget(self.UIMatchKnobs)
|
||||
self.label_20 = QtWidgets.QLabel(self.tab_2)
|
||||
self.label_20.setObjectName("label_20")
|
||||
self.verticalLayout_7.addWidget(self.label_20)
|
||||
self.UIMatchTargets = QtWidgets.QTableWidget(self.tab_2)
|
||||
self.UIMatchTargets.setObjectName("UIMatchTargets")
|
||||
self.UIMatchTargets.setColumnCount(0)
|
||||
self.UIMatchTargets.setColumnCount(2)
|
||||
self.UIMatchTargets.setRowCount(0)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.UIMatchTargets.setHorizontalHeaderItem(0, item)
|
||||
item = QtWidgets.QTableWidgetItem()
|
||||
self.UIMatchTargets.setHorizontalHeaderItem(1, item)
|
||||
self.verticalLayout_7.addWidget(self.UIMatchTargets)
|
||||
self.horizontalLayout_9.addLayout(self.verticalLayout_7)
|
||||
spacerItem2 = QtWidgets.QSpacerItem(242, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
@@ -603,9 +627,21 @@ class Ui_OpticsGUI(object):
|
||||
self.UIMatchRandom.setText(_translate("OpticsGUI", "Random Initialization"))
|
||||
self.label_21.setText(_translate("OpticsGUI", "Matching Point"))
|
||||
self.label_17.setText(_translate("OpticsGUI", "Start"))
|
||||
self.label_11.setText(_translate("OpticsGUI", "Sequence"))
|
||||
self.label_16.setText(_translate("OpticsGUI", "Match"))
|
||||
self.label_12.setText(_translate("OpticsGUI", "End"))
|
||||
self.label_19.setText(_translate("OpticsGUI", "Knobs"))
|
||||
item = self.UIMatchKnobs.horizontalHeaderItem(0)
|
||||
item.setText(_translate("OpticsGUI", "Parameter"))
|
||||
item = self.UIMatchKnobs.horizontalHeaderItem(1)
|
||||
item.setText(_translate("OpticsGUI", "Value"))
|
||||
item = self.UIMatchKnobs.horizontalHeaderItem(2)
|
||||
item.setText(_translate("OpticsGUI", "Limit"))
|
||||
self.label_20.setText(_translate("OpticsGUI", "Target"))
|
||||
item = self.UIMatchTargets.horizontalHeaderItem(0)
|
||||
item.setText(_translate("OpticsGUI", "Location"))
|
||||
item = self.UIMatchTargets.horizontalHeaderItem(1)
|
||||
item.setText(_translate("OpticsGUI", "Condition"))
|
||||
self.TabMaster.setTabText(self.TabMaster.indexOf(self.tab_2), _translate("OpticsGUI", "Matching"))
|
||||
self.menuFile.setTitle(_translate("OpticsGUI", "File"))
|
||||
self.menuHelp.setTitle(_translate("OpticsGUI", "Help"))
|
||||
|
||||
@@ -642,9 +642,19 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="UIMatchSequence"/>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="UIMatchLabel"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Sequence</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_16">
|
||||
<property name="text">
|
||||
@@ -655,6 +665,16 @@
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="UIMatchStart"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>End</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="UIMatchEnd"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
@@ -665,13 +685,28 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="UIMatchKnobs">
|
||||
<widget class="QTableWidget" name="UIMatchKnobs">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Parameter</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Value</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Limit</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@@ -682,7 +717,18 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTableWidget" name="UIMatchTargets"/>
|
||||
<widget class="QTableWidget" name="UIMatchTargets">
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Location</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Condition</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user