Skip to content
Snippets Groups Projects
Commit 3a0c79e1 authored by Jure Bericic's avatar Jure Bericic
Browse files

Fixed two bugs in merge_maps.py.

parent e9ae7d5e
Branches
Tags
No related merge requests found
...@@ -58,6 +58,7 @@ class Slot: ...@@ -58,6 +58,7 @@ class Slot:
string = 'SLOT={0.ID}'.format(self) string = 'SLOT={0.ID}'.format(self)
if self.comment != '': if self.comment != '':
string += ' ! {0.comment}'.format(self) string += ' ! {0.comment}'.format(self)
string += '\n'
for k, v in self.KWs.items(): for k, v in self.KWs.items():
if v > -1: if v > -1:
string += '{}={}\n'.format(k, v) string += '{}={}\n'.format(k, v)
...@@ -107,12 +108,13 @@ header = { ...@@ -107,12 +108,13 @@ header = {
"signals": [], "signals": [],
} }
detectors = [Detector()] detectors = []
for fileName in fileNames: for fileName in fileNames:
# Track detector IDs in current file. # Track detector IDs in current file.
currentIDs = [] currentIDs = []
detectors.append(Detector())
with open(fileName, 'r') as fi: with open(fileName, 'r') as fi:
for line in fi: for line in fi:
...@@ -246,7 +248,7 @@ with open(mergedName, 'w') as fo: ...@@ -246,7 +248,7 @@ with open(mergedName, 'w') as fo:
fo.write('\n{}\n'.format(roc)) fo.write('\n{}\n'.format(roc))
for slot in roc.slots: for slot in roc.slots:
fo.write('\n{}\n'.format(slot)) fo.write('\n{}'.format(slot))
for channel in slot.channels: for channel in slot.channels:
fo.write('{}\n'.format(channel)) fo.write('{}\n'.format(channel))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment