From e352ec38c20d626a4359c684abea23ef92a41470 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 22 Jan 2019 11:50:01 +0100 Subject: GUI: Check GPSDO status --- python/gui/static/js/odr-home.js | 24 +++++++++++++++++++++--- python/gui/templates/home.html | 4 ++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/python/gui/static/js/odr-home.js b/python/gui/static/js/odr-home.js index 56c8eb4..b74c4c8 100644 --- a/python/gui/static/js/odr-home.js +++ b/python/gui/static/js/odr-home.js @@ -32,7 +32,6 @@ function apiRequestChain(uri, get_data, success_callback, fail_callback) { fail_callback(data.responseText); }, success: function(data) { - console.log("GET " + JSON.stringify(get_data) + " success: " + JSON.stringify(data)); if (data.status == 'ok') { success_callback(data.data); } @@ -109,9 +108,8 @@ function check_modulating(last_num_frames) { } else { mark_ok('is_modulating', "Number of frames modulated: " + data); - check_underrunning(0, 0); - check_late(0, 0); } + check_gpsdo_ok(); } } else { @@ -123,6 +121,26 @@ function check_modulating(last_num_frames) { }); } +function check_gpsdo_ok() { + mark_pending('is_gpsdo_ok'); + apiRequestChain("/api/parameter", + {controllable: 'sdr', param: 'gpsdo_num_sv'}, + function(data) { + if (data > 3) { + mark_ok('is_gpsdo_ok', "Number of SVs used: " + data); + } + else { + mark_fail('is_gpsdo_ok', "Number of SVs (" + data + ") is too low"); + } + check_underrunning(0, 0); + check_late(0, 0); + }, + function(data) { + mark_fail('is_gpsdo_ok', json.parse(data)['reason']); + }); +} + + function check_underrunning(iteration, first_underruns) { var n_checks = 3; diff --git a/python/gui/templates/home.html b/python/gui/templates/home.html index f89e18f..398df37 100644 --- a/python/gui/templates/home.html +++ b/python/gui/templates/home.html @@ -23,6 +23,10 @@ +
  • GPSDO status: + + +
  • Underruns: -- cgit v1.2.3