Exemplo n.º 1
0
 public void giveAlarm() {
   if (perform) {
     TS_DIO64.setOutput(0, 0xffffffff, 0x400);
     try {
       Thread.sleep(1500);
     } catch (InterruptedException e) {
       logger.warn("Interrupted", e);
     } finally {
       resetButtons();
     }
   }
 }
Exemplo n.º 2
0
  public int[] giveBeer(int slot) {
    if (slot > numSlots || slot < 0) {
      throw new IllegalArgumentException("Max slot is " + numSlots + ". You asked for " + slot);
    }

    int actualSlot = slot == 0 ? robin : slot - 1;
    int output = 1 << actualSlot;

    if (perform) {
      TS_DIO64.setOutput(0, 0xffffffff, output);
      try {
        Thread.sleep(1500);
      } catch (InterruptedException e) {
        logger.warn("Interrupted", e);
      } finally {
        resetButtons();
      }
    }
    logger.info("Giving beer from slot " + (actualSlot + 1));
    if (slot == 0) {
      robin = ++robin % numSlots;
    }
    return counters.incrementCounter(actualSlot);
  }
Exemplo n.º 3
0
 public void resetButtons() {
   if (perform) {
     TS_DIO64.setOutput(0, 0xffffffff, 0x0);
   }
 }