Skip to content

Commit

Permalink
pxi6733: minor mediator fixes
Browse files Browse the repository at this point in the history
sbourdeauducq committed Sep 5, 2015
1 parent 63d4907 commit 2921bd6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions artiq/devices/pxi6733/mediator.py
Original file line number Diff line number Diff line change
@@ -58,6 +58,9 @@ def add_line(self, duration, channel_data):
raise ArmError
self.lines.append((duration, channel_data))

def get_sample_count(self):
return sum(duration for duration, _ in self.lines)

@kernel
def advance(self):
if self.frame.invalidated:
@@ -107,13 +110,13 @@ def _invalidate(self):
self.invalidated = True

def _get_samples(self):
program = [
program = [[
{
"dac_divider": 1,
"duration": duration,
"channel_data": channel_data,
} for duration, channel_data in segment.lines
for segment in self.segments]
} for segment in self.segments
for duration, channel_data in segment.lines]]
synth = Synthesizer(self.daqmx.channel_count, program)
synth.select(0)
# not setting any trigger flag in the program causes the whole
@@ -145,7 +148,7 @@ def __init__(self, dmgr, daqmx_device, clock_device, channel_count,
self.daqmx = dmgr.get(daqmx_device)
self.clock = dmgr.get(clock_device)
self.channel_count = channel_count
if self.sample_rate_in_mu:
if sample_rate_in_mu:
self.sample_rate = sample_rate
else:
self.sample_rate = self.clock.frequency_to_ftw(sample_rate)

0 comments on commit 2921bd6

Please sign in to comment.