V2.02.14b

Fix XML writer bug
Add code to remove old garbage from log file folder
This commit is contained in:
Douglas Gillespie 2024-11-20 09:23:36 +00:00
parent abca8f5ff7
commit 655310a270
9 changed files with 104 additions and 14 deletions

View File

@ -6,7 +6,7 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/ojdk-21.0.1">
<attributes>
<attribute name="module" value="true"/>
<attribute name="maven.pomderived" value="true"/>

View File

@ -4,7 +4,7 @@
<groupId>org.pamguard</groupId>
<artifactId>Pamguard</artifactId>
<name>Pamguard</name>
<version>2.02.14a</version>
<version>2.02.14b</version>
<description>Pamguard using Maven to control dependencies</description>
<url>www.pamguard.org</url>
<organization>
@ -137,6 +137,13 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<reuseForks>false</reuseForks>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
@ -163,19 +170,25 @@
<name>bedatadriven public repo</name>
<url>https://nexus.bedatadriven.com/content/groups/public/</url>
</repository>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>talan</id>
<name>talan</name>
<url>https://nexus.talanlabs.com/content/repositories/releases/</url>
</repository>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.11.3</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>junit-jupiter-params</artifactId>
<groupId>org.junit.jupiter</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<reporting>
<plugins>
<plugin>
@ -185,6 +198,17 @@
</plugin>
</plugins>
</reporting>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.11.3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<properties>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.pamguard</groupId>
<artifactId>Pamguard</artifactId>
<version>2.02.14a</version>
<version>2.02.14b</version>
<name>Pamguard</name>
<description>Pamguard using Maven to control dependencies</description>
<url>www.pamguard.org</url>

View File

@ -1,6 +1,9 @@
package PamController;
import java.io.File;
import java.io.FilenameFilter;
import org.apache.commons.io.filefilter.FileFilterUtils;
import PamUtils.FileFunctions;
@ -143,6 +146,57 @@ public class PamFolders {
return homeFolder;
}
/**
* Delete temporary files that get dumped in the homd folder, but not deleted properly
* if PAMGuard crashes. It's possible that some may be locked by the current, or other
* running processes, so don't worry too much if some can't delete.
* @param string file mask for deleteion
*/
public static boolean deleteTempFiles(String fileMask) {
return deleteTempFiles(getHomeFolder(), fileMask);
}
public static boolean deleteTempFiles(String root, String fileMask) {
File rootFolder = new File(root);
if (rootFolder.exists() == false) {
return false;
}
String[] files = null;
try {
files = rootFolder.list(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
if (name.endsWith(fileMask)) {
return true;
}
return false;
}
});
}
catch (Exception e) {
return false;
}
if (files == null) return true;
int success = 0;
int fail = 0;
for (int i = 0; i < files.length; i ++) {
try {
File aFile = new File(root + File.separator + files[i]);
if (aFile.delete()) {
success++;
}
else {
fail++;
}
}
catch (Exception e) {
System.out.printf("Unable to delete temp file %s\n", files[i]);
}
}
return true;
}
}

View File

@ -31,12 +31,12 @@ public class PamguardVersionInfo {
* Version number, major version.minorversion.sub-release.
* Note: can't go higher than sub-release 'f'
*/
static public final String version = "2.02.14a";
static public final String version = "2.02.14b";
/**
* Release date
*/
static public final String date = " 28 October 2024";
static public final String date = " 20 November 2024";
// /**
// * Release type - Beta or Core

View File

@ -1091,7 +1091,6 @@ final public class PamModel implements PamSettings {
// clear the current list
pluginList.clear();
daqList.clear();
/*
* If developing a new PAMPlugin in eclipse, the easiest way to do it is to make a new
* Eclipse project for your plugin code. Within that project, copy this PamModel class

View File

@ -82,6 +82,9 @@ public class NIDaqParams extends SoundCardParameters implements Serializable, Cl
}
PamParameterSet ps = super.getParameterSet();
if (ps == null) {
return null;
}
try {
Field field = this.getClass().getDeclaredField("aiRange");
ps.put(new PrivatePamParameterData(this, field) {

View File

@ -42,6 +42,7 @@ import com.formdev.flatlaf.FlatLightLaf;
import Acquisition.FolderInputSystem;
import PamController.PamController;
import PamController.PamFolders;
import PamController.PamGUIManager;
import PamController.PamRunModeDialog;
import PamController.PamRunModeParams;
@ -722,6 +723,12 @@ public class Pamguard {
private static class FolderSizeMonitor implements Runnable {
@Override
public void run() {
PamFolders.deleteTempFiles(".x86_64.dll");
PamFolders.deleteTempFiles(".dll.lck");
PamFolders.deleteTempFiles(".tmp");
PamFolders.deleteTempFiles("-sqlitejdbc.dll");
while(true) {
long length = 0;
File dir = new File(getSettingsFolder());

View File

@ -87,6 +87,9 @@ public class SimParameters extends SoundCardParameters implements Cloneable, Ser
}
PamParameterSet ps = super.getParameterSet();
if (ps == null) {
return null;
}
try {
Field field = this.getClass().getDeclaredField("simObjects");
ps.put(new PrivatePamParameterData(this, field) {