summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-12-12 09:16:25 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-12-12 09:16:25 +0100
commitfb17763e266d8cea1569d3e51404b3e62835f7f4 (patch)
treea9b8c3a9beaf6658ae3e64220a88ea8002880028
parent8ddc109a649899ab6a0b673908186a39c75c8f71 (diff)
downloaddabmod-fb17763e266d8cea1569d3e51404b3e62835f7f4.tar.gz
dabmod-fb17763e266d8cea1569d3e51404b3e62835f7f4.tar.bz2
dabmod-fb17763e266d8cea1569d3e51404b3e62835f7f4.zip
GUI: Try to get RC params working again
-rw-r--r--python/gui/static/js/odr-rcvalues.js23
-rw-r--r--python/gui/templates/predistortion.html10
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>