diff interfaces/ape.js @ 3063:6b95437ae672

Close #109
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Tue, 31 Oct 2017 16:21:58 +0000
parents e441e3d5c7e7
children a504a17dcf9f
line wrap: on
line diff
--- a/interfaces/ape.js	Tue Oct 31 15:55:07 2017 +0000
+++ b/interfaces/ape.js	Tue Oct 31 16:21:58 2017 +0000
@@ -341,7 +341,7 @@
             this.exportXMLDOM = function () {
                 var node = storage.document.createElement('value');
                 node.setAttribute("interface-name", axisInterface.name)
-                node.textContent = this.value();
+                node.textContent = this.value;
                 return node;
             }
             this.error = function () {
@@ -400,6 +400,9 @@
                         return label;
                     },
                     "set": function () {}
+                },
+                "metric": {
+                    "value": metric
                 }
             });
         }
@@ -558,6 +561,7 @@
             UI.startTime = undefined;
         }
         this.handleEvent = function (event) {
+            var time = audioEngineContext.timer.getTestTime();
             if (event.preventDefault) {
                 event.preventDefault();
             }
@@ -570,12 +574,14 @@
                 move = Math.max(50, move);
                 move = Math.min(w, move);
                 UI.selected.value = (move / w);
+                UI.selected.metric.moved(time, UI.selected.value);
             } else if (event.type == "touchmove") {
                 var move = event.originalEvent.targetTouches[0].clientX - 6;
                 var w = $(event.currentTarget).width();
                 move = Math.max(50, move);
                 move = Math.min(w, move);
                 UI.selected.value = (move / w);
+                UI.selected.metric.moved(time, UI.selected.value);
             }
         }
         this.checkAllMoved = function () {