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

improve reliability of channel table #172

Merged
merged 1 commit into from
Oct 4, 2023
Merged
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 @@ -70,7 +70,6 @@ private void createUserInterface() {
}

private void createEventHandlers() {
final DefaultAcquisitionSettingsDISPIM.Builder asb = model_.acquisitions().settingsBuilder();

btnAddChannel_.registerListener(e -> {
table_.getData().addEmptyChannel();
Expand All @@ -81,17 +80,17 @@ private void createEventHandlers() {
System.out.println("add channel");
table_.getData().printChannelData();
final ChannelSpec[] channels = table_.getData().getChannelArray();
asb.channels(channels);
asb.numChannels(channels.length);
model_.acquisitions().settingsBuilder().channels(channels);
model_.acquisitions().settingsBuilder().numChannels(channels.length);
});

btnRemoveChannel_.registerListener(e -> {
final int row = table_.getTable().getSelectedRow();
if (row != -1) {
table_.getData().removeChannel(row);
final ChannelSpec[] channels = table_.getData().getChannelArray();
asb.channels(channels);
asb.numChannels(channels.length);
model_.acquisitions().settingsBuilder().channels(channels);
model_.acquisitions().settingsBuilder().numChannels(channels.length);
table_.refreshData();
System.out.println("remove row index: " + row);
}
Expand All @@ -115,14 +114,14 @@ private void createEventHandlers() {

cmbChannelMode_.registerListener(e -> {
final int index = cmbChannelMode_.getSelectedIndex();
asb.channelMode(MultiChannelMode.getByIndex(index));
model_.acquisitions().settingsBuilder().channelMode(MultiChannelMode.getByIndex(index));
//System.out.println("getChannelMode: " + model_.acquisitions().getAcquisitionSettings().getChannelMode());
});

cmbChannelGroup_.registerListener(e -> {
final String selected = cmbChannelGroup_.getSelected();
table_.updatePresetCombos(selected);
asb.channelGroup(selected);
model_.acquisitions().settingsBuilder().channelGroup(selected);
//System.out.println("getChannelGroup: " + model_.acquisitions().getAcquisitionSettings().getChannelGroup());
});
}
Expand Down