diff --git a/layoutexporter.py b/layoutexporter.py index 7183aae..4aa0ab1 100644 --- a/layoutexporter.py +++ b/layoutexporter.py @@ -77,6 +77,12 @@ class Exporter: prop+=',"Tilt":%f' % (Element.Tilt*np.pi/180.) if isinstance(Element, RF): prop+=',"Band":%s' % Element.Band + if isinstance(Element,Quadrupole): + if Element.PSChannels > 1: + prop+=',"corx":0,"cory":0' + if isinstance(Element,Dipole): + if Element.PSChannels > 1: + prop+=',"cor":0"' if isinstance(Element, Diagnostic): if Element.Seval > 0: prop+=',"Seval":%f' % Element.seval diff --git a/protoliste.py b/protoliste.py index eadfe7b..aeeea88 100644 --- a/protoliste.py +++ b/protoliste.py @@ -298,18 +298,8 @@ class ProtoListe(ApplicationTemplate): def writeMagnets(self,ele): channels=0 - if 'k1' in ele.__dict__: - channels=channels+1 - if 'k2' in ele.__dict__: - channels=channels+1 - if 'ks' in ele.__dict__: - channels=channels+1 - if 'corx' in ele.__dict__: - channels=channels+1 - if 'cory' in ele.__dict__: - channels=channels+1 - if 'cor' in ele.__dict__: - channels=channels+1 + if 'PSChannels' in ele.__dict__: + channels=ele['PSChannels'] if ele.Baugruppe=='QFU': channels=channels-1 if ele.Baugruppe=='QFUE': @@ -318,6 +308,8 @@ class ProtoListe(ApplicationTemplate): channels = channels - 1 if ele.Baugruppe=='UE38-DELAY': channels=channels+1 + if channels <0: + channels = 0 # print info of the element and advances the layout position over the reserved length self.advance(ele.sRef+ele.Length*0.5,0) # propagation to the center point @@ -337,12 +329,12 @@ class ProtoListe(ApplicationTemplate): def writeBend(self,ele): # print info of the element and advances the layout position over the reserved length - channels=1 + if 'PSChannels' in ele.__dict__: + channels = ele['PSChannels'] name = ele.Prefix+'-'+ele.Name if ele.Baugruppe[0:3]=='AFP': channels=0 - if 'cor' in ele.__dict__: - channels=channels+1 + self.advance(ele.sRef,0) self.p1 = self.p1 + ele.sRef*self.ev1 if (ele.design_angle==0):