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; }
public boolean expositionLength() { boolean res = false; if (connection.isConnected()) { res = setMode(Mode.LENGTH_EXPOSITION.getValue()); } return res; }