예제 #1
0
 public LiftCommand(Button button, String name) {
   this.button = button;
   this.name = name;
   liftIO = LiftIO.getInstance();
   liftIO.setA(false);
   liftIO.setB(false);
   liftIO.setPOV(-1);
 }
예제 #2
0
 @Override
 public void execute() {
   if (!started) {
     switch (button) {
       case PICKUP:
         {
           liftIO.setA(true);
           break;
         }
       case PICKUPFLOOR:
         {
           liftIO.setB(true);
           break;
         }
       case PLACE:
         {
           liftIO.setPOV(270);
           break;
         }
       case MOVEUP:
         {
           liftIO.setPOV(0);
           break;
         }
       case MOVEDOWN:
         {
           liftIO.setPOV(180);
           break;
         }
     }
     started = true;
   } else {
     done = LiftStates.getInstance().sequenceDone() && !prevDone;
   }
   prevDone = done;
 }