From d1b40c1d86651d5f10e1638a866977351736eb1a Mon Sep 17 00:00:00 2001 From: Douglas Gillespie <50671166+douggillespie@users.noreply.github.com> Date: Mon, 18 Dec 2023 16:48:36 +0000 Subject: [PATCH] Release V2.02.09e fixes to WMD stub removal to make it a lot faster. --- dependency-reduced-pom.xml | 2 +- pom.xml | 2 +- src/PamController/PamguardVersionInfo.java | 6 +++--- src/PamView/PamGui.java | 20 +++++++++----------- src/whistlesAndMoans/StubRemover.java | 8 +++++++- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml index 96e1ff68..fa93561f 100644 --- a/dependency-reduced-pom.xml +++ b/dependency-reduced-pom.xml @@ -4,7 +4,7 @@ org.pamguard Pamguard Pamguard Java12+ - 2.02.09c + 2.02.09e Pamguard for Java 12+, using Maven to control dependcies www.pamguard.org diff --git a/pom.xml b/pom.xml index 18f1ee7d..8c39e533 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 org.pamguard Pamguard - 2.02.09d + 2.02.09e Pamguard Java12+ Pamguard for Java 12+, using Maven to control dependcies www.pamguard.org diff --git a/src/PamController/PamguardVersionInfo.java b/src/PamController/PamguardVersionInfo.java index 7172293c..263632b0 100644 --- a/src/PamController/PamguardVersionInfo.java +++ b/src/PamController/PamguardVersionInfo.java @@ -24,19 +24,19 @@ public class PamguardVersionInfo { * PAMGuard can work with. */ static public final String minJavaVersion = "11.0.0"; - static public final String maxJavaVersion = "19.99.99"; + static public final String maxJavaVersion = "21.99.99"; /** * Version number, major version.minorversion.sub-release. * Note: can't go higher than sub-release 'f' */ - static public final String version = "2.02.09c"; + static public final String version = "2.02.09e"; /** * Release date */ - static public final String date = "10 November 2023"; + static public final String date = "18 December 2023"; // /** // * Release type - Beta or Core diff --git a/src/PamView/PamGui.java b/src/PamView/PamGui.java index 0ebec8a3..bbb4fc73 100644 --- a/src/PamView/PamGui.java +++ b/src/PamView/PamGui.java @@ -601,17 +601,15 @@ public class PamGui extends PamView implements WindowListener, PamSettings { fileMenu.add(menuItem); } - if (SMRUEnable.isEnable()) { - menuItem = new JMenuItem("Import PAMGuard Modules"); - menuItem.setToolTipText("Import module settings from a different PAMGuard configuration (psfx files only"); - menuItem.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - importSettings(); - } - }); - fileMenu.add(menuItem); - } + menuItem = new JMenuItem("Import PAMGuard Modules"); + menuItem.setToolTipText("Import module settings from a different PAMGuard configuration (psfx files only"); + menuItem.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + importSettings(); + } + }); + fileMenu.add(menuItem); fileMenu.addSeparator(); diff --git a/src/whistlesAndMoans/StubRemover.java b/src/whistlesAndMoans/StubRemover.java index e475a36e..3667b179 100644 --- a/src/whistlesAndMoans/StubRemover.java +++ b/src/whistlesAndMoans/StubRemover.java @@ -82,7 +82,13 @@ public class StubRemover { private int searchStubSize(List sliceData, int currentSlice, int peakInd, int searchDir, int diagGap, int currentSize) { int nSlice = sliceData.size(); int nextSliceInd = currentSlice + searchDir; - if (nextSliceInd < 0 || nextSliceInd >= nSlice-1) { + /** + * This function is only every used to throw away very small stubs, so there is no need to get the full size + * of every one. It's OK to return as soon as the size is bigger than the minimum required to make + * something worth keeping. This reduces the time spent tracing down every little alley which was + * severely impacting performance for larger whistles. + */ + if (nextSliceInd < 0 || nextSliceInd >= nSlice-1 || currentSize > whistleControl.getWhistleToneParameters().minPixels) { return currentSize; } SliceData nextSlice = sliceData.get(nextSliceInd);