diff --git a/src/clipgenerator/ClipDialog.java b/src/clipgenerator/ClipDialog.java index b46f593d..188cc5b2 100644 --- a/src/clipgenerator/ClipDialog.java +++ b/src/clipgenerator/ClipDialog.java @@ -17,12 +17,14 @@ import javax.swing.JRadioButton; import javax.swing.SwingConstants; import javax.swing.border.TitledBorder; +import PamController.PamController; import PamDetection.RawDataUnit; import PamUtils.SelectFolder; import PamView.dialog.PamDialog; import PamView.dialog.PamGridBagContraints; import PamView.dialog.SourcePanel; import PamguardMVC.PamDataBlock; +import PamguardMVC.PamRawDataBlock; public class ClipDialog extends PamDialog { @@ -71,7 +73,19 @@ public class ClipDialog extends PamDialog { } private void setParams() { - sourcePanel.setSource(clipSettings.dataSourceName); + + boolean found = sourcePanel.setSource(clipSettings.dataSourceName); + if (!found) { + PamRawDataBlock rawDataBlock = (PamRawDataBlock) PamController.getInstance().getDataBlockByLongName(clipControl.clipSettings.dataSourceName); + if (rawDataBlock == null) { + // have changed dialog to use long data name. More robust. Old configs will get null + // from that, so use this instead. + rawDataBlock = PamController.getInstance().getRawDataBlock(clipControl.clipSettings.dataSourceName); + } + if (rawDataBlock != null) { + sourcePanel.setSource(rawDataBlock); + } + } storagePanel.setParams(); clipPanel.setParams(); enableControls(); @@ -79,7 +93,7 @@ public class ClipDialog extends PamDialog { @Override public boolean getParams() { - clipSettings.dataSourceName = sourcePanel.getSource().getDataName(); + clipSettings.dataSourceName = sourcePanel.getSource().getLongDataName(); if (clipSettings.dataSourceName == null) { return showWarning("No data source"); } diff --git a/src/clipgenerator/ClipProcess.java b/src/clipgenerator/ClipProcess.java index 0654efdd..0dd56ee0 100644 --- a/src/clipgenerator/ClipProcess.java +++ b/src/clipgenerator/ClipProcess.java @@ -394,7 +394,12 @@ public class ClipProcess extends SpectrogramMarkProcess { */ public synchronized void subscribeDataBlocks() { unSubscribeDataBlocks(); - rawDataBlock = PamController.getInstance().getRawDataBlock(clipControl.clipSettings.dataSourceName); + rawDataBlock = (PamRawDataBlock) PamController.getInstance().getDataBlockByLongName(clipControl.clipSettings.dataSourceName); + if (rawDataBlock == null) { + // have changed dialog to use long data name. More robust. Old configs will get null + // from that, so use this instead. + rawDataBlock = PamController.getInstance().getRawDataBlock(clipControl.clipSettings.dataSourceName); + } setParentDataBlock(rawDataBlock, true); int nBlocks = clipControl.clipSettings.getNumClipGenerators(); diff --git a/src/rawDeepLearningClassifier/dlClassification/DLTaskThread.java b/src/rawDeepLearningClassifier/dlClassification/DLTaskThread.java index c1d77c41..fa0e7c41 100644 --- a/src/rawDeepLearningClassifier/dlClassification/DLTaskThread.java +++ b/src/rawDeepLearningClassifier/dlClassification/DLTaskThread.java @@ -49,7 +49,7 @@ public abstract class DLTaskThread extends Thread { // System.out.println("ORCASPOT THREAD while: " + "The queue size is " + queue.size()); try { if (queue.size()>0) { - System.out.println("DL TASK THREAD: " + "The queue size is " + queue.size()); +// System.out.println("DL TASK THREAD: " + "The queue size is " + queue.size()); ArrayList groupedRawData = queue.remove(0); ArrayList modelResult = dlModelWorker.runModel(groupedRawData,