diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-09-25 12:41:41 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-09-25 12:41:41 +0200 |
commit | e84f532b9e97dc2ad53ad96cc9543a178d6f20fd (patch) | |
tree | edcf5bd3290e18597e02cbde77f78b4329d5d95b /gui/static/js | |
parent | d5afedae5f31a6b4c8052b12af9279e609ac5f20 (diff) | |
download | dabmod-e84f532b9e97dc2ad53ad96cc9543a178d6f20fd.tar.gz dabmod-e84f532b9e97dc2ad53ad96cc9543a178d6f20fd.tar.bz2 dabmod-e84f532b9e97dc2ad53ad96cc9543a178d6f20fd.zip |
gui: add input to RC page, improve predistortion page
Diffstat (limited to 'gui/static/js')
-rw-r--r-- | gui/static/js/odr-predistortion.js | 8 | ||||
-rw-r--r-- | gui/static/js/odr-rcvalues.js | 24 |
2 files changed, 27 insertions, 5 deletions
diff --git a/gui/static/js/odr-predistortion.js b/gui/static/js/odr-predistortion.js index c9b5c17..6b09202 100644 --- a/gui/static/js/odr-predistortion.js +++ b/gui/static/js/odr-predistortion.js @@ -21,13 +21,17 @@ $(function(){ $('#capturebutton').click(function() { doApiRequestPOST("/api/trigger_capture", {}, function(data) { - $('#capturelength').val(data.length); + console.log("trigger_capture succeeded: " + JSON.stringify(data)); + $('#capturelength').text(data.length); + $('#tx_median').text(data.tx_median); + $('#rx_median').text(data.rx_median); }); }); $('#dpdstatusbutton').click(function() { doApiRequestGET("/api/dpd_status", function(data) { - $('#dpdstatus').val(data); + console.log("dpd_status succeeded: " + JSON.stringify(data)); + $('#histogram').text(data.histogram); }); }); }); 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 <http://www.gnu.org/licenses/>. -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 = '<input type="text" id="input'+key+'" ' + + 'value="' + param['value'] + '">' + + '<button type="button" class="btn btn-xs btn-warning"' + + 'id="button'+key+'" >upd</button>'; + $('#rctable > tbody:last').append( - '<tr><td>'+key1+'.'+key2+'</td>'+ - '<td>'+param['value']+'</td>'+ + '<tr><td>'+key+'</td>'+ + '<td>'+valueentry+'</td>'+ '<td>'+param['help']+'</td></tr>'); + + $('#button'+key).click(function() { + buttonSetRc("input"+key, key1, key2); + }); }); }); }); |