From 8b66ea48c1eb74dd4f566c9d8e151636aaa304f8 Mon Sep 17 00:00:00 2001 From: Brandon Date: Thu, 25 Apr 2024 15:33:17 -0700 Subject: [PATCH] change channelGroup in ChannelTableData when using ui --- .../gui/tabs/channels/ChannelTablePanel.java | 12 +++++++++--- .../lightsheetmanager/model/PLogicSCAPE.java | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/channels/ChannelTablePanel.java b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/channels/ChannelTablePanel.java index 4265245..a23117c 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/channels/ChannelTablePanel.java +++ b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/channels/ChannelTablePanel.java @@ -68,6 +68,7 @@ private void createUserInterface() { private void createEventHandlers() { + // add channel btnAddChannel_.registerListener(e -> { table_.getData().addEmptyChannel(); // revalidate(); // updates JScrollBar when adding elements @@ -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) { @@ -93,6 +95,7 @@ private void createEventHandlers() { } }); + // refresh btnRefresh_.registerListener(e -> { // TODO: use settings instead of GUI table_.updatePresetCombos(cmbChannelGroup_.getSelected()); @@ -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()); }); } diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/PLogicSCAPE.java b/src/main/java/org/micromanager/lightsheetmanager/model/PLogicSCAPE.java index 3f30384..d87257f 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/PLogicSCAPE.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/PLogicSCAPE.java @@ -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")) {