aboutsummaryrefslogtreecommitdiffstats
path: root/gui/static
diff options
context:
space:
mode:
Diffstat (limited to 'gui/static')
-rw-r--r--gui/static/js/odr-predistortion.js8
-rw-r--r--gui/static/js/odr-rcvalues.js24
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);
+ });
});
});
});