X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=_Internals.pde;h=e2c343a243521e1c7c9096cf0c0b11c6a6e03cd7;hb=79ae8245d084fe7901933b22a44b404f9d68b925;hp=abfe6be9c22eb11013bfec53b1b2936b3f6576ab;hpb=0ba6ac440fc4901d11d90f7bef6e6da770bd6911;p=SugarCubes.git diff --git a/_Internals.pde b/_Internals.pde index abfe6be..e2c343a 100644 --- a/_Internals.pde +++ b/_Internals.pde @@ -56,12 +56,8 @@ LXEffect[] effects; OverlayUI ui; ControlUI controlUI; MappingUI mappingUI; -PandaDriver pandaFront; -PandaDriver pandaRear; +PandaDriver[] pandaBoards; boolean mappingMode = false; - -boolean pandaBoardsEnabled = false; - boolean debugMode = false; DebugUI debugUI; @@ -96,8 +92,10 @@ void setup() { int[][] frontChannels = glucose.mapping.buildFrontChannelList(); int[][] rearChannels = glucose.mapping.buildRearChannelList(); mappingTool = new MappingTool(glucose, frontChannels, rearChannels); - pandaFront = new PandaDriver(new NetAddress("192.168.1.28", 9001), glucose.model, frontChannels); - pandaRear = new PandaDriver(new NetAddress("192.168.1.29", 9001), glucose.model, rearChannels); + pandaBoards = new PandaDriver[] { + new PandaDriver("10.200.1.28", glucose.model, frontChannels), + new PandaDriver("10.200.1.29", glucose.model, rearChannels), + }; logTime("Build PandaDriver"); // Build overlay UI @@ -212,9 +210,8 @@ void draw() { } // TODO(mcslee): move into GLucose engine - if (pandaBoardsEnabled) { - pandaFront.send(colors); - // pandaRear.send(colors); + for (PandaDriver p : pandaBoards) { + p.send(colors); } } @@ -303,8 +300,9 @@ void keyPressed() { } break; case 'p': - pandaBoardsEnabled = !pandaBoardsEnabled; - println("PandaBoard Output: " + (pandaBoardsEnabled ? "ON" : "OFF")); + for (PandaDriver p : pandaBoards) { + p.toggle(); + } break; case 'u': uiOn = !uiOn; @@ -313,11 +311,9 @@ void keyPressed() { } int mx, my; - void mousePressed() { - if (mouseX > ui.leftPos) { - ui.mousePressed(); - } else { + ui.mousePressed(); + if (mouseX < ui.leftPos) { if (debugMode) { debugUI.mousePressed(); } @@ -342,9 +338,7 @@ void mouseDragged() { } void mouseReleased() { - if (mouseX > ui.leftPos) { - ui.mouseReleased(); - } + ui.mouseReleased(); } void mouseWheel(int delta) {