Skip to content

Commit

Permalink
Merge pull request #274 from bls337/main
Browse files Browse the repository at this point in the history
change channelGroup in ChannelTableData when using ui
  • Loading branch information
bls337 authored Apr 25, 2024
2 parents c212c99 + 8b66ea4 commit 2886160
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ private void createUserInterface() {

private void createEventHandlers() {

// add channel
btnAddChannel_.registerListener(e -> {
table_.getData().addEmptyChannel();
// revalidate(); // updates JScrollBar when adding elements
Expand All @@ -81,6 +82,7 @@ private void createEventHandlers() {
model_.acquisitions().settingsBuilder().numChannels(channels.length);
});

// remove channel
btnRemoveChannel_.registerListener(e -> {
final int row = table_.getTable().getSelectedRow();
if (row != -1) {
Expand All @@ -93,6 +95,7 @@ private void createEventHandlers() {
}
});

// refresh
btnRefresh_.registerListener(e -> {
// TODO: use settings instead of GUI
table_.updatePresetCombos(cmbChannelGroup_.getSelected());
Expand All @@ -109,16 +112,19 @@ private void createEventHandlers() {
cmbChannelGroup_.updateUI();
});

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

// select channel group
cmbChannelGroup_.registerListener(e -> {
final String selected = cmbChannelGroup_.getSelected();
table_.updatePresetCombos(selected);
model_.acquisitions().settingsBuilder().channelGroup(selected);
final String channelGroup = cmbChannelGroup_.getSelected();
table_.updatePresetCombos(channelGroup);
table_.getData().setChannelGroup(channelGroup);
model_.acquisitions().settingsBuilder().channelGroup(channelGroup);
//System.out.println("getChannelGroup: " + model_.acquisitions().getAcquisitionSettings().getChannelGroup());
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ private int getPLogicOutputFromChannel(final ChannelSpec channel, final String c
studio_.logs().showError("Must include PLogic \"OutputChannel\" in preset for hardware switching");
return 0;
}
String setting = configData.getSetting(plcLaser_.getDeviceName(), "OutputChannel").getPropertyValue();
final String setting = configData.getSetting(plcLaser_.getDeviceName(), "OutputChannel").getPropertyValue();
if (setting.equals("output 5 only")) {
return 5;
} else if (setting.equals("output 6 only")) {
Expand Down

0 comments on commit 2886160

Please sign in to comment.