Skip to content
Snippets Groups Projects
Commit 05386a19 authored by Daniel Brown's avatar Daniel Brown
Browse files

Merge branch 'master' of gitmaster.atlas.aei.uni-hannover.de:pykat/pykat

parents b871e9a5 079b10b9
No related branches found
No related tags found
No related merge requests found
......@@ -269,11 +269,11 @@ class space(Component):
@property
def L(self): return Param('L', self.__L)
@L.setter
def L(self,value): self.__L = float(value)
def L(self,value): self.__L = SIfloat(value)
@property
def n(self): return Param('n', self.__n)
@n.setter
def n(self,value): self.__n = float(value)
def n(self,value): self.__n = SIfloat(value)
@staticmethod
def parseFinesseText(text):
......
......@@ -51,21 +51,26 @@ class Detector(object) :
class photodiode(Detector):
class f(list):
class F:
def __init__(self, values=None):
print "tadaaaaaaaaaaaaaaa"
if values is None:
self.values = []
else:
self.values = values
def __len__(self):
return len(self.values)
def __getitem__(self, key):
# if key is of invalid type or value, the list values will raise the error
return self.values[key]
def __setitem__(self, key, value):
print "setting"
self.values[key] = SIfloat(value)
class phi(list):
class Phi():
def __init__(self, values=None):
print values
if values is None:
......@@ -85,7 +90,13 @@ class photodiode(Detector):
self.values[key] = value
else:
self.values[key] = SIfloat(value)
def append(self, value):
self.values.append(value)
@property
def f(self): return self.F('f', self.__f)
@f.setter
def f(self, key, value): self.__f[key]=value
def __init__(self, name, node, senstype=None, num_demods=0, demods=[]):
Detector.__init__(self, name, node)
......@@ -94,13 +105,16 @@ class photodiode(Detector):
self.num_demods = num_demods
self.senstype = senstype
# every second element into f (starting at 1)
self.f(demods[::2])
# every second element into phi (starting at 2)
self.phi([1,2])
self.__f = self.F(demods[::2])
# Every second element into phi (starting at 2)
self.__phi = self.Phi()
for i in demods[1::2]:
self.phi.append(i)
self.__phi.append(i)
print self.__phi
print self.__phi[0]
@staticmethod
def parseFinesseText(text):
......
......@@ -193,6 +193,8 @@ class kat(object):
obj = pykat.components.space.parseFinesseText(line)
elif(first == "l"):
obj = pykat.components.laser.parseFinesseText(line)
elif(first[0:2] == "pd"):
obj = pykat.detectors.photodiode.parseFinesseText(line)
elif(first == "xaxis" or first == "x2axis" or first == "xaxis*" or first == "x2axis*"):
obj = pykat.commands.xaxis.parseFinesseText(line)
else:
......@@ -200,7 +202,7 @@ class kat(object):
obj = line
# manually add the line to the block contents
self.__blocks[self.__currentTag].contents.append(line)
print obj
if not isinstance(obj, str):
self.add(obj)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment