diff --git a/src/rawDeepLearningClassifier/dataPlotFX/DLPredDisplayParams.java b/src/rawDeepLearningClassifier/dataPlotFX/DLPredDisplayParams.java index 78b6ca7d..7ad1ffb9 100644 --- a/src/rawDeepLearningClassifier/dataPlotFX/DLPredDisplayParams.java +++ b/src/rawDeepLearningClassifier/dataPlotFX/DLPredDisplayParams.java @@ -33,7 +33,7 @@ public class DLPredDisplayParams implements Serializable, Cloneable, ManagedPara * @see java.lang.Object#clone() */ @Override - protected DLPredDisplayParams clone() { + public DLPredDisplayParams clone() { try { return (DLPredDisplayParams) super.clone(); } catch (CloneNotSupportedException e) { diff --git a/src/rawDeepLearningClassifier/dataPlotFX/DLPredictionPane.java b/src/rawDeepLearningClassifier/dataPlotFX/DLPredictionPane.java index 52fb2a9c..a082d23c 100644 --- a/src/rawDeepLearningClassifier/dataPlotFX/DLPredictionPane.java +++ b/src/rawDeepLearningClassifier/dataPlotFX/DLPredictionPane.java @@ -8,6 +8,7 @@ import javafx.geometry.Pos; import javafx.scene.Node; import javafx.scene.control.ColorPicker; import javafx.scene.control.Label; +import javafx.scene.control.Tooltip; import javafx.scene.layout.Pane; import javafx.scene.paint.Color; import pamViewFX.fxGlyphs.PamSVGIcon; @@ -47,20 +48,30 @@ public class DLPredictionPane extends PamBorderPane implements TDSettingsPane { * Holds all the prediction colour controls. */ private PamVBox predColHolder; + + /** + * Stops the set params from triggering listeners in controls + * that call get params (all sorts of bad things happen if this occurs) + */ + private boolean setParams = false; public DLPredictionPane(DLPredictionPlotInfoFX dlPredictionPlotInfoFX) { + + System.out.println("HELLO PREDICTION PANE"); + this.dlPredictionPlotInfoFX=dlPredictionPlotInfoFX; mainPane = new PamBorderPane(); mainPane.setCenter(predColHolder = new PamVBox()); predColHolder.setSpacing(5); predColHolder.setPadding(new Insets(5,0,0,0)); - if (dlPredictionPlotInfoFX.getDlControl().getDLModel()!=null) { - layoutColourPanes( dlPredictionPlotInfoFX.getDlControl().getDLModel().getClassNames()); - } + this.setParams(); + +// if (dlPredictionPlotInfoFX.getDlControl().getDLModel()!=null) { +// layoutColourPanes( dlPredictionPlotInfoFX.getDlControl().getDLModel().getClassNames()); +// } - this.getParams(); } @Override @@ -84,6 +95,8 @@ public class DLPredictionPane extends PamBorderPane implements TDSettingsPane { } public void setParams() { +// System.out.println("SET params"); + setParams= true; if (dlPredictionPlotInfoFX.getDlControl().getDLModel()!=null) { //populate the prediction pane. @@ -92,6 +105,7 @@ public class DLPredictionPane extends PamBorderPane implements TDSettingsPane { layoutColourPanes(classNames); } + setParams=false; } private void layoutColourPanes(DLClassName[] classNames){ @@ -103,11 +117,27 @@ public class DLPredictionPane extends PamBorderPane implements TDSettingsPane { predColHolder.getChildren().clear(); for (int i=0; i{ @@ -210,6 +244,11 @@ public class DLPredictionPane extends PamBorderPane implements TDSettingsPane { } + public void setLineInfo(LineInfo lineInfo) { + this.colourPicker.setValue(lineInfo.color); + + } + public String getName() { return name; } diff --git a/src/rawDeepLearningClassifier/dataPlotFX/DLPredictionPlotInfoFX.java b/src/rawDeepLearningClassifier/dataPlotFX/DLPredictionPlotInfoFX.java index e40e5f74..411b5a05 100644 --- a/src/rawDeepLearningClassifier/dataPlotFX/DLPredictionPlotInfoFX.java +++ b/src/rawDeepLearningClassifier/dataPlotFX/DLPredictionPlotInfoFX.java @@ -15,12 +15,10 @@ import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataUnit; import dataPlotsFX.TDManagedSymbolChooserFX; import dataPlotsFX.TDSymbolChooserFX; -import dataPlotsFX.clickPlotFX.ClickDisplayParams; import dataPlotsFX.data.TDDataInfoFX; import dataPlotsFX.data.TDDataProviderFX; import dataPlotsFX.data.generic.GenericScaleInfo; import dataPlotsFX.layout.TDGraphFX; -import dataPlotsFX.layout.TDSettingsPane; import dataPlotsFX.projector.TDProjectorFX; import javafx.geometry.Point2D; import javafx.scene.canvas.GraphicsContext; @@ -337,7 +335,7 @@ public class DLPredictionPlotInfoFX extends TDDataInfoFX { * @see dataPlots.data.TDDataInfo#getHidingDialogComponent() */ @Override - public TDSettingsPane getGraphSettingsPane() { + public DLPredictionPane getGraphSettingsPane() { if (predictionSettingsPane==null) { predictionSettingsPane = new DLPredictionPane(this); } @@ -355,6 +353,15 @@ public class DLPredictionPlotInfoFX extends TDDataInfoFX { */ @Override public Serializable getStoredSettings() { + if (dlPredParams.lineInfos!=null) { + for (int i=0; i{ + getGraphSettingsPane().setParams(); + //}); return true; } return false; diff --git a/src/rawDeepLearningClassifier/dataPlotFX/LineInfo.java b/src/rawDeepLearningClassifier/dataPlotFX/LineInfo.java index 2a12326f..d00b47ef 100644 --- a/src/rawDeepLearningClassifier/dataPlotFX/LineInfo.java +++ b/src/rawDeepLearningClassifier/dataPlotFX/LineInfo.java @@ -25,7 +25,12 @@ public class LineInfo implements Serializable, Cloneable{ /** * The colour of the line */ - public Color color = Color.DODGERBLUE; + public transient Color color = Color.DODGERBLUE; + + /** + * Only used when serializing the data... + */ + public double[] colorSerializable = new double[] {30/255., 144/255., 255/255.}; //DODOGER BLUE; /** * True if the line is enabled (shown on the plot) diff --git a/src/rawDeepLearningClassifier/logging/DLDetectionBinarySource.java b/src/rawDeepLearningClassifier/logging/DLDetectionBinarySource.java index fa678d24..00f42522 100644 --- a/src/rawDeepLearningClassifier/logging/DLDetectionBinarySource.java +++ b/src/rawDeepLearningClassifier/logging/DLDetectionBinarySource.java @@ -81,8 +81,6 @@ public class DLDetectionBinarySource extends BinaryDataSource { DLDetection cd = (DLDetection) pamDataUnit; //System.out.println("DLDetecitonBinarySource: packed: " + pamDataUnit.getBasicData().getMeasuredAmplitudeType()); - - // make a byte array output stream and write the data to that, // then dump that down to the main storage stream if (dos == null || bos == null) {