Skip to content

Commit

Permalink
Add basic meta program output.
Browse files Browse the repository at this point in the history
  • Loading branch information
blakejohnson committed Aug 1, 2016
1 parent 4389644 commit 31bdedc
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions QGL/Compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from copy import copy
from functools import reduce
from importlib import import_module
import json

from . import config
from . import PatternUtils
Expand Down Expand Up @@ -380,7 +381,7 @@ def compile_to_hardware(seqs,
awgData = bundle_wires(physWires, wfs)

# convert to hardware formats
fileList = []
files = {}
for awgName, data in awgData.items():
# create the target folder if it does not exist
targetFolder = os.path.split(os.path.normpath(os.path.join(
Expand All @@ -392,10 +393,25 @@ def compile_to_hardware(seqs,
'seqFileExt']))
data['translator'].write_sequence_file(data, fullFileName)

fileList.append(fullFileName)
files[awgName] = fullFileName

# create meta output
axis_descriptor = {
'name': 'segment',
'unit': None,
'points': list(range(1, 1+len(seqs)))
}
meta = {
'instruments': files,
'num_sequences': len(seqs),
'axis_descriptor': axis_descriptor
}
metafilepath = os.path.join(config.AWGDir, fileName + '-meta.json')
with open(metafilepath, 'w') as FID:
json.dump(meta, FID, indent=2, sort_keys=True)

# Return the filenames we wrote
return fileList
return list(files.values())


def compile_sequences(seqs, channels=set(), qgl2=False):
Expand Down

0 comments on commit 31bdedc

Please sign in to comment.