Fix bug in CTD dataselector panel.

This commit is contained in:
Douglas Gillespie 2022-06-17 14:25:31 +01:00
parent 410815fcc7
commit df5b3b4dfe

View File

@ -3,6 +3,7 @@ package clickTrainDetector.layout.dataselector;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.GridBagConstraints; import java.awt.GridBagConstraints;
import java.awt.GridBagLayout; import java.awt.GridBagLayout;
import java.util.ArrayList;
import javax.swing.JCheckBox; import javax.swing.JCheckBox;
import javax.swing.JComponent; import javax.swing.JComponent;
@ -15,6 +16,7 @@ import PamView.dialog.PamDialog;
import PamView.dialog.PamDialogPanel; import PamView.dialog.PamDialogPanel;
import PamView.dialog.PamGridBagContraints; import PamView.dialog.PamGridBagContraints;
import PamguardMVC.dataSelector.DataSelectParams; import PamguardMVC.dataSelector.DataSelectParams;
import clickTrainDetector.classification.CTClassifier;
import clickTrainDetector.classification.CTClassifierManager; import clickTrainDetector.classification.CTClassifierManager;
import clickTrainDetector.dataselector.CTDataSelector; import clickTrainDetector.dataselector.CTDataSelector;
import clickTrainDetector.dataselector.CTSelectParams; import clickTrainDetector.dataselector.CTSelectParams;
@ -287,9 +289,11 @@ public class CTDataSelectPanel implements PamDialogPanel {
// System.out.println("No. count: " + count); // System.out.println("No. count: " + count);
currentParams.classifier = new int[count]; currentParams.classifier = new int[count];
ArrayList<CTClassifier> classifiers = ctDataSelector.getClickControl().getClassifierManager().getCurrentClassifiers();
int used = 0;
for (int i=0; i<classifierCheckBoxes.length; i++) { for (int i=0; i<classifierCheckBoxes.length; i++) {
if (classifierCheckBoxes[i].isSelected()) { if (classifierCheckBoxes[i].isSelected()) {
currentParams.classifier[i] = ctDataSelector.getClickControl().getClassifierManager().getCurrentClassifiers().get(i).getSpeciesID(); currentParams.classifier[used++] = classifiers.get(i).getSpeciesID();
} }
} }