forked from M-Labs/artiq
1
0
Fork 0

examples/rtio_skew: show result in GUI

This commit is contained in:
Sebastien Bourdeauducq 2015-01-30 19:07:51 +08:00
parent 0ebe56f595
commit 9bfc2070d4
1 changed files with 10 additions and 5 deletions

View File

@ -1,8 +1,8 @@
from artiq import *
def print_failed():
print("Pulse was not received back")
class PulseNotReceived(Exception):
pass
class RTIOSkew(AutoDB):
@ -11,6 +11,12 @@ class RTIOSkew(AutoDB):
ttl0 = Device()
io_skew = Result()
@staticmethod
def realtime_results():
return {
"io_skew": "raw"
}
@kernel
def run(self):
with parallel:
@ -21,6 +27,5 @@ class RTIOSkew(AutoDB):
self.ttl0.pulse(5*us)
in_t = self.pmt0.timestamp()
if in_t < 0*s:
print_failed()
else:
raise PulseNotReceived
self.io_skew = out_t - in_t