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): ...@@ -125,12 +125,12 @@ class Component(object):
"""Parses Finesse syntax""" """Parses Finesse syntax"""
raise NotImplementedError("This function is not implemented") raise NotImplementedError("This function is not implemented")
@staticmethod
@abc.abstractmethod @abc.abstractmethod
def getFinesseText(self): def getFinesseText(self):
""" Base class for individual Finesse optical components """ """ Base class for individual Finesse optical components """
raise NotImplementedError("This function is not implemented") raise NotImplementedError("This function is not implemented")
@abc.abstractmethod
def getQGraphicsItem(self): def getQGraphicsItem(self):
return None return None
...@@ -272,7 +272,7 @@ class mirror(AbstractMirrorComponent): ...@@ -272,7 +272,7 @@ class mirror(AbstractMirrorComponent):
self.name, self.R, self.T, self.phi, self.name, self.R, self.T, self.phi,
self.nodes[0].name, self.nodes[1].name)) self.nodes[0].name, self.nodes[1].name))
rtn.append(super(mirror, self).getAttributeText()) rtn.extend(super(mirror, self).getAttributeText())
return rtn return rtn
......
...@@ -446,7 +446,8 @@ class kat(object): ...@@ -446,7 +446,8 @@ class kat(object):
if txt != None: if txt != None:
if isinstance(txt,list): if isinstance(txt,list):
for t in txt: out.append(t + "\n") for t in txt:
out.append(t + "\n")
else: else:
out.append(txt + "\n") out.append(txt + "\n")
......
...@@ -132,3 +132,13 @@ class gauss_param(object): ...@@ -132,3 +132,13 @@ class gauss_param(object):
def __eq__(self, q): def __eq__(self, q):
return complex(q) == self.__q 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
Supports Markdown
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