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