package nomadgui;

import nomadgui.state.*;

class bogieTestThread extends Thread {
  RSPFrame rframe;

  bogieTestThread(RSPFrame r) {
    rframe = r;
  }

  public void run() {
    for(float x=0; x<=((float)Math.PI*1/6); x+=.02f) {
      // Bogie from 0 -> 30 degrees
      rframe.setBogie(x);
      try { Thread.sleep(10); } catch(InterruptedException ie) {}
    }
    rframe.setBogie((float)Math.PI*2/3);
    
    for(float x=((float)Math.PI*1/6); x>=(-(float)Math.PI*1/6); x-=.02f) {
      // 30 -> -30 degrees
      rframe.setBogie(x);
      try { Thread.sleep(10); } catch(InterruptedException ie) {}
    }
    rframe.setBogie(0);
    
    for(float x=(-(float)Math.PI*1/6); x<=0; x+=.02f) {
      // Bogie from -30 -> 0 degrees
      rframe.setBogie(x);
      try { Thread.sleep(10); } catch(InterruptedException ie) {}
    }
    rframe.setBogie(0);
  }
}
