Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add single axis panel back to setup panel #157

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ public void close() {
studio_.logs().logMessage("started position polling after acquisition");
frame_.getNavigationPanel().startPolling();
}

}
}

Expand Down