/** Gets called when this tab gets focus. Uses the ActionListeners of the UI components */ @Override public void gotSelected() { posUpdater_.pauseUpdates(true); joystickPanel_.gotSelected(); cameraPanel_.gotSelected(); beamPanel_.gotSelected(); props_.callListeners(); // moves illumination piezo to home if (illumPiezoHomeEnable_.isSelected() && devices_.isValidMMDevice(piezoIlluminationDeviceKey_)) { props_.setPropValue( piezoIlluminationDeviceKey_, Properties.Keys.MOVE_TO_HOME, Properties.Values.DO_IT); } // set scan waveform to be triangle // SPIM use can change, but for alignment avoid sharp edges props_.setPropValue( micromirrorDeviceKey_, Properties.Keys.SA_PATTERN_X, Properties.Values.SAM_TRIANGLE, true); // move piezo and scanner to "center" position centerPiezoAndGalvo(); posUpdater_.pauseUpdates(false); }
/** * checks that the device has correct library, properties that we need, and correct values set as * needed * * @param key */ private void checkDeviceLibrary(Devices.Keys key) { Devices.Libraries deviceLibrary = devices_.getMMDeviceLibrary(key); if (deviceLibrary == Devices.Libraries.NODEVICE) { return; } switch (key) { case CAMERAA: case CAMERAB: switch (deviceLibrary) { case HAMCAM: checkPropertyExists(key, Properties.Keys.TRIGGER_SOURCE); checkPropertyValueEquals( key, Properties.Keys.TRIGGER_POLARITY, Properties.Values.POSITIVE); break; case PCOCAM: // trigger polarity not accessible in Micro-Manager, so we have to trust it is correct checkPropertyExists(key, Properties.Keys.TRIGGER_MODE_PCO); break; case ANDORCAM: // TODO check trigger polarity checkPropertyExists(key, Properties.Keys.TRIGGER_MODE); break; case DEMOCAM: checkPropertyValueEquals(key, Properties.Keys.PIXEL_TYPE, Properties.Values.SIXTEENBIT); break; default: MyDialogUtils.showError( "Plugin doesn't support your camera for SPIM yet;" + " contact the authors for support (camera must have hardware trigger)"); } // CamA/B case break; case GALVOA: case GALVOB: if (deviceLibrary == Devices.Libraries.ASITIGER) { checkPropertyValueEquals( key, Properties.Keys.INPUT_MODE, Properties.Values.INTERNAL_INPUT); // PLogic use in the plugin assumes "laser + side" output mode if (devices_.isValidMMDevice(Devices.Keys.PLOGIC)) { checkPropertyValueEquals( key, Properties.Keys.LASER_OUTPUT_MODE, Properties.Values.LASER_SHUTTER_SIDE); } } else { MyDialogUtils.showError("Plugin doesn't support galvo devices other than ASITiger"); } break; case PIEZOA: case PIEZOB: if (deviceLibrary == Devices.Libraries.ASITIGER) { checkPropertyValueEquals( key, Properties.Keys.PIEZO_MODE, Properties.Values.INTERNAL_CLOSEDLOOP_INPUT); } else { MyDialogUtils.showError("Plugin doesn't support piezo devices other than ASITiger"); } break; case PLOGIC: if (deviceLibrary == Devices.Libraries.ASITIGER) { // would like to do below line but we need to change pre-init value and reload config // checkPropertyValueEquals(key, Properties.Keys.PLOGIC_MODE, // Properties.Values.DISPIM_SHUTTER); if (!props_ .getPropValueString(key, Properties.Keys.PLOGIC_MODE) .equals(Properties.Values.DISPIM_SHUTTER.toString())) { MyDialogUtils.showError( "Device " + devices_.getMMDevice(key) + ": need to set pre-initialization property PLogicMode to " + "diSPIM Shutter (use Hardware Config Wizard, then edit device " + devices_.getMMDevice(key) + " on Step 2). Then reload the " + " changed configuration and restart the diSPIM plugin."); } checkPropertyValueEquals( key, Properties.Keys.PLOGIC_TRIGGER_SOURCE, Properties.Values.PLOGIC_TRIGGER_MMIRROR); // PLogic use in the plugin assumes "laser + side" output mode for (Devices.Keys galvoKey : Devices.GALVOS) { if (devices_.isValidMMDevice(galvoKey)) { checkPropertyValueEquals( galvoKey, Properties.Keys.LASER_OUTPUT_MODE, Properties.Values.LASER_SHUTTER_SIDE); } } } else { MyDialogUtils.showError("Plugin doesn't support shutter devices other than ASITiger"); } break; default: break; } }