From 270a8b44cd8296bb40fa74e4fcf2e7f7c4f1192c Mon Sep 17 00:00:00 2001 From: Mark Slee Date: Sat, 23 Nov 2013 16:02:48 -0800 Subject: [PATCH] Mapping for Asana hackathon --- _Internals.pde | 3 -- _Mappings.pde | 105 +++++++++++++++++++++++++++-------------------- _PandaDriver.pde | 9 +++- 3 files changed, 68 insertions(+), 49 deletions(-) diff --git a/_Internals.pde b/_Internals.pde index 61c453e..425ea0e 100644 --- a/_Internals.pde +++ b/_Internals.pde @@ -36,9 +36,6 @@ final float TRAILER_WIDTH = 240; final float TRAILER_DEPTH = 97; final float TRAILER_HEIGHT = 33; -final int MaxCubeHeight = 7; -final int NumBackTowers = 18; - int targetFramerate = 60; int startMillis, lastMillis; diff --git a/_Mappings.pde b/_Mappings.pde index 435ca90..6877e63 100644 --- a/_Mappings.pde +++ b/_Mappings.pde @@ -13,6 +13,9 @@ * when physical changes or tuning is being done to the structure. */ +final int MaxCubeHeight = 6; +final int NumBackTowers = 16; + public Model buildModel() { // Shorthand helpers for specifying wiring more quickly @@ -24,8 +27,6 @@ public Model buildModel() { // Utility value if you need the height of a cube shorthand final float CH = Cube.EDGE_HEIGHT; final float CW = Cube.EDGE_WIDTH ; - - // Positions for the bass box final float BBY = BassBox.EDGE_HEIGHT + BoothFloor.PLEXI_WIDTH; @@ -79,14 +80,14 @@ public Model buildModel() { for (int i=0; i(); for (int i=0; i < st.n; i++) { Cube.Wiring w = (i < st.wiring.length) ? st.wiring[i] : WRR; @@ -239,48 +240,62 @@ public PandaMapping[] buildPandaList() { return new PandaMapping[] { new PandaMapping( "10.200.1.28", new ChannelMapping[] { - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 16, 17, 18}), - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { }), - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 1, 2, 3}), - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 4, 5, 6}), - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 7, 8, 9}), - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 10, 11, 12}), - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 13, 14, 15}), - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { }), + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 37, 38, 39 }), + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { }), + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 43, 44, 45 }), + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 46, 47, 48 }), + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { }), // new front thing + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { }), // new back thing + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 13, 14, 15 }), // new back thing }), new PandaMapping( "10.200.1.29", new ChannelMapping[] { - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 34, 35, 36}), - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { }), - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 19, 20, 21}), - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 22, 23, 24}), - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 25, 26, 27}), - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 28, 29, 30}), - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 31, 32, 33}), - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { }), + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 19, 20, 21 }), + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { }), + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 1, 2, 3 }), + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 4, 5, 6 }), + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 7, 8, 9 }), + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 10, 11, 12 }), + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 16, 17, 18 }), +// new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 34, 35, 36}), +// new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { }), +// new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 19, 20, 21}), +// new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 22, 23, 24}), +// new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 25, 26, 27}), +// new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 28, 29, 30}), +// new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 31, 32, 33}), +// new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { }), }), new PandaMapping( "10.200.1.30", new ChannelMapping[] { - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 1,1,1}), // 30 J3 * - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 1,1,1}), // 30 J4 //ORIG * - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 37, 38, 39}), // 30 J7 * - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 40, 41, 42}), // 30 J8 * - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 43, 44, 45}), // 30 J13 (not working) - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 46, 47, 48}), // 30 J14 (unplugged) - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 49, 50, 51}), // 30 J15 (unplugged) - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 52, 53, 54}), // 30 J16 + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 40, 41, 42 }), + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { }), + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 22, 23, 24 }), + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 25, 26, 27 }), + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 28, 29, 30 }), + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 31, 32, 33 }), + new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 34, 35, 36 }), +// new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 1,1,1}), // 30 J3 * +// new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 1,1,1}), // 30 J4 //ORIG * +// new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 37, 38, 39}), // 30 J7 * +// new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 40, 41, 42}), // 30 J8 * +// new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 43, 44, 45}), // 30 J13 (not working) +// new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 46, 47, 48}), // 30 J14 (unplugged) +// new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 49, 50, 51}), // 30 J15 (unplugged) +// new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 52, 53, 54}), // 30 J16 }), - new PandaMapping( - "10.200.1.31", new ChannelMapping[] { - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 65, 66}), // J3 - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 1,1}), // J4 - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 55, 56}), // 30 J7 - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 57, 58}), // J8 - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 59, 60}), // J13 - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 61, 62}), // 30 J14 - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 63, 64}), // J15 - new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 1,1}), // J16 - }), +// new PandaMapping( +// "10.200.1.31", new ChannelMapping[] { +// new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 65, 66}), // J3 +// new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 1,1}), // J4 +// new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 55, 56}), // 30 J7 +// new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 57, 58}), // J8 +// new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 59, 60}), // J13 +// new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 61, 62}), // 30 J14 +// new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 63, 64}), // J15 +// new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { 1,1}), // J16 +// }), + // new PandaMapping( // "10.200.1.32", new ChannelMapping[] { // new ChannelMapping(ChannelMapping.MODE_CUBES, new int[] { }), // J3 diff --git a/_PandaDriver.pde b/_PandaDriver.pde index 24afa20..5d8ad24 100644 --- a/_PandaDriver.pde +++ b/_PandaDriver.pde @@ -84,10 +84,17 @@ public static class PandaDriver { * corner of the cube the data wire comes in. */ private final static int[][] CUBE_STRIP_ORDERINGS = new int[][] { +// { 2, 1, 0, 3, 13, 12, 15, 14, 4, 7, 6, 5, 11, 10, 9, 8 }, // FRONT_LEFT +// { 6, 5, 4, 7, 1, 0, 3, 2, 8, 11, 10, 9, 15, 14, 13, 12 }, // FRONT_RIGHT +// { 14, 13, 12, 15, 9, 8, 11, 10, 0, 3, 2, 1, 7, 6, 5, 4 }, // REAR_LEFT +// { 10, 9, 8, 11, 5, 4, 7, 6, 12, 15, 14, 13, 3, 2, 1, 0 }, // REAR_RIGHT + + { 2, 1, 0, 3, 13, 12, 15, 14, 4, 7, 6, 5, 11, 10, 9, 8 }, // FRONT_LEFT { 6, 5, 4, 7, 1, 0, 3, 2, 8, 11, 10, 9, 15, 14, 13, 12 }, // FRONT_RIGHT { 14, 13, 12, 15, 9, 8, 11, 10, 0, 3, 2, 1, 7, 6, 5, 4 }, // REAR_LEFT - { 10, 9, 8, 11, 5, 4, 7, 6, 12, 15, 14, 13, 3, 2, 1, 0 }, // REAR_RIGHT + { 9, 8, 11, 5, 4, 7, 6, 10, 14, 2, 1, 0, 3, 13, 12, 15 }, // REAR_RIGHT + }; private final static int[][] BASS_STRIP_ORDERING = { -- 2.34.1