X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=_PandaDriver.pde;fp=_PandaDriver.pde;h=c95f9b0ed301efbdced58bcafbd09eda5fee3d51;hb=045b432d2b2bb8accd36080f3e501be60ff32782;hp=d90613e9de483b4c04ab8cebd5641edd87919f20;hpb=45f43cc2debb7f90b01e7a5c7d355218ab9cdeed;p=SugarCubes.git diff --git a/_PandaDriver.pde b/_PandaDriver.pde index d90613e..c95f9b0 100644 --- a/_PandaDriver.pde +++ b/_PandaDriver.pde @@ -31,12 +31,6 @@ public class PandaDriver { // List of point indices on the board private final int[] points; - // How many channels are on the panda board - private final static int CHANNELS_PER_BOARD = 8; - - // How many cubes per channel xc_PB is configured for - private final static int CUBES_PER_CHANNEL = 4; - // Packet data private final byte[] packet = new byte[4*352]; // TODO: de-magic-number, UDP related? @@ -54,15 +48,13 @@ public class PandaDriver { public void toggle() { enabled = !enabled; - println("PandaBoard Output/" + ip + ": " + (enabled ? "ON" : "OFF")); + println("PandaBoard/" + ip + ": " + (enabled ? "ON" : "OFF")); } private ArrayList buildMappedList(Model model, int[][] channelList) { ArrayList points = new ArrayList(); - for (int chi = 0; chi < CHANNELS_PER_BOARD; ++chi) { - int[] channel = (chi < channelList.length) ? channelList[chi] : new int[]{}; - for (int ci = 0; ci < CUBES_PER_CHANNEL; ++ci) { - int cubeNumber = (ci < channel.length) ? channel[ci] : 0; + for (int[] channel : channelList) { + for (int cubeNumber : channel) { if (cubeNumber == 0) { for (int i = 0; i < Cube.POINTS_PER_CUBE; ++i) { points.add(0);