From 9bfc2070d4f51ffe972aa8270753772c9d23ebac Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 30 Jan 2015 19:07:51 +0800 Subject: [PATCH] examples/rtio_skew: show result in GUI --- examples/rtio_skew.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/examples/rtio_skew.py b/examples/rtio_skew.py index 8819d3b75..9be1078c5 100644 --- a/examples/rtio_skew.py +++ b/examples/rtio_skew.py @@ -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: - self.io_skew = out_t - in_t + raise PulseNotReceived + self.io_skew = out_t - in_t