diff --git a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/setup/SetupPanel.java b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/setup/SetupPanel.java index 1a3ab5b..50847b1 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/setup/SetupPanel.java +++ b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/setup/SetupPanel.java @@ -52,7 +52,7 @@ public SetupPanel(final LightSheetManagerModel model, final int pathNum) { leftPanel_.add(excitationPanel_, "growx, wrap"); if (model_.devices().getDeviceAdapter().getMicroscopeGeometry() == GeometryType.SCAPE) { singleAxisPanel_ = new SingleAxisPanel(model_); - //leftPanel_.add(singleAxisPanel_, "growx, wrap"); + leftPanel_.add(singleAxisPanel_, "growx, wrap"); } leftPanel_.add(cameraPanel_, "growx, wrap"); diff --git a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/setup/SingleAxisPanel.java b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/setup/SingleAxisPanel.java index 688ac98..fe8b6d9 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/setup/SingleAxisPanel.java +++ b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/setup/SingleAxisPanel.java @@ -40,36 +40,45 @@ private void createUserInterface() { final JLabel lblAmplitude = new JLabel("Amplitude"); final JLabel lblPeriod = new JLabel("Period"); - // scanner.sa().getPatternY().toString() + final String[] patterns = SingleAxis.Pattern.toArray(); - cbxPattern_ = new ComboBox(patterns, - patterns[0], 100, 24); - spnAmplitude_ = Spinner.createDoubleSpinner(0.0, 0.0, 100.0, 1.0); - spnPeriod_ = Spinner.createIntegerSpinner(0, 0, 100, 1); + String pattern = patterns[0]; + double amplitudeY = 0; + int periodY = 0; + if (scanner != null) { + pattern = scanner.sa().getPatternY().toString(); + amplitudeY = (float)scanner.sa().getAmplitudeY(); + periodY = scanner.sa().getPeriodY(); + } + + cbxPattern_ = new ComboBox(patterns, pattern, 100, 24); + + spnAmplitude_ = Spinner.createDoubleSpinner(amplitudeY, 0.0, 100.0, 1.0); + spnPeriod_ = Spinner.createIntegerSpinner(periodY, 0, 100, 1); add(lblPattern, ""); add(cbxPattern_, "wrap"); add(lblAmplitude, ""); add(spnAmplitude_, "wrap"); add(lblPeriod, ""); - add(spnPeriod_, ""); + add(spnPeriod_, ""); } private void createEventHandlers() { -// final ASIScanner galvo = model_.devices() -// .getDevice("IllumSlice"); + final ASIScanner galvo = model_.devices() + .getDevice("IllumSlice"); cbxPattern_.registerListener(e -> { - //galvo.sa().setPatternY(SingleAxis.Pattern.fromString(cbxPattern_.getSelected())); + galvo.sa().setPatternY(SingleAxis.Pattern.fromString(cbxPattern_.getSelected())); }); spnAmplitude_.registerListener(e -> { - //galvo.sa().setAmplitudeY(spnAmplitude_.getFloat()); + galvo.sa().setAmplitudeY(spnAmplitude_.getFloat()); }); spnPeriod_.registerListener(e -> { - //galvo.sa().setPeriodY(spnPeriod_.getInt()); + galvo.sa().setPeriodY(spnPeriod_.getInt()); }); } 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 9864638..c8b57fa 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngine.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngine.java @@ -636,6 +636,7 @@ public void close() { studio_.logs().logMessage("started position polling after acquisition"); frame_.getNavigationPanel().startPolling(); } + } }