Skip to content

Commit 2921bd6

Browse files
committedSep 5, 2015
pxi6733: minor mediator fixes
1 parent 63d4907 commit 2921bd6

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed
 

Diff for: ‎artiq/devices/pxi6733/mediator.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ def add_line(self, duration, channel_data):
5858
raise ArmError
5959
self.lines.append((duration, channel_data))
6060

61+
def get_sample_count(self):
62+
return sum(duration for duration, _ in self.lines)
63+
6164
@kernel
6265
def advance(self):
6366
if self.frame.invalidated:
@@ -107,13 +110,13 @@ def _invalidate(self):
107110
self.invalidated = True
108111

109112
def _get_samples(self):
110-
program = [
113+
program = [[
111114
{
112115
"dac_divider": 1,
113116
"duration": duration,
114117
"channel_data": channel_data,
115-
} for duration, channel_data in segment.lines
116-
for segment in self.segments]
118+
} for segment in self.segments
119+
for duration, channel_data in segment.lines]]
117120
synth = Synthesizer(self.daqmx.channel_count, program)
118121
synth.select(0)
119122
# 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,
145148
self.daqmx = dmgr.get(daqmx_device)
146149
self.clock = dmgr.get(clock_device)
147150
self.channel_count = channel_count
148-
if self.sample_rate_in_mu:
151+
if sample_rate_in_mu:
149152
self.sample_rate = sample_rate
150153
else:
151154
self.sample_rate = self.clock.frequency_to_ftw(sample_rate)

0 commit comments

Comments
 (0)