From 2b3cf8e158901ae7d20dd330c34a14947191606e Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 22 Jan 2019 11:40:26 +0100 Subject: GUI: Check for late packets --- python/gui/static/js/odr-home.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'python/gui/static/js/odr-home.js') diff --git a/python/gui/static/js/odr-home.js b/python/gui/static/js/odr-home.js index 2fa873a..56c8eb4 100644 --- a/python/gui/static/js/odr-home.js +++ b/python/gui/static/js/odr-home.js @@ -110,6 +110,7 @@ function check_modulating(last_num_frames) { else { mark_ok('is_modulating', "Number of frames modulated: " + data); check_underrunning(0, 0); + check_late(0, 0); } } } @@ -151,6 +152,34 @@ function check_underrunning(iteration, first_underruns) { }); } +function check_late(iteration, first_late) { + var n_checks = 3; + + apiRequestChain("/api/parameter", + {controllable: 'sdr', param: 'latepackets'}, + function(data) { + if (iteration == 0) { + mark_pending('is_late', "Checking for late packets"); + setTimeout(function() { check_late(iteration+1, data); }, 2000); + } + else if (iteration < n_checks) { + mark_pending('is_late', "Check " + iteration + "/" + n_checks + "..."); + setTimeout(function() { check_late(iteration+1, first_late); }, 2000); + } + else { + if (data == first_late) { + mark_ok('is_late', "Number of late packets is not increasing: " + data); + } + else { + mark_fail('is_late', "Late packets observed in last " + n_checks + " seconds: " + data); + } + } + }, + function(data) { + mark_fail('is_late', data); + }); +} + function check_rate_4x() { mark_pending('is_rate_4x'); apiRequestChain("/api/parameter", -- cgit v1.2.3