Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
......@@ -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")
......
......@@ -132,3 +132,13 @@ class gauss_param(object):
def __eq__(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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment