This commit is contained in:
Douglas Gillespie 2023-10-27 10:06:52 +01:00
commit 6cc01fe77a
11 changed files with 152 additions and 80 deletions

View File

@ -4,7 +4,7 @@
<groupId>org.pamguard</groupId>
<artifactId>Pamguard</artifactId>
<name>Pamguard Java12+</name>
<version>2.02.09</version>
<version>2.02.09b</version>
<description>Pamguard for Java 12+, using Maven to control dependcies</description>
<url>www.pamguard.org</url>
<organization>

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.pamguard</groupId>
<artifactId>Pamguard</artifactId>
<version>2.02.09a</version>
<version>2.02.09b</version>
<name>Pamguard Java12+</name>
<description>Pamguard for Java 12+, using Maven to control dependcies</description>
<url>www.pamguard.org</url>
@ -803,14 +803,14 @@
<!-- not in Maven repository
you may need to copy files from your downloaded PAMGuard source code, e.g. C:\Users\*yourreposfolder*\source\repos\PAMGuardPAMGuard\repo\pamguard\org\x3\2.2.2 to
C:\Users\*yourusername*\.m2\repository\pamguard\org\x3\2.2.2
-->
C:\Users\*yourusername*\.m2\repository\pamguard\org\x3\2.2.2-->
<dependency>
<groupId>pamguard.org</groupId>
<artifactId>x3</artifactId>
<version>2.2.2</version>
<version>2.2.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/it.sauronsoftware/jave -->
<dependency>
<groupId>it.sauronsoftware</groupId>

View File

@ -0,0 +1,4 @@
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
#Thu Oct 26 14:35:14 BST 2023
x3-2.2.3.jar>=
x3-2.2.3.pom>=

View File

@ -0,0 +1,12 @@
#Thu Oct 26 15:50:39 BST 2023
bedatadriven|https\://nexus.bedatadriven.com/content/groups/public/|javadoc=1698327546071
repo|file\://C\:\\Users\\dg50\\source\\repos\\PAMGuardPAMGuard/repo|sources=1698327461721
repo|file\://C\:\\Users\\dg50\\source\\repos\\PAMGuardPAMGuard/repo|javadoc=1698327546071
talan|https\://nexus.talanlabs.com/content/repositories/releases/|javadoc=1698327546071
central|https\://repo1.maven.org/maven2|sources=1698331839689
unidata-all|https\://artifacts.unidata.ucar.edu/repository/unidata-all/|javadoc=1698327546071
talan|https\://nexus.talanlabs.com/content/repositories/releases/|sources=1698331839689
bedatadriven|https\://nexus.bedatadriven.com/content/groups/public/|sources=1698331839689
unidata-all|https\://artifacts.unidata.ucar.edu/repository/unidata-all/|sources=1698331839689
central|https\://repo1.maven.org/maven2|javadoc=1698327546071
repo|file\://C\:\\Users\\dg50\\source\\repos\\PAMGuardDG/repo|sources=1698331839689

View File

@ -0,0 +1,12 @@
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
#Thu Oct 26 14:39:06 BST 2023
@default-talan-https\://nexus.talanlabs.com/content/repositories/releases/.lastUpdated=1698327545863
file\://C\:\\Users\\dg50\\source\\repos\\PAMGuardPAMGuard/repo/.lastUpdated=1698327544361
https\://repo1.maven.org/maven2/.error=
file\://C\:\\Users\\dg50\\source\\repos\\PAMGuardPAMGuard/repo/.error=
https\://artifacts.unidata.ucar.edu/repository/unidata-all/.error=
https\://nexus.bedatadriven.com/content/groups/public/.error=
https\://nexus.bedatadriven.com/content/groups/public/.lastUpdated=1698327545797
https\://artifacts.unidata.ucar.edu/repository/unidata-all/.lastUpdated=1698327545616
https\://repo1.maven.org/maven2/.lastUpdated=1698327546068
https\://nexus.talanlabs.com/content/repositories/releases/.error=Could not transfer artifact pamguard.org\:x3\:jar\:javadoc\:2.2.3 from/to talan (https\://nexus.talanlabs.com/content/repositories/releases/)\: nexus.talanlabs.com

View File

@ -0,0 +1,14 @@
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
#Thu Oct 26 15:50:39 BST 2023
@default-talan-https\://nexus.talanlabs.com/content/repositories/releases/.lastUpdated=1698327461349
file\://C\:\\Users\\dg50\\source\\repos\\PAMGuardPAMGuard/repo/.lastUpdated=1698327459306
https\://repo1.maven.org/maven2/.error=
file\://C\:\\Users\\dg50\\source\\repos\\PAMGuardDG/repo/.error=
https\://nexus.bedatadriven.com/content/groups/public/.error=
https\://artifacts.unidata.ucar.edu/repository/unidata-all/.error=
https\://artifacts.unidata.ucar.edu/repository/unidata-all/.lastUpdated=1698327460817
https\://repo1.maven.org/maven2/.lastUpdated=1698327461652
https\://nexus.talanlabs.com/content/repositories/releases/.error=Could not transfer artifact pamguard.org\:x3\:jar\:sources\:2.2.3 from/to talan (https\://nexus.talanlabs.com/content/repositories/releases/)\: nexus.talanlabs.com
file\://C\:\\Users\\dg50\\source\\repos\\PAMGuardDG/repo/.lastUpdated=1698331839687
file\://C\:\\Users\\dg50\\source\\repos\\PAMGuardPAMGuard/repo/.error=
https\://nexus.bedatadriven.com/content/groups/public/.lastUpdated=1698327461288

