Commit 243e44d6 authored by Daniel Brown's avatar Daniel Brown
Browse files

changing append to extend for adding base class attribute code. Also adding...

changing append to extend for adding base class attribute code. Also adding real and imag properties to the gauss_param object to reflect that it is a complex number
parent 452ab9f9
......@@ -125,12 +125,12 @@ class Component(object):
"""Parses Finesse syntax"""
raise NotImplementedError("This function is not implemented")
@staticmethod
@abc.abstractmethod
def getFinesseText(self):
""" Base class for individual Finesse optical components """
raise NotImplementedError("This function is not implemented")
@abc.abstractmethod
def getQGraphicsItem(self):
return None
......@@ -272,7 +272,7 @@ class mirror(AbstractMirrorComponent):
self.name, self.R, self.T, self.phi,
self.nodes[0].name, self.nodes[1].name))
rtn.append(super(mirror, self).getAttributeText())
rtn.extend(super(mirror, self).getAttributeText())
return rtn
......
......@@ -446,7 +446,8 @@ class kat(object):
if txt != None:
if isinstance(txt,list):
for t in txt: out.append(t + "\n")
for t in txt:
out.append(t + "\n")
else:
out.append(txt + "\n")
......
......@@ -131,4 +131,14 @@ class gauss_param(object):
return gauss_param(self.__lambda, self.__nr, -self.__q)
def __eq__(self, q):
return complex(q) == self.__q
\ No newline at end of file
return complex(q) == self.__q
@property
def real(self): return self.__q.real
@real.setter
def real(self, value): self.__q.real = SIfloat(value)
@property
def imag(self): return self.__q.imag
@imag.setter
def imag(self, value): self.__q.imag = SIfloat(value)
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment