From e84f532b9e97dc2ad53ad96cc9543a178d6f20fd Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 25 Sep 2018 12:41:41 +0200 Subject: gui: add input to RC page, improve predistortion page --- gui/static/js/odr-rcvalues.js | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'gui/static/js/odr-rcvalues.js') diff --git a/gui/static/js/odr-rcvalues.js b/gui/static/js/odr-rcvalues.js index f40279d..81d895c 100644 --- a/gui/static/js/odr-rcvalues.js +++ b/gui/static/js/odr-rcvalues.js @@ -18,16 +18,34 @@ // You should have received a copy of the GNU General Public License // along with ODR-DabMod. If not, see . -function requestStatus(callback) { +function buttonSetRc(key, controllable, param) { + var value = $("#" + key).val(); + + setRc(controllable, param, value, function(data) { + requestStatus(); + }); +} + +function requestStatus() { $('#rctable > tbody').empty(); doApiRequestGET("/api/rc_parameters", function(data) { $.each( data, function( key1, controllable ) { $.each( controllable, function( key2, param ) { + var key = key1 + "_" + key2; + var valueentry = '' + + ''; + $('#rctable > tbody:last').append( - ''+key1+'.'+key2+''+ - ''+param['value']+''+ + ''+key+''+ + ''+valueentry+''+ ''+param['help']+''); + + $('#button'+key).click(function() { + buttonSetRc("input"+key, key1, key2); + }); }); }); }); -- cgit v1.2.3