diff --git a/src/Acquisition/AcquisitionControl.java b/src/Acquisition/AcquisitionControl.java index b9410172..af2dddae 100644 --- a/src/Acquisition/AcquisitionControl.java +++ b/src/Acquisition/AcquisitionControl.java @@ -878,6 +878,7 @@ public class AcquisitionControl extends RawInputControlledUnit implements PamSet public InputStoreInfo getStoreInfo(boolean detail) { return getDaqProcess().getStoreInfo(detail); } + @Override public boolean setAnalysisStartTime(long startTime) { return getDaqProcess().setAnalysisStartTime(startTime); diff --git a/src/Acquisition/AcquisitionProcess.java b/src/Acquisition/AcquisitionProcess.java index c5e331fc..bfb67695 100644 --- a/src/Acquisition/AcquisitionProcess.java +++ b/src/Acquisition/AcquisitionProcess.java @@ -65,7 +65,7 @@ import pamScrollSystem.ViewLoadObserver; * @see PamguardMVC.PamDataUnit * */ -public class AcquisitionProcess extends PamProcess implements DataInputStore { +public class AcquisitionProcess extends PamProcess { public static final int LASTDATA = 2; // don't use zero since need to see if no notification has been received. @@ -1235,7 +1235,6 @@ public class AcquisitionProcess extends PamProcess implements DataInputStore { return daqStatusDataBlock; } - @Override public InputStoreInfo getStoreInfo(boolean detail) { if (runningSystem instanceof DataInputStore) { return ((DataInputStore) runningSystem).getStoreInfo(detail); @@ -1245,7 +1244,6 @@ public class AcquisitionProcess extends PamProcess implements DataInputStore { } } - @Override public boolean setAnalysisStartTime(long startTime) { if (runningSystem instanceof DataInputStore) { return ((DataInputStore) runningSystem).setAnalysisStartTime(startTime); diff --git a/src/PamController/DataInputStore.java b/src/PamController/DataInputStore.java index af4f5a4b..ce7330e8 100644 --- a/src/PamController/DataInputStore.java +++ b/src/PamController/DataInputStore.java @@ -28,4 +28,11 @@ public interface DataInputStore { */ public boolean setAnalysisStartTime(long startTime); + /** + * Very specific command handler for batch status which will only work + * with the acquisition folderinputSystem or the tritech file processing. + * @return + */ + public String getBatchStatus(); + } diff --git a/src/PamController/command/BatchStatusCommand.java b/src/PamController/command/BatchStatusCommand.java index 046dff3e..5c56aacc 100644 --- a/src/PamController/command/BatchStatusCommand.java +++ b/src/PamController/command/BatchStatusCommand.java @@ -1,6 +1,10 @@ package PamController.command; +import java.util.ArrayList; + import Acquisition.AcquisitionControl; +import PamController.DataInputStore; +import PamController.PamControlledUnit; import PamController.PamController; import offlineProcessing.OfflineTaskManager; import pamViewFX.PamControlledGUIFX; @@ -35,7 +39,16 @@ public class BatchStatusCommand extends ExtCommand { } private String getNormalModeStatus(String command) { - AcquisitionControl daqControl = (AcquisitionControl) PamController.getInstance().findControlledUnit(AcquisitionControl.class, null); + /** + * find a controlled unit thats a DataInputSource which should either be a sound daq or a Tritech daq module. + */ + ArrayList inputSources = PamController.getInstance().findControlledUnits(DataInputStore.class, true); + if (inputSources.size() == 0) { + return null; + } +// DataInputStore daqControl = (DataInputStore) PamController.getInstance().findControlledUnit(DataInputStore.class, null); + DataInputStore daqControl = (DataInputStore) inputSources.get(0); +// System.out.println("Getting batch status from : " + daqControl); if (daqControl == null) { return null; } diff --git a/src/PamUtils/FileList.java b/src/PamUtils/FileList.java index b6612180..7297ac76 100644 --- a/src/PamUtils/FileList.java +++ b/src/PamUtils/FileList.java @@ -60,17 +60,19 @@ public class FileList { // System.out.println("Adding files from folder " + folder.getAbsolutePath()); // first go through all the files in this folder File[] newFiles = folder.listFiles(fileFilter); + if (newFiles == null) { + return fileList; // nothing to do here. + } for (int i = 0; i < newFiles.length; i++) { if (!newFiles[i].isDirectory()) { fileList.add(newFiles[i]); -// System.out.println(" adding file " + newFiles[i].getName()); + // System.out.println(" adding file " + newFiles[i].getName()); } else if (includeSubFolders) { fileList = addFiles(newFiles[i], fileList, fileFilter, includeSubFolders); } } - - + return fileList; } }