diff --git a/src/main/java/org/micromanager/lightsheetmanager/api/internal/DefaultSliceCalibration.java b/src/main/java/org/micromanager/lightsheetmanager/api/internal/DefaultSliceCalibration.java index 049c757..a69836d 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/api/internal/DefaultSliceCalibration.java +++ b/src/main/java/org/micromanager/lightsheetmanager/api/internal/DefaultSliceCalibration.java @@ -20,7 +20,6 @@ private Builder(final SliceCalibration sliceCalibration) { @Override public SliceCalibration.Builder sliceSlope(final double slope) { sliceSlope_ = slope; - System.out.println(sliceSlope_); return this; } diff --git a/src/main/java/org/micromanager/lightsheetmanager/gui/playlist/AcquisitionTable.java b/src/main/java/org/micromanager/lightsheetmanager/gui/playlist/AcquisitionTable.java index 9f6ec66..d1ad5a7 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/gui/playlist/AcquisitionTable.java +++ b/src/main/java/org/micromanager/lightsheetmanager/gui/playlist/AcquisitionTable.java @@ -310,7 +310,7 @@ public void removeSelectedAcquisition() { table_.clearSelection(); } table_.repaint(); - System.out.println("remove acquisition: " + name); + //System.out.println("remove acquisition: " + name); } } diff --git a/src/main/java/org/micromanager/lightsheetmanager/gui/playlist/AcquisitionTableFrame.java b/src/main/java/org/micromanager/lightsheetmanager/gui/playlist/AcquisitionTableFrame.java index fd67c69..b865539 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/gui/playlist/AcquisitionTableFrame.java +++ b/src/main/java/org/micromanager/lightsheetmanager/gui/playlist/AcquisitionTableFrame.java @@ -458,7 +458,7 @@ private void removeSelectedPositionList() { } lstPositions_.removeItem(name); // remove name from JList acqTable_.removePositionList(name); - System.out.println("remove: " + name); + //System.out.println("remove: " + name); } } diff --git a/src/main/java/org/micromanager/lightsheetmanager/gui/playlist/AcquisitionTablePositionList.java b/src/main/java/org/micromanager/lightsheetmanager/gui/playlist/AcquisitionTablePositionList.java index 7bd3758..b2061d4 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/gui/playlist/AcquisitionTablePositionList.java +++ b/src/main/java/org/micromanager/lightsheetmanager/gui/playlist/AcquisitionTablePositionList.java @@ -249,11 +249,11 @@ public void valueChanged(ListSelectionEvent event) { public boolean validatePositionsSize() { final int positionsSize = table_.getTableData().getPositionsSize(); if (positionsSize != model_.size()) { - System.out.println("Validate Error: The number of items in the AcquisitionTablePositionList " - + "should be the same as the number of keys in AcquisitionTableData positions field."); + //System.out.println("Validate Error: The number of items in the AcquisitionTablePositionList " + // + "should be the same as the number of keys in AcquisitionTableData positions field."); return false; } else { - System.out.println("Validate Success: The number of positions are the same."); + //System.out.println("Validate Success: The number of positions are the same."); } return true; } diff --git a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/AutofocusTab.java b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/AutofocusTab.java index 193cc8a..2ca8424 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/AutofocusTab.java +++ b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/AutofocusTab.java @@ -196,11 +196,11 @@ private void createEventHandlers() { // general autofocus settings cbxShowImages_.registerListener(e -> { - System.out.println("cbxShowImages_: " + cbxShowImages_.isSelected()); + //System.out.println("cbxShowImages_: " + cbxShowImages_.isSelected()); }); cbxShowPlot_.registerListener(e -> { - System.out.println("cbxShowPlot_: " + cbxShowPlot_.isSelected()); + //System.out.println("cbxShowPlot_: " + cbxShowPlot_.isSelected()); }); spnNumImages_.registerListener(e -> @@ -232,12 +232,15 @@ private void createEventHandlers() { }); // autofocus options during acquisition - cbxAutofocusEveryPass_.registerListener(e -> - System.out.println("cbxAutofocusEveryPass_: " + cbxAutofocusEveryPass_.isSelected())); - cbxAutofocusBeforeAcq_.registerListener(e -> - System.out.println("cbxAutofocusBeforeAcq_: " + cbxAutofocusBeforeAcq_.isSelected())); - cmbAutofocusChannel_.registerListener(e -> - System.out.println("cmbAutofocusChannel_")); + cbxAutofocusEveryPass_.registerListener(e -> { + //System.out.println("cbxAutofocusEveryPass_: " + cbxAutofocusEveryPass_.isSelected()); + }); + cbxAutofocusBeforeAcq_.registerListener(e -> { + //System.out.println("cbxAutofocusBeforeAcq_: " + cbxAutofocusBeforeAcq_.isSelected()); + }); + cmbAutofocusChannel_.registerListener(e -> { + //System.out.println("cmbAutofocusChannel_"); + }); spnAutofocusEveryX_.registerListener(e -> { diff --git a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/DataTab.java b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/DataTab.java index 11a2c23..73fbe46 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/DataTab.java +++ b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/DataTab.java @@ -127,7 +127,7 @@ private void createEventHandlers() { radSaveMode_.registerListener(e -> { model_.acquisitions().settingsBuilder().saveMode(DataStorage.SaveMode.fromString(radSaveMode_.getSelectedButtonText())); - System.out.println("radSaveMode: " + radSaveMode_.getSelectedButtonText()); + //System.out.println("radSaveMode: " + radSaveMode_.getSelectedButtonText()); }); } diff --git a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/channels/ChannelTablePanel.java b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/channels/ChannelTablePanel.java index dffb3b9..47a6635 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/channels/ChannelTablePanel.java +++ b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/channels/ChannelTablePanel.java @@ -77,7 +77,7 @@ private void createEventHandlers() { table_.refreshData(); // table_.repaint(); // repaint(); - System.out.println("add channel"); + //System.out.println("add channel"); table_.getData().printChannelData(); final ChannelSpec[] channels = table_.getData().getChannels(); model_.acquisitions().settingsBuilder().channels(channels); @@ -93,7 +93,7 @@ private void createEventHandlers() { model_.acquisitions().settingsBuilder().channels(channels); model_.acquisitions().settingsBuilder().numChannels(channels.length); table_.refreshData(); - System.out.println("remove row index: " + row); + //System.out.println("remove row index: " + row); } }); diff --git a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/navigation/ControlPanel.java b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/navigation/ControlPanel.java index 54fab7f..f6bd2e0 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/navigation/ControlPanel.java +++ b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/navigation/ControlPanel.java @@ -327,7 +327,7 @@ private double getPosition() { private void setOriginY() { try { - System.out.println("deviceName_: " + deviceName_); + //System.out.println("deviceName_: " + deviceName_); core_.setOriginY(deviceName_); } catch (Exception e) { studio_.logs().showError("failed to set y origin!"); @@ -336,7 +336,7 @@ private void setOriginY() { private void setOriginX() { try { - System.out.println("deviceName_: " + deviceName_); + //System.out.println("deviceName_: " + deviceName_); core_.setOriginX(deviceName_); } catch (Exception e) { studio_.logs().showError("failed to set x origin!"); diff --git a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/navigation/NavigationPanel.java b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/navigation/NavigationPanel.java index 3ee0358..70c755a 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/navigation/NavigationPanel.java +++ b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/navigation/NavigationPanel.java @@ -81,8 +81,8 @@ public void createUserInterface() { illumProperties.add(new ArrayList<>()); } - System.out.println("img props: " + imagingProperties.size()); - System.out.println("ill props: " + illumProperties.size()); + //System.out.println("img props: " + imagingProperties.size()); + //System.out.println("ill props: " + illumProperties.size()); int devicesFound = 0; for (String propertyName : deviceMap.keySet()) { @@ -92,7 +92,7 @@ public void createUserInterface() { } // TODO: only add certain kinds of devices - System.out.println(propertyName); + //System.out.println(propertyName); final DeviceType deviceType = deviceTypeMap.get(propertyName); if (deviceType == DeviceType.CameraDevice) { continue; // don't add cameras to axis list @@ -220,8 +220,6 @@ public void createUserInterface() { controlPanels_.add(controlPanel); } - //createEventHandlers(); - add(miscPanel, "wrap"); add(btnHaltDevices_, "split 3"); //add(btnRefreshPanel_, ""); @@ -299,7 +297,7 @@ public PositionUpdater getPositionUpdater() { } public void haltAllDevices() { - System.out.println("Halt pressed!"); + //System.out.println("Halt pressed!"); for (ControlPanel controlPanel : controlPanels_) { // only try to stop XY and 1D stages DeviceType deviceType = controlPanel.getDeviceType(); diff --git a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/navigation/PositionUpdater.java b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/navigation/PositionUpdater.java index b11bbe4..575d558 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/navigation/PositionUpdater.java +++ b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/navigation/PositionUpdater.java @@ -43,7 +43,7 @@ protected Void doInBackground() { e.printStackTrace(); } if (!isPolling_.get()) { - System.out.println("break!"); + //System.out.println("break!"); break; } try { diff --git a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/setup/BeamSheetControlPanel.java b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/setup/BeamSheetControlPanel.java index ff50854..f42c43c 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/setup/BeamSheetControlPanel.java +++ b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/setup/BeamSheetControlPanel.java @@ -162,7 +162,7 @@ private void createEventHandlers() { // first panel btnPlotProfile_.registerListener(e -> { - System.out.println("do something here..."); + //System.out.println("do something here..."); }); // second panel @@ -177,7 +177,7 @@ private void createEventHandlers() { final double value = sldSheetWidth_.getDouble(); model_.acquisitions().settingsBuilder() .sheetCalibrationBuilder(pathNum_).sheetWidth(value); - System.out.println("sheetWidth value: " + value); + //System.out.println("sheetWidth value: " + value); }); sldSheetOffset_.registerListener(e -> { @@ -187,7 +187,7 @@ private void createEventHandlers() { final String strValue = String.format("%.3f ", value); txtSheetOffset_.setText(strValue); lblSlopeOffset_.setText(strValue); - System.out.println("sheetOffset value: " + strValue); + //System.out.println("sheetOffset value: " + strValue); }); txtSheetOffset_.registerListener(e -> { @@ -201,7 +201,7 @@ private void createEventHandlers() { }); btnCenterOffset_.registerListener(e -> { - System.out.println("center offset pressed"); + //System.out.println("center offset pressed"); model_.acquisitions().settingsBuilder() .sheetCalibrationBuilder(pathNum_).sheetOffset(0.0); txtSheetOffset_.setText("0"); @@ -215,7 +215,7 @@ private void createEventHandlers() { // .sheetCalibration(pathNum_).sheetOffset() - 0.01; currentOffset_ -= 0.01; final double value = currentOffset_; - System.out.println("value: " + value); + //System.out.println("value: " + value); model_.acquisitions().settingsBuilder() .sheetCalibrationBuilder(pathNum_).sheetOffset(value); txtSheetOffset_.setText(String.format("%.3f ", value)); @@ -227,7 +227,7 @@ private void createEventHandlers() { // .sheetCalibration(pathNum_).sheetOffset() + 0.01; currentOffset_ += 0.01; final double value = currentOffset_; - System.out.println("value: " + value); + //System.out.println("value: " + value); model_.acquisitions().settingsBuilder() .sheetCalibrationBuilder(pathNum_).sheetOffset(value); txtSheetOffset_.setText(String.format("%.3f ", value)); diff --git a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/setup/ExcitationPanel.java b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/setup/ExcitationPanel.java index 4251b50..6a3797d 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/setup/ExcitationPanel.java +++ b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/setup/ExcitationPanel.java @@ -75,7 +75,7 @@ private void createEventHandlers() { cbxBeamExc_.registerListener(e -> { scanner.setBeamOn(cbxBeamExc_.isSelected()); - System.out.println("set beam on: " + cbxBeamExc_.isSelected()); + //System.out.println("set beam on: " + cbxBeamExc_.isSelected()); }); } diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/DeviceManager.java b/src/main/java/org/micromanager/lightsheetmanager/model/DeviceManager.java index 3a57e90..2139efb 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/DeviceManager.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/DeviceManager.java @@ -97,7 +97,7 @@ public void setup() { final DeviceType deviceType = getDeviceType(deviceName); final String deviceLibrary = getDeviceLibrary(deviceName); - System.out.println(propertyName + " " + deviceType); + //System.out.println(propertyName + " " + deviceType); // skip properties with no known DeviceType if (deviceType == DeviceType.UnknownType) { @@ -162,7 +162,7 @@ public void setup() { } //deviceMap_.put(propertyName, ""); } - System.out.println("----------------"); + //System.out.println("----------------"); // we don't need this array anymore devicesAdded_.clear(); diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/UserSettings.java b/src/main/java/org/micromanager/lightsheetmanager/model/UserSettings.java index 499393f..67b8c4a 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/UserSettings.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/UserSettings.java @@ -9,15 +9,20 @@ import java.util.Iterator; import java.util.Objects; +import java.util.Optional; +/** + * This wraps Micro-Manager's settings profiles to store the plugin settings. + */ public class UserSettings { - private final String userName; - private final MutablePropertyMapView settings; + private final String userName_; + private final MutablePropertyMapView settings_; // This is the prefix String for saving the current acquisition settings // based on the microscope geometry type, "LSM_ACQ_SETTINGS_SCAPE" for example. // Note: GeometryType will be converted to uppercase: "LSM_ACQ_SETTINGS_DISPIM". + private static final String SETTINGS_KEY = "LSM_PLUGIN_SETTINGS"; private static final String SETTINGS_PREFIX_KEY = "LSM_ACQ_SETTINGS_"; private static final String SETTINGS_NOT_FOUND = "Settings Not Found"; @@ -30,8 +35,8 @@ public UserSettings(final LightSheetManagerModel model) { model_ = Objects.requireNonNull(model); // setup user profile UserProfile profile = model_.getStudio().getUserProfile(); - userName = profile.getProfileName(); - settings = profile.getSettings(UserSettings.class); + userName_ = profile.getProfileName(); + settings_ = profile.getSettings(UserSettings.class); } /** @@ -40,7 +45,7 @@ public UserSettings(final LightSheetManagerModel model) { * @return a reference to MutablePropertyMapView */ public MutablePropertyMapView get() { - return settings; + return settings_; } /** @@ -49,14 +54,14 @@ public MutablePropertyMapView get() { * @return a String containing the name */ public String getUserName() { - return userName; + return userName_; } /** * Clears all user settings associated with this class name. */ public void clear() { - settings.clear(); + settings_.clear(); } /** @@ -66,23 +71,26 @@ public void load() { // get json from settings based on microscope geometry type final GeometryType geometryType = model_.devices() .getDeviceAdapter().getMicroscopeGeometry(); - final String key = SETTINGS_PREFIX_KEY + - geometryType.toString().toUpperCase(); - final String json = settings.getString(key, SETTINGS_NOT_FOUND); - System.out.println("loaded json from " + key + ": " + json); - // use default settings if settings data not found - if (!json.equals(SETTINGS_NOT_FOUND)) { + final String key = SETTINGS_PREFIX_KEY + geometryType.toString().toUpperCase(); + final String json = settings_.getString(key, SETTINGS_NOT_FOUND); + + // use default settings if settings data not found in profile + if (json.equals(SETTINGS_NOT_FOUND)) { + model_.studio().logs().logDebugMessage( + "settings not found, using default settings for " + geometryType); + } else { // validate user settings and create settings object - JSONObject loadedJson = validateUserSettings(json); - if (loadedJson != null) { + final Optional loadedJson = validateUserSettings(json); + if (loadedJson.isPresent()) { // TODO: switch this based on microscope geometry type - DefaultAcquisitionSettingsSCAPE acqSettings = DefaultAcquisitionSettingsSCAPE.fromJson( - loadedJson.toString(), DefaultAcquisitionSettingsSCAPE.class); - model_.acquisitions().setAcquisitionSettings(acqSettings); - //System.out.println("loadedJson: " + loadedJson); + final DefaultAcquisitionSettingsSCAPE acqSettings = DefaultAcquisitionSettingsSCAPE.fromJson( + loadedJson.get().toString(), DefaultAcquisitionSettingsSCAPE.class); + // update both the settings and builder + model_.acquisitions().setAcquisitionSettingsAndBuilder(acqSettings); + model_.studio().logs().logDebugMessage("loaded JSON from " + key + ": " + + model_.acquisitions().settings().toPrettyJson()); } - //System.out.println("acqSettings: " + acqSettings); } } @@ -90,35 +98,36 @@ public void load() { * Save user settings. */ public void save() { - // build settings before saving to make sure updates are saved - model_.acquisitions().setAcquisitionSettings( - model_.acquisitions().settingsBuilder().build()); + // make settings current before saving + model_.acquisitions().updateAcquisitionSettings(); // settings key final GeometryType geometryType = model_.devices() .getDeviceAdapter().getMicroscopeGeometry(); final String key = SETTINGS_PREFIX_KEY + geometryType.toString().toUpperCase(); // save in user settings - settings.putString(key, model_.acquisitions().settings().toJson()); - System.out.println("saved json to " + key + ": " + settings_.putString(key, model_.acquisitions().settings().toJson()); + model_.studio().logs().logDebugMessage("saved JSON to " + key + ": " + model_.acquisitions().settings().toPrettyJson()); } /** - * Returns the JSONObject after checking if it matches the schema of the + * Returns the {@code JSONObject} after checking if it matches the schema of the * default acquisition settings object. If it does not, then any new settings * found will be merged into the loaded settings as the default value. * * @param loadedSettings the settings loaded as a JSON String * @return the settings object or null if an error occurred */ - private JSONObject validateUserSettings(final String loadedSettings) { - // get default settings from builder + private Optional validateUserSettings(final String loadedSettings) { + // create default settings from builder final String defaultSettings = new DefaultAcquisitionSettingsSCAPE.Builder().build().toJson(); // validate json strings and count the number of keys - int numLoadedKeys, numDefaultKeys; - JSONObject loadedJson, defaultJson; + int numLoadedKeys; + int numDefaultKeys; + JSONObject loadedJson; + JSONObject defaultJson; try { loadedJson = new JSONObject(loadedSettings); defaultJson = new JSONObject(defaultSettings); @@ -126,7 +135,7 @@ private JSONObject validateUserSettings(final String loadedSettings) { numDefaultKeys = countKeysJson(defaultJson); } catch (JSONException e) { model_.studio().logs().showError("could not validate the JSON data."); - return null; + return Optional.empty(); } // different number of keys => merge loaded settings with default settings if (numLoadedKeys != numDefaultKeys) { @@ -134,10 +143,10 @@ private JSONObject validateUserSettings(final String loadedSettings) { mergeSettingsJson(defaultJson, loadedJson); } catch (JSONException e) { model_.studio().logs().showError("could not merge new default settings into loaded settings."); - return null; + return Optional.empty(); } } - return loadedJson; + return Optional.of(loadedJson); } // Overloaded method to give mergeSettingsJson a default parameter. @@ -145,12 +154,15 @@ private void mergeSettingsJson(JSONObject defaultJson, JSONObject loadedJson) th mergeSettingsJson(defaultJson, loadedJson, 0); } - private void mergeSettingsJson(JSONObject defaultJson, JSONObject loadedJson, final int level) throws JSONException { + private void mergeSettingsJson( + JSONObject defaultJson, JSONObject loadedJson, final int level) throws JSONException { + // bail out if settings data is nested too deep if (level > MAX_RECURSION_DEPTH_JSON) { model_.studio().logs().logMessage("UserSettings: recursion too deep, increase max level."); return; // early exit => recursion too deep } + // for every key in the default settings, check to make sure the loaded settings has that key Iterator keys = defaultJson.keys(); while (keys.hasNext()) { @@ -159,7 +171,8 @@ private void mergeSettingsJson(JSONObject defaultJson, JSONObject loadedJson, fi // if the loaded settings are missing the key then add it if (!loadedJson.has(key)) { loadedJson.put(key, value); - model_.studio().logs().logMessage("UserSettings: Added key \"" + key + "\" to the loaded settings."); + model_.studio().logs().logMessage( + "UserSettings: Added key \"" + key + "\" to the loaded settings."); } // recursively call on sub-objects of type JSONObject if (value instanceof JSONObject) { @@ -173,6 +186,14 @@ private void mergeSettingsJson(JSONObject defaultJson, JSONObject loadedJson, fi } } + /** + * Return the number of keys in the {@code JSONObject} object and + * all internal {@code JSONObject} objects. + * + * @param obj the root {@code JSONObject} object + * @return the number of keys in all objects + * @throws JSONException error getting value from key from object + */ private int countKeysJson(final JSONObject obj) throws JSONException { int numKeys = obj.length(); Iterator keys = obj.keys(); diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngine.java b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngine.java index 279cd63..4e64c26 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngine.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngine.java @@ -85,15 +85,19 @@ public void setFrame(final LightSheetManagerFrame frame) { } /** - * Sets the acquisition settings and populates the acquisition settings builder with its values. + * Sets the acquisition settings and update the acquisition settings builder with current values.

+ * This is used to load the plugin settings from JSON. * - * @param acqSettings the acquisition settings to set + * @param acqSettings the {@code DefaultAcquisitionSettingsSCAPE} to use */ - public void setAcquisitionSettings(final DefaultAcquisitionSettingsSCAPE acqSettings) { + public void setAcquisitionSettingsAndBuilder(final DefaultAcquisitionSettingsSCAPE acqSettings) { asb_ = new DefaultAcquisitionSettingsSCAPE.Builder(acqSettings); acqSettings_ = acqSettings; } + /** + * Build the {@code DefaultAcquisitionSettingsSCAPE} with the builder and update settings. + */ public void updateAcquisitionSettings() { acqSettings_ = asb_.build(); } diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineDISPIM.java b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineDISPIM.java index adf1b40..a4741d0 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineDISPIM.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineDISPIM.java @@ -68,8 +68,8 @@ boolean run() { frame_.getNavigationPanel().stopPolling(); } - // set acquisition settings from the builder - setAcquisitionSettings(asb_.build()); + // make settings current + updateAcquisitionSettings(); final boolean isLiveModeOn = studio_.live().isLiveModeOn(); if (isLiveModeOn) { @@ -172,7 +172,8 @@ boolean run() { // } catch (Exception e1) { // e1.printStackTrace(); // } - setAcquisitionSettings(asb_.build()); + + updateAcquisitionSettings(); studio_.logs().logMessage("Starting Acquisition with settings:\n" + acqSettings_.toPrettyJson()); @@ -553,7 +554,7 @@ private boolean doHardwareCalculations(PLogicDISPIM plc) { // make sure slice timings are up-to-date recalculateSliceTiming(); - System.out.println("after recalculateSliceTiming: " + asb_.timingSettingsBuilder()); + //System.out.println("after recalculateSliceTiming: " + asb_.timingSettingsBuilder()); // TODO: was only checked in light sheet mode (virtual slit mode now) @@ -717,9 +718,9 @@ public DefaultTimingSettings.Builder getTimingFromPeriodAndLightExposure() { // TODO: do this in ui? camera.setTriggerMode(acqSettings_.cameraMode()); - System.out.println(camera.getDeviceName()); + //System.out.println(camera.getDeviceName()); CameraMode camMode = camera.getTriggerMode(); - System.out.println(camMode); + //System.out.println(camMode); DefaultTimingSettings.Builder tsb = new DefaultTimingSettings.Builder(); diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineSCAPE.java b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineSCAPE.java index 000f5a0..c342e69 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineSCAPE.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineSCAPE.java @@ -85,8 +85,8 @@ boolean run() { asb_.sheetCalibrationBuilder(1).useAutoSheetWidth(true); asb_.sheetCalibrationBuilder(1).autoSheetWidthPerPixel(0.0); - // set acquisition settings from the builder - setAcquisitionSettings(asb_.build()); + // make settings current + updateAcquisitionSettings(); // TODO: delete later, this is the settings before everything is set up in doHardwareCalculations (used to debug) //studio_.logs().logMessage("debug info:\n" + acqSettings_.toPrettyJson()); @@ -199,7 +199,7 @@ boolean run() { // System.out.println(jsonStr); // } - setAcquisitionSettings(asb_.build()); + updateAcquisitionSettings(); studio_.logs().logMessage("Starting Acquisition with settings:\n" + acqSettings_.toPrettyJson()); @@ -997,9 +997,9 @@ public DefaultTimingSettings.Builder getTimingFromPeriodAndLightExposure() { // TODO: do this in ui? camera.setTriggerMode(acqSettings_.cameraMode()); - System.out.println(camera.getDeviceName()); + //System.out.println(camera.getDeviceName()); CameraMode camMode = camera.getTriggerMode(); - System.out.println(camMode); + //System.out.println(camMode); DefaultTimingSettings.Builder tsb = new DefaultTimingSettings.Builder(); diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/LSMAcquisitionEvents.java b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/LSMAcquisitionEvents.java index c8ac56f..f164288 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/LSMAcquisitionEvents.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/LSMAcquisitionEvents.java @@ -301,7 +301,7 @@ public boolean hasNext() { @Override public AcquisitionEvent next() { - System.out.println("called! " + index); + //System.out.println("called! " + index); AcquisitionEvent posEvent = event.copy(); MultiStagePosition msp = positionList.getPosition(index); if (msp != null) { diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/devices/cameras/AndorCamera.java b/src/main/java/org/micromanager/lightsheetmanager/model/devices/cameras/AndorCamera.java index 855bd93..4680f13 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/devices/cameras/AndorCamera.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/devices/cameras/AndorCamera.java @@ -172,7 +172,6 @@ public double getRowReadoutTime() { @Override public double getReadoutTime(CameraMode cameraMode) { double readoutTimeMs = 10.0; - System.out.println("getReadoutTime: mode: " + cameraMode); switch (cameraMode) { case VIRTUAL_SLIT: Rectangle roi = getROI();