More mapping cleanup, got rid of tons of mess code, clean definitions now
[SugarCubes.git] / TestPatterns.pde
index 62a1956ba9bad5c6ff6c50ba56a6af6f08efeb21..d76aeda5bab22d702deb81a54d92659ed35adca9 100644 (file)
@@ -229,13 +229,13 @@ class TestTowerPattern extends TestPattern {
  */
 class TestProjectionPattern extends TestPattern {
   
-  private final Projection projection;
+  private final LXProjection projection;
   private final SawLFO angle = new SawLFO(0, TWO_PI, 9000);
   private final SinLFO yPos = new SinLFO(-20, 40, 5000);
   
   public TestProjectionPattern(GLucose glucose) {
     super(glucose);
-    projection = new Projection(model);
+    projection = new LXProjection(model);
     addModulator(angle).trigger();
     addModulator(yPos).trigger();
   }
@@ -256,7 +256,7 @@ class TestProjectionPattern extends TestPattern {
       .scale(1, 1.5, 1);
 
     float hv = lx.getBaseHuef();
-    for (Coord c : projection) {
+    for (LXVector c : projection) {
       float d = sqrt(c.x*c.x + c.y*c.y + c.z*c.z); // distance from origin
       // d = abs(d-60) + max(0, abs(c.z) - 20); // life saver / ring thing
       d = max(0, abs(c.y) - 10 + .1*abs(c.z) + .02*abs(c.x)); // plane / spear thing
@@ -314,15 +314,11 @@ class MappingTool extends TestPattern {
   public boolean channelModeBlue = false;
   
   private final int numChannels;
-  
-  private final PandaMapping[] pandaMappings;
-  private PandaMapping activePanda;
-  private ChannelMapping activeChannel;
-  
-  MappingTool(GLucose glucose, PandaMapping[] pandaMappings) {
+    
+  MappingTool(GLucose glucose) {
     super(glucose);
-    this.pandaMappings = pandaMappings;
-    numChannels = pandaMappings.length * PandaMapping.CHANNELS_PER_BOARD;
+    // TODO(mcslee): port channels to grizzly
+    numChannels = 1;
     setChannel();
   }
 
@@ -331,21 +327,12 @@ class MappingTool extends TestPattern {
   }
   
   private void setChannel() {
-    activePanda = pandaMappings[channelIndex / PandaMapping.CHANNELS_PER_BOARD];
-    activeChannel = activePanda.channelList[channelIndex % PandaMapping.CHANNELS_PER_BOARD];
+    // TODO(mcslee): port to grizzly
   }
   
   private int indexOfCubeInChannel(Cube c) {
-    if (activeChannel.mode == ChannelMapping.MODE_CUBES) {
-      int i = 1;
-      for (int index : activeChannel.objectIndices) {
-        if ((index >= 0) && (c == model.getCubeByRawIndex(index))) {
-          return i;
-        }
-        ++i;
-      }
-    }
-    return 0;
+    // TODO(mcslee): port to grizzly
+    return -1;
   }
   
   private void printInfo() {
@@ -440,7 +427,9 @@ class MappingTool extends TestPattern {
   }
   
   public void setChannel(int index) {
-    channelIndex = index % numChannels;
+    if (numChannels > 0) {
+      channelIndex = index % numChannels;
+    }
     setChannel();
   }