- private ArrayList<Integer> buildMappedList(Model model, int[][] channelList) {
- ArrayList<Integer> points = new ArrayList<Integer>();
- 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;
- if (cubeNumber == 0) {
- for (int i = 0; i < (Cube.FACES_PER_CUBE*Face.STRIPS_PER_FACE*Strip.POINTS_PER_STRIP); ++i) {
- points.add(0);
+ public PandaDriver(String ip, Model model, PandaMapping pm) {
+ this(ip);
+ buildPointList(model, pm);
+ }
+
+ public void toggle() {
+ enabled = !enabled;
+ println("PandaBoard/" + ip + ": " + (enabled ? "ON" : "OFF"));
+ }
+
+ private void buildPointList(Model model, PandaMapping pm) {
+ int pi = 0;
+ for (int[] channel : pm.channelList) {
+ for (int cubeNumber : channel) {
+ if (cubeNumber <= 0) {
+ for (int i = 0; i < Cube.POINTS_PER_CUBE; ++i) {
+ points[pi++] = 0;