+ //on top of previous channel
+ new Cube(BBX + 22, 6*Cube.EDGE_HEIGHT, BBZ + BassBox.EDGE_DEPTH , 0, 5, 0, WRL),
+ new Cube(BBX + 27, 6*Cube.EDGE_HEIGHT - 13, BBZ + BassBox.EDGE_DEPTH- 25, 0, 3, -20, WRR),
+ new Cube(BBX +5, 6*Cube.EDGE_HEIGHT - 13, BBZ + BassBox.EDGE_DEPTH -27, 0, 5, -15, WRL),
+ new Cube(BBX - 11, 6*Cube.EDGE_HEIGHT -1.5, BBZ +BassBox.EDGE_DEPTH - 11, 0, 30, 0, WRR),
+
+ //top center
+ new Cube(BBX +37, 6*Cube.EDGE_HEIGHT, BBZ + BassBox.EDGE_DEPTH +13 , 0, 15, 0, WRR),
+ new Cube(BBX + 64, 6*Cube.EDGE_HEIGHT, BBZ + BassBox.EDGE_DEPTH + 25, 0, 15, 0, WFR),
+ new Cube(BBX + 64, 6*Cube.EDGE_HEIGHT - 3, BBZ + BassBox.EDGE_DEPTH -4 , 0, 0, -30, WRL),
+ new Cube(BBX + 87.5, 6*Cube.EDGE_HEIGHT + 13, BBZ +BassBox.EDGE_DEPTH - 10, 0, 0, 0, WRL),
+
+ //top right
+ new Cube(BBX + 76, 107.5, BBZ + BassBox.EDGE_DEPTH + 23, 0, -40, 0, WRR),
+ new Cube(BBX + 98, 129, BBZ + BassBox.EDGE_DEPTH - 5, 0, 10, 0, WRR),
+ new Cube(BBX + 104, 107.5, BBZ + BassBox.EDGE_DEPTH + 17, 0, -35, 0, WRR),
+ new Cube(BBX + 129, 107.5, BBZ +BassBox.EDGE_DEPTH +10, 0, -35, 0, WFL),
+
+ new Cube(179, 4*Cube.EDGE_HEIGHT, BBZ + BassBox.EDGE_DEPTH + 14,0, -20, 0 , WFR)
+
+ // new Cube(x, y, z, rx, ry, rz, wiring),
+ };
+
+ // The bass box!
+ //BassBox bassBox = new BassBox(BBX, 0, BBZ);
+ //test for Alex, should be commented out
+
+ // The speakers!
+ //List<Speaker> speakers = Arrays.asList(new Speaker[] {
+ // each speaker parameter is x, y, z, rotation, the left speaker comes first
+ // new Speaker(-12, 6, 0, 15),
+ // new Speaker(TRAILER_WIDTH - Speaker.EDGE_WIDTH + 8, 6, 3, -15)
+ // });
+
+ //////////////////////////////////////////////////////////////////////
+ // BENEATH HERE SHOULD NOT REQUIRE ANY MODIFICATION!!!! //
+ //////////////////////////////////////////////////////////////////////
+
+ // These guts just convert the shorthand mappings into usable objects
+ ArrayList<Tower> towerList = new ArrayList<Tower>();
+ ArrayList<Cube> tower;
+ Cube[] cubes = new Cube[80];
+ int cubeIndex = 1;
+ float px, pz, ny;
+ for (TowerMapping tm : towerCubes) {
+ px = tm.x;
+ ny = tm.y;
+ pz = tm.z;
+ tower = new ArrayList<Cube>();
+ for (CubeMapping cm : tm.cubeMappings) {
+ tower.add(cubes[cubeIndex++] = new Cube(px = px + cm.dx, ny, pz = pz + cm.dz, 0, cm.ry, 0, cm.wiring));
+ ny += Cube.EDGE_HEIGHT;
+ }
+ towerList.add(new Tower(tower));
+ }
+ for (Cube cube : singleCubes) {
+ cubes[cubeIndex++] = cube;
+ }
+
+ return new Model(towerList, cubes, null, null);
+}
+
+/**
+ * This function maps the panda boards. We have an array of them, each has
+ * an IP address and a list of channels.
+ */
+public PandaMapping[] buildPandaList() {
+ final int LEFT_SPEAKER = 0;
+ final int RIGHT_SPEAKER = 1;
+
+ return new PandaMapping[] {
+ new PandaMapping(
+ // 8 maps to: 3, 4, 7, 8, 13, 14, 15, 16. So if it's J4,
+ "10.200.1.30", new ChannelMapping[] {
+ new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 20, 21, 22, 23}), //30 J3 *
+ new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 24, 25, 26, 27}), //30 J4 //ORIG *
+ new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 16, 17, 18, 19}), //30 J7 *
+ new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 39,40,41,42 }), //30 J8 *
+ new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 37, 38, 36, 35}), //30 J13
+ new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 48,49,50,51}), //30 J14
+ new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 52,53,54,55 }), // 30 J15
+ new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 56, 57, 58, 75}), // 30 J16
+ }),
+ new PandaMapping(
+ "10.200.1.29", new ChannelMapping[] {
+ new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 59,60,61,62}), //29 J3
+ new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 63, 64, 65, 66}), //29 J4
+ new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 67, 68, 69, 70 }), // 29 J7
+ new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 71,72,73,74 }), //29 J8 //XXX
+ new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 17, 18, 19, 20 }), //29 J13 //XX //bassbox
+ new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 1,1,1,1}), //29 J14
+ new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 37, 38, 39, 35}), //29 J15
+ new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 16, 17,18,19 }), //29 J16
+ }),
+ new PandaMapping(
+ "10.200.1.28", new ChannelMapping[] {
+ new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 1,1,1,1}), //28 J3
+ new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 1,1,1,1}), //28 J4
+ new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 1, 1, 1, 1 }), //28 J7
+ new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 13, 14 , 15, 16 }), //28 J8
+ new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 8,9,10,11 }), //28 J13
+ new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 33,34,32,31}), //28 J14
+ new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 12, 13, 14, 15 }), //28 J15
+ new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 28, 29, 30, 1}), //28 J16
+ }),
+ };
+
+}
+
+
+
+class TowerMapping {
+ public final float x, y, z;
+ public final CubeMapping[] cubeMappings;
+
+ TowerMapping(float x, float y, float z, CubeMapping[] cubeMappings) {
+ this.x = x;
+ this.y = y;
+ this.z = z;
+ this.cubeMappings = cubeMappings;