Пример #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;
  }
Пример #2
0
  public boolean expositionCalibrationAnytime() {
    boolean res = false;

    if (connection.isConnected()) {
      res = setMode(Mode.EXPOSITION_WITH_CALIBRATION_LIGHTS.getValue());
    }

    return res;
  }
Пример #3
0
  public boolean calibrateTopCamera() {
    boolean res = false;

    if (connection.isConnected()) {
      if ((getStatus() & Status.CALIBRATION_ARM_L_DOWN.getValue()) > 0) {
        res = setMode(Mode.EXPOSITION_WITH_CALIBRATION_LIGHTS.getValue());
      }
    }

    return res;
  }