From ee435c029eac59e0399dc3ae765cc74d66b9442e Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Wed, 28 Nov 2018 09:38:05 +0100 Subject: GUI: Use cherry bus to communicate internally --- gui/static/js/odr-predistortion.js | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'gui/static/js') 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) + } + }) }); }); -- cgit v1.2.3