get JS source functions working across threads

This commit is contained in:
Brad Hefta-Gaub 2015-10-17 14:14:45 -07:00
parent 7956d737ab
commit 8578b40236
2 changed files with 4 additions and 3 deletions

View file

@ -29,6 +29,9 @@ if (hydra !== undefined) {
var mapping = Controller.newMapping("Test");
var standard = Controller.Standard;
print("standard:" + standard);
mapping.from(function () { return Math.sin(Date.now() / 250); }).to(function (newValue, oldValue, source) {
print("function source newValue:" + newValue + ", oldValue:" + oldValue + ", source:" + source);
});
mapping.from(hydra.L1).to(standard.A);
mapping.from(hydra.L2).to(standard.B);
mapping.from(hydra.L3).to(function (newValue, oldValue, source) {

View file

@ -62,9 +62,7 @@ namespace controller {
};
float ScriptEndpoint::value() {
if (QThread::currentThread() == thread()) {
updateValue();
}
updateValue();
return _lastValue;
}