Skip to content

Commit

Permalink
Merge pull request #172 from bls337/main
Browse files Browse the repository at this point in the history
improve reliability of channel table
  • Loading branch information
bls337 authored Oct 4, 2023
2 parents 5e6045f + 6982803 commit 0120ee5
Showing 1 changed file with 6 additions and 7 deletions.
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

0 comments on commit 0120ee5

Please sign in to comment.