From: Mark Slee Date: Wed, 21 Aug 2013 06:29:41 +0000 (-0700) Subject: Fix debug tool with new number of channels X-Git-Url: https://git.piment-noir.org/?p=SugarCubes.git;a=commitdiff_plain;h=95c500328fc60b4ce81756023dc731e36de2a162 Fix debug tool with new number of channels --- diff --git a/_Mappings.pde b/_Mappings.pde index e42f6d7..9f57e18 100644 --- a/_Mappings.pde +++ b/_Mappings.pde @@ -22,6 +22,8 @@ public Model buildModel() { final Cube.Wiring WFR = Cube.Wiring.FRONT_RIGHT; final Cube.Wiring WRL = Cube.Wiring.REAR_LEFT; final Cube.Wiring WRR = Cube.Wiring.REAR_RIGHT; + + final float CH = Cube.EDGE_HEIGHT; // The model is represented as an array of towers. The cubes in the tower // are represenented relatively. Each tower has an x, y, z reference position, diff --git a/_Overlay.pde b/_Overlay.pde index 2ee00c8..f2f88d1 100644 --- a/_Overlay.pde +++ b/_Overlay.pde @@ -753,7 +753,7 @@ class DebugUI { final int debugY = 42; final int debugXSpacing = 28; final int debugYSpacing = 22; - final int[][] debugState = new int[17][6]; + final int[][] debugState; final int DEBUG_STATE_ANIM = 0; final int DEBUG_STATE_WHITE = 1; @@ -761,6 +761,8 @@ class DebugUI { DebugUI(PandaMapping[] pandaMappings) { int totalChannels = pandaMappings.length * PandaMapping.CHANNELS_PER_BOARD; + debugState = new int[totalChannels+1][ChannelMapping.CUBES_PER_CHANNEL+1]; + channelList = new ChannelMapping[totalChannels]; int channelIndex = 0; for (PandaMapping pm : pandaMappings) { @@ -935,7 +937,7 @@ class DebugUI { if ((dy >= 0) && (dy < debugState.length)) { if ((dx >= 0) && (dx < debugState[dy].length)) { int newState = debugState[dy][dx] = (debugState[dy][dx] + 1) % 3; - if (dy == 16) { + if (dy == debugState.length-1) { for (int[] states : debugState) { for (int i = 0; i < states.length; ++i) { states[i] = newState;