mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-22 07:02:29 +00:00
Minor bug fixes and tidying up for exporters
This commit is contained in:
parent
4707830953
commit
9e13e9a8d5
@ -6,8 +6,9 @@
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</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>
|
||||
<attribute name="module" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
|
@ -1,6 +1,5 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding//src/rawDeepLearningClassifer/segmenter/SegmenterProcess.java=UTF-8
|
||||
encoding//src/test=UTF-8
|
||||
encoding//src/test/resources=UTF-8
|
||||
encoding/<project>=UTF-8
|
||||
encoding/src=UTF-8
|
||||
|
@ -1,9 +1,9 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
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.compliance=21
|
||||
org.eclipse.jdt.core.compiler.compliance=18
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=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.reportPreviewFeatures=warning
|
||||
org.eclipse.jdt.core.compiler.release=enabled
|
||||
org.eclipse.jdt.core.compiler.source=21
|
||||
org.eclipse.jdt.core.compiler.source=18
|
||||
|
@ -86,7 +86,7 @@ public abstract class GenericLinePlotInfo extends TDDataInfoFX {
|
||||
|
||||
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);
|
||||
//create the array of last units.
|
||||
lastUnits[chan] = new Point2D[detData.length];
|
||||
|
@ -58,7 +58,7 @@ public class MLExportOverlayMenu extends ExportOverlayMenu {
|
||||
buttonNode = createButton();
|
||||
|
||||
defaultPath=FileSystemView.getFileSystemView().getDefaultDirectory().getPath();
|
||||
defaultPath=defaultPath + "/Pamguard Manual Export";
|
||||
defaultPath=defaultPath + File.separator + "Pamguard Manual Export";
|
||||
|
||||
currentFolder=defaultPath;
|
||||
|
||||
|
@ -49,7 +49,7 @@ public class RExportOverlayMenu extends ExportOverlayMenu {
|
||||
buttonNode = createButton();
|
||||
|
||||
defaultPath=FileSystemView.getFileSystemView().getDefaultDirectory().getPath();
|
||||
defaultPath=defaultPath + "/Pamguard Manual Export";
|
||||
defaultPath=defaultPath + File.separator + "Pamguard Manual Export";
|
||||
|
||||
currentFolder=defaultPath;
|
||||
|
||||
@ -113,8 +113,8 @@ public class RExportOverlayMenu extends ExportOverlayMenu {
|
||||
dataUnits.add(fnDataUnit);
|
||||
}
|
||||
|
||||
RData mlData=rExportManger.dataUnits2R(dataUnits);
|
||||
if (mlData==null ){
|
||||
RData rData=rExportManger.dataUnits2R(dataUnits);
|
||||
if (rData==null ){
|
||||
//do nothing
|
||||
System.out.println("rOverlayMenu: no data units were converted to structs");
|
||||
}
|
||||
@ -134,12 +134,12 @@ public class RExportOverlayMenu extends ExportOverlayMenu {
|
||||
long millisStart=foundDataUnits.getFirstTimeMillis();
|
||||
String currentPath = PamCalendar.formatFileDateTime(millisStart, false);
|
||||
//add data types to the filen,ae
|
||||
for (int i=0 ;i<mlData.rData.length(); i++ ){
|
||||
currentPath=currentPath + "_" + mlData.dataUnitTypes.get(i);
|
||||
for (int i=0 ;i<rData.dataUnitTypes.size(); i++ ){
|
||||
currentPath=currentPath + "_" + rData.dataUnitTypes.get(i);
|
||||
}
|
||||
//add correct file type.
|
||||
currentPath = currentPath + ".RData";
|
||||
currentPath = currentFolder+"/"+currentPath;
|
||||
currentPath = currentFolder+ File.separator+currentPath;
|
||||
|
||||
//now write the file
|
||||
try {
|
||||
@ -155,7 +155,7 @@ public class RExportOverlayMenu extends ExportOverlayMenu {
|
||||
FileOutputStream fos = new FileOutputStream(currentPath);
|
||||
GZIPOutputStream zos = new GZIPOutputStream(fos);
|
||||
RDataWriter writer = new RDataWriter(context, zos);
|
||||
writer.save(mlData.rData.build());
|
||||
writer.save(rData.rData.build());
|
||||
zos.close();
|
||||
writer.close();
|
||||
super.showConfirmOverlay(currentPath, "R");
|
||||
|
@ -11,7 +11,6 @@ import java.util.zip.GZIPOutputStream;
|
||||
import org.renjin.eval.Context;
|
||||
import org.renjin.primitives.io.serialization.RDataWriter;
|
||||
import org.renjin.sexp.DoubleArrayVector;
|
||||
import org.renjin.sexp.IntArrayVector;
|
||||
import org.renjin.sexp.ListVector;
|
||||
import org.renjin.sexp.PairList;
|
||||
import org.renjin.sexp.PairList.Builder;
|
||||
@ -20,7 +19,6 @@ import PamUtils.PamArrayUtils;
|
||||
import PamguardMVC.PamDataUnit;
|
||||
import export.PamDataUnitExporter;
|
||||
import export.MLExport.MLDetectionsManager;
|
||||
import pamViewFX.fxNodes.pamDialogFX.PamDialogFX;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* So everything is stored in memory until saved.
|
||||
*/
|
||||
|
||||
// then
|
||||
PamDataUnit minByTime = PamArrayUtils.getMinTimeMillis(dataUnits);
|
||||
|
||||
|
@ -71,7 +71,7 @@ public class WavFileExportManager implements PamDataUnitExporter {
|
||||
|
||||
|
||||
defaultPath=FileSystemView.getFileSystemView().getDefaultDirectory().getPath();
|
||||
defaultPath=defaultPath + "/Pamguard Manual Export";
|
||||
defaultPath=defaultPath + File.separator + "Pamguard Manual Export";
|
||||
|
||||
currentFolder=defaultPath;
|
||||
}
|
||||
@ -146,7 +146,7 @@ public class WavFileExportManager implements PamDataUnitExporter {
|
||||
|
||||
//add correct file type.
|
||||
currentPath = currentPath + ".wav";
|
||||
currentPath = currentFolder + File.pathSeparator + currentPath;
|
||||
currentPath = currentFolder + File.separator + currentPath;
|
||||
|
||||
return currentPath;
|
||||
|
||||
@ -353,8 +353,6 @@ public class WavFileExportManager implements PamDataUnitExporter {
|
||||
*/
|
||||
private int saveDataUnitWav(DetectionGroupSummary foundDataUnits) {
|
||||
//TODO - need to pad the detections...with zeros.
|
||||
|
||||
|
||||
//System.out.println("Save data unit wav: " + foundDataUnits.getNumDataUnits());
|
||||
|
||||
int n=0;
|
||||
|
Loading…
Reference in New Issue
Block a user