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

change channelGroup in ChannelTableData when using ui #274

Merged
merged 1 commit into from
Apr 25, 2024
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 @@ -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
Loading