diff --git a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/AcquisitionTab.java b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/AcquisitionTab.java index ea6c563..dd8595f 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/AcquisitionTab.java +++ b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/AcquisitionTab.java @@ -241,8 +241,6 @@ private void runAcquisition(boolean speedTest) { } private void createEventHandlers() { - final DefaultAcquisitionSettingsDISPIM.Builder asb_ = - model_.acquisitions().settingsBuilder(); // start/stop acquisitions btnRunAcquisition_.registerListener(e -> { @@ -277,14 +275,14 @@ private void createEventHandlers() { // multiple positions cbxUseMultiplePositions_.registerListener(e -> { final boolean isSelected = cbxUseMultiplePositions_.isSelected(); - asb_.useMultiplePositions(isSelected); + model_.acquisitions().settingsBuilder().useMultiplePositions(isSelected); pnlMultiPositions_.setEnabled(isSelected); }); // time points cbxUseTimePoints_.registerListener(e -> { final boolean selected = cbxUseTimePoints_.isSelected(); - asb_.useTimePoints(selected); + model_.acquisitions().settingsBuilder().useTimePoints(selected); pnlTimePoints_.setEnabled(selected); //updateDurationLabels(); }); @@ -292,13 +290,13 @@ private void createEventHandlers() { // use channels cbxUseChannels_.registerListener(e -> { final boolean state = cbxUseChannels_.isSelected(); - asb_.useChannels(state); + model_.acquisitions().settingsBuilder().useChannels(state); pnlChannelTable_.setItemsEnabled(state); }); cmbAcquisitionModes_.registerListener(e -> { final int index = cmbAcquisitionModes_.getSelectedIndex(); - asb_.acquisitionMode(AcquisitionMode.getByIndex(index)); + model_.acquisitions().settingsBuilder().acquisitionMode(AcquisitionMode.getByIndex(index)); //System.out.println("getAcquisitionMode: " + model_.acquisitions().getAcquisitionSettings().getAcquisitionMode()); }); 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 e80cf7f..10c0f27 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/AutofocusTab.java +++ b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/AutofocusTab.java @@ -193,8 +193,6 @@ private void setSetupOptionsState(final boolean state) { } private void createEventHandlers() { - final DefaultAutofocusSettings.Builder afsb_ = model_ - .acquisitions().settingsBuilder().autofocusSettingsBuilder(); // general autofocus settings cbxShowImages_.registerListener(e -> { @@ -206,32 +204,40 @@ private void createEventHandlers() { }); spnNumImages_.registerListener(e -> - afsb_.numImages(spnNumImages_.getInt())); + model_.acquisitions().settingsBuilder() + .autofocusSettingsBuilder().numImages(spnNumImages_.getInt())); spnStepSize_.registerListener(e -> - afsb_.stepSize(spnStepSize_.getDouble())); + model_.acquisitions().settingsBuilder() + .autofocusSettingsBuilder().stepSize(spnStepSize_.getDouble())); spnMinimumR2_.registerListener(e -> { - afsb_.r2(spnMinimumR2_.getDouble()); + model_.acquisitions().settingsBuilder() + .autofocusSettingsBuilder().r2(spnMinimumR2_.getDouble()); }); cmbAutofocusMode_.registerListener(e -> { - afsb_.mode(AutofocusMode.fromString(cmbAutofocusMode_.getSelected())); + model_.acquisitions().settingsBuilder().autofocusSettingsBuilder() + .mode(AutofocusMode.fromString(cmbAutofocusMode_.getSelected())); }); cmbScoringAlgorithm_.registerListener(e -> { - afsb_.scoringAlgorithm(AutofocusType.fromString(cmbScoringAlgorithm_.getSelected())); + model_.acquisitions().settingsBuilder().autofocusSettingsBuilder() + .scoringAlgorithm(AutofocusType.fromString(cmbScoringAlgorithm_.getSelected())); }); cmbFittingFunction_.registerListener(e -> { - afsb_.fit(AutofocusFitType.fromString(cmbFittingFunction_.getSelected())); + model_.acquisitions().settingsBuilder().autofocusSettingsBuilder() + .fit(AutofocusFitType.fromString(cmbFittingFunction_.getSelected())); }); // 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 2527e3f..1d3c52f 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/DataTab.java +++ b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/DataTab.java @@ -98,8 +98,6 @@ private void createUserInterface() { } private void createEventHandlers() { - final DefaultAcquisitionSettingsDISPIM.Builder asb_ = - model_.acquisitions().settingsBuilder(); btnBrowse_.registerListener((EventObject e) -> { //final String path = fileSelect_.openDialogBox(this, new File("")); @@ -108,25 +106,25 @@ private void createEventHandlers() { directorySelect_ ); if (result != null) { - asb_.saveDirectory(result.toString()); + model_.acquisitions().settingsBuilder().saveDirectory(result.toString()); txtSaveDirectory_.setText(result.toString()); } //System.out.println("getSaveDirectory: " + model_.acquisitions().getAcquisitionSettings().getSaveDirectory()); }); cbxSaveWhileAcquiring_.registerListener(e -> { - asb_.saveImagesDuringAcquisition(cbxSaveWhileAcquiring_.isSelected()); + model_.acquisitions().settingsBuilder().saveImagesDuringAcquisition(cbxSaveWhileAcquiring_.isSelected()); //System.out.println("isSavingWhileAcquiring: " + model_.acquisitions().getAcquisitionSettings().isSavingWhileAcquiring()); }); txtSaveFileName_.registerListener(e -> { - asb_.saveNamePrefix(txtSaveFileName_.getText()); + model_.acquisitions().settingsBuilder().saveNamePrefix(txtSaveFileName_.getText()); //System.out.println("getSaveNamePrefix: " + model_.acquisitions().getAcquisitionSettings().getSaveNamePrefix()); }); radSaveMode_.registerListener(e -> { + model_.acquisitions().settingsBuilder().saveMode(DataStorage.SaveMode.fromString(radSaveMode_.getSelectedButtonText())); System.out.println("radSaveMode: " + radSaveMode_.getSelectedButtonText()); - asb_.saveMode(DataStorage.SaveMode.fromString(radSaveMode_.getSelectedButtonText())); }); } diff --git a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/SettingsTab.java b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/SettingsTab.java index 5e7c321..2e5a8b1 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/SettingsTab.java +++ b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/SettingsTab.java @@ -120,25 +120,30 @@ private void createUserInterface() { } private void createEventHandlers() { - final DefaultScanSettings.Builder scsb = model_.acquisitions() - .settingsBuilder().scanSettingsBuilder(); // Scan Settings spnScanAcceleration_.registerListener(e -> - scsb.scanAccelerationFactor(spnScanAcceleration_.getDouble())); + model_.acquisitions().settingsBuilder().scanSettingsBuilder() + .scanAccelerationFactor(spnScanAcceleration_.getDouble())); spnScanOvershootDist_.registerListener(e -> - scsb.scanOvershootDistance(spnScanOvershootDist_.getInt())); + model_.acquisitions().settingsBuilder().scanSettingsBuilder() + .scanOvershootDistance(spnScanOvershootDist_.getInt())); spnScanRetraceSpeed_.registerListener(e -> - scsb.scanRetraceSpeed(spnScanRetraceSpeed_.getDouble())); + model_.acquisitions().settingsBuilder().scanSettingsBuilder() + .scanRetraceSpeed(spnScanRetraceSpeed_.getDouble())); spnScanAngleFirstView_.registerListener(e -> - scsb.scanAngleFirstView(spnScanAngleFirstView_.getDouble())); + model_.acquisitions().settingsBuilder().scanSettingsBuilder() + .scanAngleFirstView(spnScanAngleFirstView_.getDouble())); cbxScanFromCurrentPosition_.registerListener(e -> - scsb.scanFromCurrentPosition(cbxScanFromCurrentPosition_.isSelected())); + model_.acquisitions().settingsBuilder().scanSettingsBuilder() + .scanFromCurrentPosition(cbxScanFromCurrentPosition_.isSelected())); cbxScanNegativeDirection_.registerListener(e -> - scsb.scanFromNegativeDirection(cbxScanNegativeDirection_.isSelected())); + model_.acquisitions().settingsBuilder().scanSettingsBuilder() + .scanFromNegativeDirection(cbxScanNegativeDirection_.isSelected())); cbxReturnToOriginalPosition_.registerListener(e -> - scsb.scanReturnToOriginalPosition(cbxReturnToOriginalPosition_.isSelected())); + model_.acquisitions().settingsBuilder().scanSettingsBuilder() + .scanReturnToOriginalPosition(cbxReturnToOriginalPosition_.isSelected())); // TODO: better method, change scanner methods to double? final ASIScanner scanner = model_.devices().getDevice("IllumSlice");