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

fixing senstype error for qshot, altering parseCommands so that commands can...

fixing senstype error for qshot, altering parseCommands so that commands can be parsed into a particular block
parent 5acb7b08
No related branches found
No related tags found
No related merge requests found
......@@ -729,7 +729,7 @@ class qnoised(pd):
class qshot(pd):
def __init__(self, name, num_demods, node_name, alternate_beam=False, **kwargs):
super(qshot, self).__init__(name, num_demods, node_name, alternate_beam=alternate_beam, pdtype=None, senstype=None, **kwargs)
super(qshot, self).__init__(name, num_demods, node_name, alternate_beam=alternate_beam, pdtype=None, **kwargs)
@pd.pdtype.setter
def pdtype(self, value):
......
......@@ -689,8 +689,16 @@ class kat(object):
del self.__blocks[name]
def parseCommands(self, commands, blocks=None):
def parseCommands(self, commands, blocks=None, addToBlock=None):
try:
if addToBlock is not None and blocks is not None:
raise pkex.BasePyKatException("When parsing commands you cannot set both blocks and addToBlock arguments")
# Create a new block if one asked for isn't present
if addToBlock is not None:
if addToBlock not in self.__blocks:
self.__blocks[addToBlock] = Block(addToBlock)
blockComment = False
commands=self.remove_comments(commands)
......@@ -707,6 +715,7 @@ class kat(object):
# Looking for block start or end
values = line.split()
if addToBlock is None:
if values[0] == "%%%":
if values[1] == "FTblock":
newTag = values[2]
......@@ -724,6 +733,8 @@ class kat(object):
self.__currentTag = NO_BLOCK
continue
else:
self.__currentTag = addToBlock
# only include listed blocks, if we have specfied them
if blocks != None and self.__currentTag not in blocks:
......@@ -775,6 +786,7 @@ class kat(object):
elif(first == "qnoised" or first == "qnoisedS" or first == "qnoisedN"):
obj = pykat.detectors.qnoised.parseFinesseText(line)
elif(first == "xaxis" or first == "xaxis*"):
self.noxaxis = False
obj = pykat.commands.xaxis.parseFinesseText(line)
elif(first[0:2] == "hd"):
obj = pykat.detectors.hd.parseFinesseText(line)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment