aboutsummaryrefslogtreecommitdiffstats
path: root/gui/static
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-11-28 15:14:45 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-11-28 15:14:45 +0100
commitd952405886dab44f12c1de53b57912b34320c7c8 (patch)
tree370b2dfea6f07a388ff78a5792ad63d2c155a7e3 /gui/static
parent8b42d3115db2ecec9031c5d1421463b0191e055c (diff)
downloaddabmod-d952405886dab44f12c1de53b57912b34320c7c8.tar.gz
dabmod-d952405886dab44f12c1de53b57912b34320c7c8.tar.bz2
dabmod-d952405886dab44f12c1de53b57912b34320c7c8.zip
Get calibration to show nice numbers on web page
Diffstat (limited to 'gui/static')
-rw-r--r--gui/static/js/odr-predistortion.js23
1 files changed, 19 insertions, 4 deletions
diff --git a/gui/static/js/odr-predistortion.js b/gui/static/js/odr-predistortion.js
index e13fb88..6c5f4d3 100644
--- a/gui/static/js/odr-predistortion.js
+++ b/gui/static/js/odr-predistortion.js
@@ -18,16 +18,31 @@
// 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 calibraterefresh() {
+ doApiRequestGET("/api/calibrate", function(data) {
+ var text = "Captured TX signal and feedback." +
+ " TX median: " + data['tx_median'] +
+ " RX median: " + data['rx_median'] +
+ " with relative timestamp offset " +
+ (data['tx_ts'] - data['rx_ts']) +
+ " and measured offset " + data['coarse_offset'] +
+ ". Correlation: " + data['correlation'];
+ $('#calibrationresults').text(text);
+ });
+}
+
$(function(){
+ $('#calibraterefreshbtn').click(calibraterefresh);
+
$('#calibratebtn').click(function() {
doApiRequestPOST("/api/calibrate", {}, function(data) {
console.log("calibrate succeeded: " + JSON.stringify(data));
+ $('#calibrationresults').text("Processing...");
+
setTimeout(function() {
- doApiRequestGET("/api/calibrate", function(data) {
- $('#calibrationresults').text(data);
- });
- }, 2000);
+ calibraterefresh();
+ }, 3000);
});
});