From d294d3260a76924e162b4f9bbcb6570abb35f7ec Mon Sep 17 00:00:00 2001 From: Jamie Mac Date: Wed, 29 May 2024 08:04:47 +0100 Subject: [PATCH] Bug for MATLAB r export when angles are null --- src/detectionPlotFX/layout/DetectionPlotDisplay.java | 2 +- src/export/MLExport/MLRawExport.java | 4 ++-- src/export/RExport/RRawExport.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/detectionPlotFX/layout/DetectionPlotDisplay.java b/src/detectionPlotFX/layout/DetectionPlotDisplay.java index 1c77fa6e..16120cee 100644 --- a/src/detectionPlotFX/layout/DetectionPlotDisplay.java +++ b/src/detectionPlotFX/layout/DetectionPlotDisplay.java @@ -420,7 +420,7 @@ public class DetectionPlotDisplay extends PamBorderPane { } - System.out.println("Axis Width: " + dDPlotPane.getAxisPane(Side.BOTTOM).getWidth() + " canvas width " + dDPlotPane.getPlotCanvas().getWidth()); +// System.out.println("Axis Width: " + dDPlotPane.getAxisPane(Side.BOTTOM).getWidth() + " canvas width " + dDPlotPane.getPlotCanvas().getWidth()); currentDataInfo.drawData(dDPlotPane.getPlotCanvas().getGraphicsContext2D(), diff --git a/src/export/MLExport/MLRawExport.java b/src/export/MLExport/MLRawExport.java index eb01a350..9271ec9f 100644 --- a/src/export/MLExport/MLRawExport.java +++ b/src/export/MLExport/MLRawExport.java @@ -39,9 +39,9 @@ public class MLRawExport extends MLDataUnitExport{ Matrix angleErrors; if (dataUnit.getLocalisation()!=null) { //bearing angles - angles = DLMatFile.array2Matrix(dataUnit.getLocalisation().getAngles()); + angles = DLMatFile.array2Matrix(dataUnit.getLocalisation().getAngles() == null ? new double[] {0.} : dataUnit.getLocalisation().getAngles()); //angle errors - angleErrors = DLMatFile.array2Matrix(dataUnit.getLocalisation().getAngleErrors()); + angleErrors = DLMatFile.array2Matrix(dataUnit.getLocalisation().getAngleErrors() == null ? new double[] {0.} : dataUnit.getLocalisation().getAngleErrors()); } else { //bearing angles diff --git a/src/export/RExport/RRawExport.java b/src/export/RExport/RRawExport.java index 69ca7784..24f5abaa 100644 --- a/src/export/RExport/RRawExport.java +++ b/src/export/RExport/RRawExport.java @@ -52,9 +52,9 @@ public class RRawExport extends RDataUnitExport { //time delay stuff. if (dataUnit.getLocalisation()!=null) { //bearing angles - rData.add("angles", new DoubleArrayVector(dataUnit.getLocalisation().getAngles())); + rData.add("angles", dataUnit.getLocalisation().getAngles() == null ? new DoubleArrayVector(0.) : new DoubleArrayVector(dataUnit.getLocalisation().getAngles())); //angle errors - rData.add("angleErrors", new DoubleArrayVector(dataUnit.getLocalisation().getAngleErrors())); + rData.add("angleErrors", dataUnit.getLocalisation().getAngleErrors() == null? new DoubleArrayVector(0.) : new DoubleArrayVector(dataUnit.getLocalisation().getAngleErrors())); } else { //bearing angles