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/static/js | |
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/static/js')
-rw-r--r-- | gui/static/js/odr-predistortion.js | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/gui/static/js/odr-predistortion.js b/gui/static/js/odr-predistortion.js index 6b09202..4e86f1c 100644 --- a/gui/static/js/odr-predistortion.js +++ b/gui/static/js/odr-predistortion.js @@ -22,9 +22,6 @@ $(function(){ $('#capturebutton').click(function() { doApiRequestPOST("/api/trigger_capture", {}, function(data) { console.log("trigger_capture succeeded: " + JSON.stringify(data)); - $('#capturelength').text(data.length); - $('#tx_median').text(data.tx_median); - $('#rx_median').text(data.rx_median); }); }); @@ -32,7 +29,33 @@ $(function(){ doApiRequestGET("/api/dpd_status", function(data) { console.log("dpd_status succeeded: " + JSON.stringify(data)); $('#histogram').text(data.histogram); + $('#capturestatus').text(data.capture.status); + $('#capturelength').text(data.capture.length); + $('#tx_median').text(data.capture.tx_median); + $('#rx_median').text(data.capture.rx_median); }); + + $.ajax({ + type: "GET", + url: "/api/dpd_capture_pointcloud", + + error: function(data) { + if (data.status == 500) { + var errorWindow = window.open("", "_self"); + errorWindow.document.write(data.responseText); + } + else { + $.gritter.add({ title: 'API', + text: "AJAX failed: " + data.statusText, + image: '/fonts/warning.png', + sticky: true, + }); + } + }, + success: function(data) { + $('#dpd_pointcloud').value(data) + } + }) }); }); |