Merge branch 'master' of github.com:m-labs/artiq

This commit is contained in:
Sebastien Bourdeauducq 2016-02-25 01:25:31 +08:00
commit 6b28b8e36e
2 changed files with 8 additions and 5 deletions

View File

@ -103,6 +103,9 @@ class _Frame:
def _get_program(self):
r = []
for segment in self.segments:
if segment.duration < 2*trigger_duration:
raise ValueError(("Segment too short ({:g} s), trigger might "
"spill").format(segment.duration))
segment_program = [
{
"dac_divider": dac_divider,
@ -168,10 +171,10 @@ class CompoundPDQ2:
def disarm(self):
for frame in self.frames:
frame._invalidate()
self.frames = []
self.armed = False
self.frames.clear()
for dev in self.pdq2s:
dev.park()
self.armed = False
def get_program(self):
return [f._get_program() for f in self.frames]
@ -181,7 +184,6 @@ class CompoundPDQ2:
raise ArmError()
for frame in self.frames:
frame._arm()
self.armed = True
full_program = self.get_program()
n = 0
@ -203,6 +205,7 @@ class CompoundPDQ2:
n += dn
for pdq2 in self.pdq2s:
pdq2.unpark()
self.armed = True
def create_frame(self):
if self.armed:

View File

@ -17,8 +17,8 @@ class Transport(EnvExperiment):
self.setattr_argument("wait_at_stop", NumberValue(100*us))
self.setattr_argument("speed", NumberValue(1/(10*us)))
self.setattr_argument("repeats", NumberValue(100))
self.setattr_argument("bins", NumberValue(100))
self.repeats = int(self.get_argument("repeats", NumberValue(100)))
self.bins = int(self.get_argument("bins", NumberValue(100)))
t = np.linspace(0, 10, 101) # waveform time
u = 1 - np.cos(np.pi*t/t[-1])