diff options
-rw-r--r-- | python/gui/static/js/odr-rcvalues.js | 23 | ||||
-rw-r--r-- | python/gui/templates/predistortion.html | 10 |
2 files changed, 21 insertions, 12 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); }); } } diff --git a/python/gui/templates/predistortion.html b/python/gui/templates/predistortion.html index f9af2f1..16e9879 100644 --- a/python/gui/templates/predistortion.html +++ b/python/gui/templates/predistortion.html @@ -32,10 +32,14 @@ along with ODR-DabMod. If not, see <http://www.gnu.org/licenses/>. <div class="panel-heading">Status and calibration</div> <div class="panel-body"> <div>Current DPDCE status: - <span id="dpdstatus" style="font-weight:bold;">N/A</span> - <div id="dpdprogress" class="progress-bar" role="progressbar" style="width:0%"> - <span id="dpdprogresstext"></span> + <div> + <div id="dpdstatus" style="font-weight:bold;">N/A</div> + <div class="progress"> + <div id="dpdprogress" class="progress-bar" role="progressbar" style="width:0%"> + <span id="dpdprogresstext"></span> + </div> </div> + </div> <div class="well well-sm" id="dpdresults">N/A</div> </div> |