History

fix thread safety issue on JS based fliters

Brad Hefta-Gaub committed 11 years ago

Commit 7956d731 parent 7d48fe95 files · +74 −26Browse files

Showing the changes to examples/example/scripts/controllerScriptingExamples.js (1 of 5 files). Show all

Unified · Split

examples/example/scripts/controllerScriptingExamples.js+10−6
@@ -23,17 +23,21 @@ function findAction(name) { · 22 unmodified lines
23}23}
24 24
25 25
26var hydra = Controller.Hardware.Hydra2;26var hydra = Controller.Hardware.Hydra;
27if (hydra !== undefined) {27if (hydra !== undefined) {
28 print("-----------------------------------");28 print("-----------------------------------");
29 var mapping = NewControllers.newMapping("Default");29 var mapping = Controller.newMapping("Test");
30 var standard = Controller.Standard;30 var standard = Controller.Standard;
31 print("standard:" + standard);31 print("standard:" + standard);
32 mapping.from(hydra.LeftButton1).to(standard.A);32 mapping.from(hydra.L1).to(standard.A);
33 mapping.from(hydra.LeftButton2).to(standard.B);33 mapping.from(hydra.L2).to(standard.B);
34 mapping.from(hydra.LeftButton3).to(standard.X);34 mapping.from(hydra.L3).to(function (newValue, oldValue, source) {
35 NewControllers.enableMapping("Default");35 print("hydra.L3 newValue:" + newValue + ", oldValue:" + oldValue + ", source:" + source);
36 });
37 Controller.enableMapping("Test");
36 print("-----------------------------------");38 print("-----------------------------------");
39} else {
40 print("couldn't find hydra");
37}41}
38 42
39Object.keys(Controller.Standard).forEach(function (input) {43Object.keys(Controller.Standard).forEach(function (input) {