diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-11-28 09:38:05 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-11-28 09:38:05 +0100 |
commit | ee435c029eac59e0399dc3ae765cc74d66b9442e (patch) | |
tree | cdd01efdb5f137a924559dcfbe55833247fc1493 /gui/dpd/__init__.py | |
parent | 64898e72aacd26d1dfb3b925fab571d658ad5af4 (diff) | |
download | dabmod-ee435c029eac59e0399dc3ae765cc74d66b9442e.tar.gz dabmod-ee435c029eac59e0399dc3ae765cc74d66b9442e.tar.bz2 dabmod-ee435c029eac59e0399dc3ae765cc74d66b9442e.zip |
GUI: Use cherry bus to communicate internally
Diffstat (limited to 'gui/dpd/__init__.py')
-rw-r--r-- | gui/dpd/__init__.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/gui/dpd/__init__.py b/gui/dpd/__init__.py index 8dd0807..06d180d 100644 --- a/gui/dpd/__init__.py +++ b/gui/dpd/__init__.py @@ -47,19 +47,25 @@ class DPD: r['capture'] = self.last_capture_info return r + def pointcloud_png(self): + return self.capture.pointcloud_png() + def capture_samples(self): """Captures samples and store them in the accumulated samples, returns a dict with some info""" + result = {} try: txframe_aligned, tx_ts, tx_median, rxframe_aligned, rx_ts, rx_median = self.capture.get_samples() - self.last_capture_info['length'] = len(txframe_aligned) - self.last_capture_info['tx_median'] = float(tx_median) - self.last_capture_info['rx_median'] = float(rx_median) - self.last_capture_info['tx_ts'] = tx_ts - self.last_capture_info['rx_ts'] = rx_ts - return self.last_capture_info + result['status'] = "ok" + result['length'] = len(txframe_aligned) + result['tx_median'] = float(tx_median) + result['rx_median'] = float(rx_median) + result['tx_ts'] = tx_ts + result['rx_ts'] = rx_ts except ValueError as e: - raise ValueError("Capture failed: {}".format(e)) + result['status'] = "Capture failed: {}".format(e) + + self.last_capture_info = result # tx, rx, phase_diff, n_per_bin = extStat.extract(txframe_aligned, rxframe_aligned) # off = SA.calc_offset(txframe_aligned) |