Skip to content

Commit

Permalink
Merge pull request #157 from bls337/main
Browse files Browse the repository at this point in the history
add single axis panel back to setup panel
  • Loading branch information
bls337 authored Sep 29, 2023
2 parents a0e5c11 + e9609db commit 7f53b6f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
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

0 comments on commit 7f53b6f

Please sign in to comment.