Minor bug fixes and tidying up for exporters

This commit is contained in:
Jamie Mac 2024-05-28 16:53:20 +01:00
parent 4707830953
commit 9e13e9a8d5
8 changed files with 16 additions and 21 deletions

View File

@ -6,8 +6,9 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk-21.0.2.13-hotspot">
<attributes> <attributes>
<attribute name="module" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>

View File

@ -1,6 +1,5 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
encoding//src/rawDeepLearningClassifer/segmenter/SegmenterProcess.java=UTF-8 encoding//src/rawDeepLearningClassifer/segmenter/SegmenterProcess.java=UTF-8
encoding//src/test=UTF-8
encoding//src/test/resources=UTF-8 encoding//src/test/resources=UTF-8
encoding/<project>=UTF-8 encoding/<project>=UTF-8
encoding/src=UTF-8 encoding/src=UTF-8

View File

@ -1,9 +1,9 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=21 org.eclipse.jdt.core.compiler.codegen.targetPlatform=18
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=21 org.eclipse.jdt.core.compiler.compliance=18
org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@ -13,4 +13,4 @@ org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=21 org.eclipse.jdt.core.compiler.source=18

View File

@ -86,7 +86,7 @@ public abstract class GenericLinePlotInfo extends TDDataInfoFX {
double[][] detData = getDetData(pamDataUnit); double[][] detData = getDetData(pamDataUnit);
if (lastUnits[chan]==null && detData!=null) { if ((lastUnits[chan]==null || lastUnits[chan].length<1) && detData!=null) {
//System.out.println("lastUnits: " + lastUnits); //System.out.println("lastUnits: " + lastUnits);
//create the array of last units. //create the array of last units.
lastUnits[chan] = new Point2D[detData.length]; lastUnits[chan] = new Point2D[detData.length];

View File

@ -58,7 +58,7 @@ public class MLExportOverlayMenu extends ExportOverlayMenu {
buttonNode = createButton(); buttonNode = createButton();
defaultPath=FileSystemView.getFileSystemView().getDefaultDirectory().getPath(); defaultPath=FileSystemView.getFileSystemView().getDefaultDirectory().getPath();
defaultPath=defaultPath + "/Pamguard Manual Export"; defaultPath=defaultPath + File.separator + "Pamguard Manual Export";
currentFolder=defaultPath; currentFolder=defaultPath;

View File

@ -49,7 +49,7 @@ public class RExportOverlayMenu extends ExportOverlayMenu {
buttonNode = createButton(); buttonNode = createButton();
defaultPath=FileSystemView.getFileSystemView().getDefaultDirectory().getPath(); defaultPath=FileSystemView.getFileSystemView().getDefaultDirectory().getPath();
defaultPath=defaultPath + "/Pamguard Manual Export"; defaultPath=defaultPath + File.separator + "Pamguard Manual Export";
currentFolder=defaultPath; currentFolder=defaultPath;
@ -113,8 +113,8 @@ public class RExportOverlayMenu extends ExportOverlayMenu {
dataUnits.add(fnDataUnit); dataUnits.add(fnDataUnit);
} }
RData mlData=rExportManger.dataUnits2R(dataUnits); RData rData=rExportManger.dataUnits2R(dataUnits);
if (mlData==null ){ if (rData==null ){
//do nothing //do nothing
System.out.println("rOverlayMenu: no data units were converted to structs"); System.out.println("rOverlayMenu: no data units were converted to structs");
} }
@ -134,12 +134,12 @@ public class RExportOverlayMenu extends ExportOverlayMenu {
long millisStart=foundDataUnits.getFirstTimeMillis(); long millisStart=foundDataUnits.getFirstTimeMillis();
String currentPath = PamCalendar.formatFileDateTime(millisStart, false); String currentPath = PamCalendar.formatFileDateTime(millisStart, false);
//add data types to the filen,ae //add data types to the filen,ae
for (int i=0 ;i<mlData.rData.length(); i++ ){ for (int i=0 ;i<rData.dataUnitTypes.size(); i++ ){
currentPath=currentPath + "_" + mlData.dataUnitTypes.get(i); currentPath=currentPath + "_" + rData.dataUnitTypes.get(i);
} }
//add correct file type. //add correct file type.
currentPath = currentPath + ".RData"; currentPath = currentPath + ".RData";
currentPath = currentFolder+"/"+currentPath; currentPath = currentFolder+ File.separator+currentPath;
//now write the file //now write the file
try { try {
@ -155,7 +155,7 @@ public class RExportOverlayMenu extends ExportOverlayMenu {
FileOutputStream fos = new FileOutputStream(currentPath); FileOutputStream fos = new FileOutputStream(currentPath);
GZIPOutputStream zos = new GZIPOutputStream(fos); GZIPOutputStream zos = new GZIPOutputStream(fos);
RDataWriter writer = new RDataWriter(context, zos); RDataWriter writer = new RDataWriter(context, zos);
writer.save(mlData.rData.build()); writer.save(rData.rData.build());
zos.close(); zos.close();
writer.close(); writer.close();
super.showConfirmOverlay(currentPath, "R"); super.showConfirmOverlay(currentPath, "R");

View File

@ -11,7 +11,6 @@ import java.util.zip.GZIPOutputStream;
import org.renjin.eval.Context; import org.renjin.eval.Context;
import org.renjin.primitives.io.serialization.RDataWriter; import org.renjin.primitives.io.serialization.RDataWriter;
import org.renjin.sexp.DoubleArrayVector; import org.renjin.sexp.DoubleArrayVector;
import org.renjin.sexp.IntArrayVector;
import org.renjin.sexp.ListVector; import org.renjin.sexp.ListVector;
import org.renjin.sexp.PairList; import org.renjin.sexp.PairList;
import org.renjin.sexp.PairList.Builder; import org.renjin.sexp.PairList.Builder;
@ -20,7 +19,6 @@ import PamUtils.PamArrayUtils;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
import export.PamDataUnitExporter; import export.PamDataUnitExporter;
import export.MLExport.MLDetectionsManager; import export.MLExport.MLDetectionsManager;
import pamViewFX.fxNodes.pamDialogFX.PamDialogFX;
/** /**
* Handles exporting pam data units into an rdata. * Handles exporting pam data units into an rdata.
@ -57,7 +55,6 @@ public class RExportManager implements PamDataUnitExporter {
* Note - there is no way to save data units to R files wothout loading the file into memory. * Note - there is no way to save data units to R files wothout loading the file into memory.
* So everything is stored in memory until saved. * So everything is stored in memory until saved.
*/ */
// then // then
PamDataUnit minByTime = PamArrayUtils.getMinTimeMillis(dataUnits); PamDataUnit minByTime = PamArrayUtils.getMinTimeMillis(dataUnits);

View File

@ -71,7 +71,7 @@ public class WavFileExportManager implements PamDataUnitExporter {
defaultPath=FileSystemView.getFileSystemView().getDefaultDirectory().getPath(); defaultPath=FileSystemView.getFileSystemView().getDefaultDirectory().getPath();
defaultPath=defaultPath + "/Pamguard Manual Export"; defaultPath=defaultPath + File.separator + "Pamguard Manual Export";
currentFolder=defaultPath; currentFolder=defaultPath;
} }
@ -146,7 +146,7 @@ public class WavFileExportManager implements PamDataUnitExporter {
//add correct file type. //add correct file type.
currentPath = currentPath + ".wav"; currentPath = currentPath + ".wav";
currentPath = currentFolder + File.pathSeparator + currentPath; currentPath = currentFolder + File.separator + currentPath;
return currentPath; return currentPath;
@ -353,8 +353,6 @@ public class WavFileExportManager implements PamDataUnitExporter {
*/ */
private int saveDataUnitWav(DetectionGroupSummary foundDataUnits) { private int saveDataUnitWav(DetectionGroupSummary foundDataUnits) {
//TODO - need to pad the detections...with zeros. //TODO - need to pad the detections...with zeros.
//System.out.println("Save data unit wav: " + foundDataUnits.getNumDataUnits()); //System.out.println("Save data unit wav: " + foundDataUnits.getNumDataUnits());
int n=0; int n=0;