From 7ddf4d6eb94b245ada404ab81f0d6eea66262ee2 Mon Sep 17 00:00:00 2001 From: Jamie Mac Date: Mon, 11 Mar 2024 13:51:13 +0000 Subject: [PATCH] Bug fixes to sud file time --- .gitignore | 1 + src/Acquisition/sud/SUDFileTime.java | 8 +++++++- .../basicSweep/SweepClassifierWorker.java | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e9e0078c..7e3060e7 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,4 @@ settings.xml .settings/org.eclipse.jdt.core.prefs .settings/org.eclipse.core.resources.prefs .classpath +.classpath diff --git a/src/Acquisition/sud/SUDFileTime.java b/src/Acquisition/sud/SUDFileTime.java index 92ac94ca..c0ccc16b 100644 --- a/src/Acquisition/sud/SUDFileTime.java +++ b/src/Acquisition/sud/SUDFileTime.java @@ -45,11 +45,17 @@ public class SUDFileTime { // return Long.MIN_VALUE; // } // long t = sudMap.getFirstChunkTimeMillis(); + System.out.println("Error getting time from SUD file: " + file==null? null : (file.getName() + " size: " + file.length() / (1024 * 1024) + " MB")); + long t = SudAudioInputStream.quickFileTime(file); t=t/1000; //turn to milliseconds. - if (t != 0) { + if (t > 0) { sudTime = t; } + else { + //an error has occurred + System.err.println("Error getting time from SUD file: " + file==null? null : (file.getName() + " size: " + file.length() / (1024 * 1024) + " MB")); + } // sudAudioInputStream.addSudFileListener((chunkID, sudChunk)->{ // ChunkHeader chunkHead = sudChunk.chunkHeader; diff --git a/src/clickDetector/ClickClassifiers/basicSweep/SweepClassifierWorker.java b/src/clickDetector/ClickClassifiers/basicSweep/SweepClassifierWorker.java index 6a52b01c..15af8d1d 100644 --- a/src/clickDetector/ClickClassifiers/basicSweep/SweepClassifierWorker.java +++ b/src/clickDetector/ClickClassifiers/basicSweep/SweepClassifierWorker.java @@ -629,7 +629,8 @@ public class SweepClassifierWorker { * @return true if bearing limits are passed */ private boolean testBearings(ClickDetection click, SweepClassifierSet scs) { - + if (click.getLocalisation()==null) return true; + if (click.getLocalisation().getAngles()==null) return true; //passes the test if there is no bearing info. double bearing = click.getLocalisation().getAngles()[0];