diff options
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); }); } } |