Skip to content

Commit

Permalink
test/coredevice/test_pulses: fix first_timestamp
Browse files Browse the repository at this point in the history
sbourdeauducq committed Dec 29, 2015
1 parent 9d7d614 commit aa29def
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions artiq/test/coredevice/portability.py
Original file line number Diff line number Diff line change
@@ -58,13 +58,14 @@ def run(self):
class _PulseLogger(EnvExperiment):
def build(self):
self.setattr_device("core")
self.setattr_argument("output_list")
self.setattr_argument("parent_test")
self.setattr_argument("name")

def _append(self, t, l, f):
if not hasattr(self, "first_timestamp"):
self.first_timestamp = t
self.output_list.append((self.name, t-self.first_timestamp, l, f))
if not hasattr(self.parent_test, "first_timestamp"):
self.parent_test.first_timestamp = t
self.parent_test.output_list.append(
(self.name, t-self.parent_test.first_timestamp, l, f))

def int_usec(self, mu):
return round(mu_to_seconds(mu, self.core)*1000000)
@@ -89,7 +90,7 @@ def build(self):

for name in "a", "b", "c", "d":
pl = _PulseLogger(*self.managers(),
output_list=self.output_list,
parent_test=self,
name=name)
setattr(self, name, pl)

0 comments on commit aa29def

Please sign in to comment.