Ejemplo n.º 1
0
  private boolean setMode(int modeWord) {
    boolean res = false;

    if (connection.isConnected()) {
      if (modeWord == Mode.YELLOW_LIGHT_DISABLE.getValue()) {
        modeWord = previousModeWord;
      } else if (modeWord == Mode.EXPOSITION_WITH_CALIBRATION_LIGHTS.getValue()
          || modeWord == Mode.DIAMETER_EXPOSITION.getValue()
          || modeWord == Mode.CALIBRATE_DIAMETER.getValue()
          || modeWord == Mode.LENGTH_EXPOSITION.getValue()
          || modeWord == Mode.YELLOW_LIGHT_ENABLE.getValue()) {
        if ((previousModeWord & Mode.CALIBRATION_ARM_UNLOCK.getValue()) > 0) {
          modeWord |= Mode.CALIBRATION.getValue();
        } else {
          modeWord |= previousModeWord;
        }
      } else {
        previousModeWord = modeWord;
      }

      dlog.d("setMode: " + modeWord);

      res =
          connection.writeRegister(MEMORY_AREA_B2, Register.MODE.getValue(), new int[] {modeWord});
    }

    return res;
  }
Ejemplo n.º 2
0
  public boolean yellowWarning(boolean enable) {
    boolean res = false;

    if (connection.isConnected()) {
      if (enable) {
        res = setMode(Mode.YELLOW_LIGHT_ENABLE.getValue());
      } else {
        res = setMode(Mode.YELLOW_LIGHT_DISABLE.getValue());
      }
    }

    return res;
  }