diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-12-12 09:16:25 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-12-12 09:16:25 +0100 |
commit | fb17763e266d8cea1569d3e51404b3e62835f7f4 (patch) | |
tree | a9b8c3a9beaf6658ae3e64220a88ea8002880028 /python/gui/static | |
parent | 8ddc109a649899ab6a0b673908186a39c75c8f71 (diff) | |
download | dabmod-fb17763e266d8cea1569d3e51404b3e62835f7f4.tar.gz dabmod-fb17763e266d8cea1569d3e51404b3e62835f7f4.tar.bz2 dabmod-fb17763e266d8cea1569d3e51404b3e62835f7f4.zip |
GUI: Try to get RC params working again
Diffstat (limited to 'python/gui/static')
-rw-r--r-- | python/gui/static/js/odr-rcvalues.js | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/python/gui/static/js/odr-rcvalues.js b/python/gui/static/js/odr-rcvalues.js index f49674c..a3a5e07 100644 --- a/python/gui/static/js/odr-rcvalues.js +++ b/python/gui/static/js/odr-rcvalues.js @@ -31,18 +31,21 @@ function requestStatus() { doApiRequestGET("/api/rc_parameters", function(data) { console.log(data); - let keys = Object.keys(data); - keys.sort(); + let controllable_names = Object.keys(data); + controllable_names.sort(); var key1; - for (key1 in keys) { - let keys2 = Object.keys(data[keys[key1]]); - keys2.sort(); + for (key1 in controllable_names) { + let param_names = Object.keys(data[controllable_names[key1]]); + param_names.sort(); var key2; - for (key2 in keys2) { - var param = data[keys[key1]][keys2[key2]]; - var key = keys[key1] + "_" + keys2[key2]; + for (key2 in param_names) { + var name_controllable = controllable_names[key1]; + var name_param = param_names[key2]; + var key = name_controllable + "_" + name_param; + + var param = data[name_controllable][name_param]; var valueentry = '<input type="text" id="input'+key+'" ' + 'value="' + param['value'] + '">' + '<button type="button" class="btn btn-xs btn-warning"' + @@ -53,8 +56,10 @@ function requestStatus() { '<td>'+valueentry+'</td>'+ '<td>'+param['help']+'</td></tr>'); + $('#button'+key).click(function() { - buttonSetRc("input"+key, key1, key2); + console.log("trigger " + key + " with " + name_controllable + " " + name_param); + buttonSetRc("input"+key, name_controllable, name_param); }); } } |