Binary file not shown.

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>pamguard.org</groupId>
<artifactId>x3</artifactId>
<version>2.2.3</version>
<description>POM was created from install:install-file</description>
</project>

View File

@ -14,6 +14,7 @@ import javax.sound.sampled.UnsupportedAudioFileException;
import org.codehaus.plexus.util.FileUtils;
import Acquisition.offlineFuncs.AquisitionLoadPoint;
import PamDetection.RawDataUnit;
//import PamUtils.CPUMonitor;
import PamguardMVC.PamDataBlock;
import PamguardMVC.dataOffline.OfflineDataLoadInfo;
import dataMap.OfflineDataMap;
@ -70,9 +71,13 @@ public class WavAudioFile implements PamAudioFileLoader {
FileDataMapPoint mapPoint = offlineFileServer.findFirstMapPoint(mapIt, offlineDataLoadInfo.getStartMillis(), offlineDataLoadInfo.getEndMillis());
if (openSoundFile(mapPoint.getSoundFile()) == false) {
System.out.println("Could not open .wav sound file " + mapPoint.getSoundFile().getAbsolutePath());
System.out.println("Could not open sound file " + mapPoint.getSoundFile().getAbsolutePath());
return false;
}
if (offlineDataLoadInfo.cancel) {
return false;
}
File soundFile;
ByteConverter byteConverter = ByteConverter.createByteConverter(audioFormat);
@ -106,7 +111,11 @@ public class WavAudioFile implements PamAudioFileLoader {
try {
//System.out.println("Skipped " + skipped+ " " + skipBytes + " " + audioInputStream.available());
// CPUMonitor cpuMonitor = new CPUMonitor();
// cpuMonitor.start();
skipped = audioInputStream.skip(skipBytes);
// cpuMonitor.stop();
// System.out.println(cpuMonitor.getSummary("Sound skip: " + skipBytes + " bytes "));
//System.out.println("Offline " + (offlineDataLoadInfo.getStartMillis()-currentTime) + " ms : frame size: " + audioFormat.getFrameSize());
} catch (IOException e) {

View File

@ -31,7 +31,7 @@ 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.09a";
static public final String version = "2.02.09b";
/**
* Release date

View File

@ -175,13 +175,13 @@ public class OfflineDataLoading<T extends PamDataUnit> {
long t4 = t2;
// String orderDates = String.format(" %s to %s",
// PamCalendar.formatDateTime(startMillis), PamCalendar.formatDateTime(endMillis));
// System.out.printf("Offline data order in %s %s from %s to %s\n", pamDataBlock.getDataName(), offlineDataInfo.toString(),
// PamCalendar.formatDBDateTime(offlineDataInfo.getStartMillis()),
// PamCalendar.formatDBDateTime(offlineDataInfo.getEndMillis()));
// if (offlineDataInfo.getEndMillis()-offlineDataInfo.getStartMillis() > 3600000L) {
// System.out.printf("Stupid long load time !");
// return;
// }
// System.out.printf("Offline data order in %s %s from %s to %s\n", pamDataBlock.getDataName(), offlineDataInfo.toString(),
// PamCalendar.formatDBDateTime(offlineDataInfo.getStartMillis()),
// PamCalendar.formatDBDateTime(offlineDataInfo.getEndMillis()));
// if (offlineDataInfo.getEndMillis()-offlineDataInfo.getStartMillis() > 3600000L) {
// System.out.printf("Stupid long load time !");
// return;
// }
try {
if (orderData != null) {
// System.out.println("order Data is not null");
@ -214,18 +214,18 @@ public class OfflineDataLoading<T extends PamDataUnit> {
t3 = System.currentTimeMillis();
waitingDataLoads.add(offlineDataInfo);
return;
// // System.out.println("Wait for old lot to complete " + orderDates);
// while (true) {
// if (orderData==null || orderData.isDone() || orderData.isCancelled()) {
// break;
// }
// waitCount++;
// try {
// Thread.sleep(10, 0);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
// }
// // System.out.println("Wait for old lot to complete " + orderDates);
// while (true) {
// if (orderData==null || orderData.isDone() || orderData.isCancelled()) {
// break;
// }
// waitCount++;
// try {
// Thread.sleep(10, 0);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
// }
}
t4 = System.currentTimeMillis() - t3;
}
@ -259,10 +259,13 @@ public class OfflineDataLoading<T extends PamDataUnit> {
* @param que
*/
public void cancelDataOrder(boolean que) {
// threadMessage("Calling cancelDataOrder");
synchronized (orderLock) {
// threadMessage("cancelDataOrder is in synchronized oderLock");
if (orderData != null) {
try {
orderData.cancelOrder();
boolean isCancelled = orderData.cancelOrder();
// threadMessage("candelDataOrder returned: isCancelled = " + isCancelled);
}
catch (NullPointerException e) {
System.err.println("Null pointer in Cancel data order " + e.getMessage());
@ -319,16 +322,19 @@ public class OfflineDataLoading<T extends PamDataUnit> {
@Override
protected Integer doInBackground() {
// threadMessage("Start background");
try {
// System.out.println("Enter get offline data " + pamDataBlock.getDataName() + " Thread " + Thread.currentThread().getName());
// System.out.println("Enter get offline data " + pamDataBlock.getDataName() + " Thread " + Thread.currentThread().getName());
clearAllFFTBlocks();
// threadMessage("Called clearAllFTBlocks");
int ans = getOfflineData(offlineDataInfo);
// System.out.println("Leave get offline data " + pamDataBlock.getDataName());
// System.out.println("Leave get offline data " + pamDataBlock.getDataName());
if (this == orderData) {
orderData = null;
}
// threadMessage("End background exit code " + ans);
return ans;
}
catch (Exception e) {
@ -338,9 +344,9 @@ public class OfflineDataLoading<T extends PamDataUnit> {
}
return 0;
}
}
@Override
protected void done() {
if (this == orderData) {
@ -354,7 +360,7 @@ public class OfflineDataLoading<T extends PamDataUnit> {
if (isCancelled()) {
status = REQUEST_INTERRUPTED;
//check whether the cancelled thread should be saved for later loading.
// System.out.println("The load has been cancelled: " + offlineDataInfo.getCurrentObserver().getObserverName());
// System.out.println("The load has been cancelled: " + offlineDataInfo.getCurrentObserver().getObserverName());
checkDataReloadQue(offlineDataInfo);
}
else {
@ -376,11 +382,11 @@ public class OfflineDataLoading<T extends PamDataUnit> {
}
// System.out.println("WAITING DATA LOAD");
// System.out.println("WAITING DATA LOAD");
for (int i=0; i<waitingDataLoads.size(); i++){
// System.out.println("OfflineDataLoading.Done(): " + waitingDataLoads.get(i).getCurrentObserver().getObserverName());
// System.out.println("OfflineDataLoading.Done(): " + waitingDataLoads.get(i).getCurrentObserver().getObserverName());
}
// System.out.println("WAITING DATA END");
// System.out.println("WAITING DATA END");
if (!isCancelled()) launchQuedReloadThread();
@ -394,11 +400,17 @@ public class OfflineDataLoading<T extends PamDataUnit> {
}
// private void threadMessage(String message) {
// String name = Thread.currentThread().getName();
// String now = PamCalendar.formatDBDateTime(System.currentTimeMillis(), true);
// System.out.printf("Thread %s load for %s at %s: %s\n", name, pamDataBlock.getDataName(), now, message);
// }
private void launchQuedReloadThread(){
// System.out.println(" launchQuedReloadThread(): ");
// System.out.println(" launchQuedReloadThread(): ");
if (waitingDataLoads.size()>=1){
OfflineDataLoadInfo offlineDataInfo=waitingDataLoads.get(0);
// System.out.println("Removing: " + offlineDataInfo.getCurrentObserver().getObserverName());
// System.out.println("Removing: " + offlineDataInfo.getCurrentObserver().getObserverName());
waitingDataLoads.remove(0);
this.orderOfflineData(offlineDataInfo);
}
@ -470,15 +482,15 @@ public class OfflineDataLoading<T extends PamDataUnit> {
pamDataBlock.clearAll();
// System.out.println("Start loading some offline data: from " + PamCalendar.formatDateTime(offlineDataInfo.getStartMillis() ) +" to "+
// PamCalendar.formatDateTime(offlineDataInfo.getEndMillis() ) + " "+offlineDataInfo.getCurrentObserver().getObserverName() +
// " "+offlineDataInfo.getLoadKeepLayers());
// System.out.println("Start loading some offline data: from " + PamCalendar.formatDateTime(offlineDataInfo.getStartMillis() ) +" to "+
// PamCalendar.formatDateTime(offlineDataInfo.getEndMillis() ) + " "+offlineDataInfo.getCurrentObserver().getObserverName() +
// " "+offlineDataInfo.getLoadKeepLayers());
lastRequestAnswer = pamDataBlock.getParentProcess().getOfflineData(offlineDataInfo);
// System.out.println(String.format("getOfflineData %s has %d units ",
// getDataName(), getUnitsCount()));
// System.out.println("Orderring done: " + offlineDataInfo.getCurrentObserver().getObserverName() + " " + offlineDataInfo.getLoadKeepLayers());
// System.out.println("Orderring done: " + offlineDataInfo.getCurrentObserver().getObserverName() + " " + offlineDataInfo.getLoadKeepLayers());
//reset some of the changeable variables in offline data info.
offlineDataInfo.reset();