From d952405886dab44f12c1de53b57912b34320c7c8 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Wed, 28 Nov 2018 15:14:45 +0100 Subject: Get calibration to show nice numbers on web page --- gui/static/js/odr-predistortion.js | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'gui/static') diff --git a/gui/static/js/odr-predistortion.js b/gui/static/js/odr-predistortion.js index e13fb88..6c5f4d3 100644 --- a/gui/static/js/odr-predistortion.js +++ b/gui/static/js/odr-predistortion.js @@ -18,16 +18,31 @@ // You should have received a copy of the GNU General Public License // along with ODR-DabMod. If not, see . +function calibraterefresh() { + doApiRequestGET("/api/calibrate", function(data) { + var text = "Captured TX signal and feedback." + + " TX median: " + data['tx_median'] + + " RX median: " + data['rx_median'] + + " with relative timestamp offset " + + (data['tx_ts'] - data['rx_ts']) + + " and measured offset " + data['coarse_offset'] + + ". Correlation: " + data['correlation']; + $('#calibrationresults').text(text); + }); +} + $(function(){ + $('#calibraterefreshbtn').click(calibraterefresh); + $('#calibratebtn').click(function() { doApiRequestPOST("/api/calibrate", {}, function(data) { console.log("calibrate succeeded: " + JSON.stringify(data)); + $('#calibrationresults').text("Processing..."); + setTimeout(function() { - doApiRequestGET("/api/calibrate", function(data) { - $('#calibrationresults').text(data); - }); - }, 2000); + calibraterefresh(); + }, 3000); }); }); -- cgit v1.2.3