From 89627f94dcb8d68b4b947a3e8497e4e1317cefd2 Mon Sep 17 00:00:00 2001 From: Jamie Mac Date: Fri, 8 Mar 2024 17:10:17 +0000 Subject: [PATCH] Fixed display bug. Fixed several display bugs including predictions not showing on PAMGuard stop start. --- .classpath | 3 +- src/PamModel/PamModel.java | 3 +- src/Resources/css/primer-pamguard.css | 3 +- src/cpod/dataPlotFX/CPODDDDataInfo.java | 7 +++- src/cpod/dataPlotFX/CPODPlotInfoFX.java | 5 ++- src/cpod/dataPlotFX/CPODTDSettingsPane.java | 2 +- src/cpod/fx/CPODGUIFX.java | 16 ++++---- src/dataGram/DatagramManager.java | 2 + src/dataGram/DatagramProgress.java | 17 +++++--- .../connectionNodes/ModuleIconFactory.java | 9 ++++- src/dataPlotsFX/data/TDDataInfoFX.java | 13 +++++-- .../data/generic/GenericLinePlotInfo.java | 33 +++++----------- src/dataPlotsFX/layout/TDDisplayFX.java | 10 +++-- src/dataPlotsFX/layout/TDGraphFX.java | 15 ++++--- .../overlaymark/popUpMenu/TDPopUpMenuAdv.java | 3 +- .../rawDDPlot/RawSpectrumPlot.java | 39 ++++--------------- .../LoadQueueProgressData.java | 10 ++++- src/pamViewFX/PamGuiFX.java | 2 +- .../dataPlotFX/DLPredictionPlotInfoFX.java | 2 +- .../archiveModel/ArchiveModelWorker.java | 4 +- .../genericModel/GenericPrediction.java | 6 +++ .../logging/ModelResultBinaryFactory.java | 3 -- 22 files changed, 107 insertions(+), 100 deletions(-) diff --git a/.classpath b/.classpath index 924124d8..576b210a 100644 --- a/.classpath +++ b/.classpath @@ -6,8 +6,9 @@ - + + diff --git a/src/PamModel/PamModel.java b/src/PamModel/PamModel.java index c10958e0..bc475091 100644 --- a/src/PamModel/PamModel.java +++ b/src/PamModel/PamModel.java @@ -502,7 +502,8 @@ final public class PamModel implements PamSettings { mi.setModulesMenuGroup(sensorsGroup); mi.setToolTipText("Imports CPOD data"); mi.setHidden(SMRUEnable.isEnable() == false); - + mi.addGUICompatabilityFlag(PamGUIManager.FX); //has FX enabled GUI. + /* * ************* Start Displays Group ******************* */ diff --git a/src/Resources/css/primer-pamguard.css b/src/Resources/css/primer-pamguard.css index 026332a5..ece247b6 100644 --- a/src/Resources/css/primer-pamguard.css +++ b/src/Resources/css/primer-pamguard.css @@ -234,7 +234,8 @@ .popover > .content { -fx-background-color: -fx-darkbackground; -fx-background-radius: 5; - -fx-border-radius: 5; + -fx-border-radius: 5; + -fx-padding: 0 0 0 0; } .popover > .arrow { diff --git a/src/cpod/dataPlotFX/CPODDDDataInfo.java b/src/cpod/dataPlotFX/CPODDDDataInfo.java index 5000f5ab..e287db6f 100644 --- a/src/cpod/dataPlotFX/CPODDDDataInfo.java +++ b/src/cpod/dataPlotFX/CPODDDDataInfo.java @@ -60,7 +60,12 @@ public class CPODDDDataInfo extends DDDataInfo { public void setupAxis(PamDataUnit data, double sR, DetectionPlotProjector plotProjector) { super.setupAxis(data, sR, plotProjector); + CPODClick click = (CPODClick) data; + if (click.getWaveData()==null) { + return; + } + double lenMS = (1000.*click.getWaveData()[0].length)/FPODReader.FPOD_WAV_SAMPLERATE; //set the scroller minimum and maximum plotProjector.setMinScrollLimit(0); @@ -68,7 +73,6 @@ public class CPODDDDataInfo extends DDDataInfo { plotProjector.setMaxScrollLimit(lenMS); plotProjector.setEnableScrollBar(true); - plotProjector.setAxisMinMax(0, 250, Side.BOTTOM); } @@ -89,7 +93,6 @@ public class CPODDDDataInfo extends DDDataInfo { public CPODWaveformPlot(DetectionPlotDisplay detectionPlotDisplay) { super(detectionPlotDisplay); - // TODO Auto-generated constructor stub } @Override diff --git a/src/cpod/dataPlotFX/CPODPlotInfoFX.java b/src/cpod/dataPlotFX/CPODPlotInfoFX.java index 5a0a534a..5e7a5b50 100644 --- a/src/cpod/dataPlotFX/CPODPlotInfoFX.java +++ b/src/cpod/dataPlotFX/CPODPlotInfoFX.java @@ -325,7 +325,6 @@ public class CPODPlotInfoFX extends GenericDataPlotInfo { y2= tdProjector.getYPix(nycl); break; - } if (tdProjector.getOrientation()==Orientation.VERTICAL){ @@ -381,12 +380,14 @@ public class CPODPlotInfoFX extends GenericDataPlotInfo { @Override public PamSymbolFX getPamSymbol(PamDataUnit dataUnit, int type) { PamSymbolFX symbol = super.getPamSymbol(dataUnit, type); + if (((CPODClick) dataUnit).getWaveData()!=null && type!=TDSymbolChooserFX.HIGHLIGHT_SYMBOL) { symbol.setLineColor(symbol.getFillColor().darker()); symbol.setHeight(symbol.getHeight()*1.5); symbol.setWidth(symbol.getWidth()*1.5); + return symbol; } - + return symbol; } diff --git a/src/cpod/dataPlotFX/CPODTDSettingsPane.java b/src/cpod/dataPlotFX/CPODTDSettingsPane.java index 3727f8c7..12fe0f6d 100644 --- a/src/cpod/dataPlotFX/CPODTDSettingsPane.java +++ b/src/cpod/dataPlotFX/CPODTDSettingsPane.java @@ -46,7 +46,7 @@ public class CPODTDSettingsPane implements TDSettingsPane { public CPODTDSettingsPane(CPODPlotInfoFX cpodPlotInfoFX) { this.cpodPlotInfoFX=cpodPlotInfoFX; mainPane = createMainPane(); - mainPane.setPrefWidth(330); + mainPane.setPrefWidth(400); } /** diff --git a/src/cpod/fx/CPODGUIFX.java b/src/cpod/fx/CPODGUIFX.java index 25a39cd1..e33f6e27 100644 --- a/src/cpod/fx/CPODGUIFX.java +++ b/src/cpod/fx/CPODGUIFX.java @@ -10,12 +10,12 @@ import pamViewFX.PamControlledGUIFX; public class CPODGUIFX extends PamControlledGUIFX { /** - * The dl control. + * Reference to the CPOD control. */ - private CPODControl2 dlControl; + private CPODControl2 cpodControl; public CPODGUIFX(CPODControl2 cpodControl2) { - // TODO Auto-generated constructor stub + cpodControl = cpodControl2; } @@ -27,19 +27,19 @@ public class CPODGUIFX extends PamControlledGUIFX { * @return a Pane containing controls to change settings for module. */ public SettingsPane getSettingsPane(){ - dlControl.getSettingsPane().setParams(dlControl.getCPODParam()); - return dlControl.getSettingsPane(); + cpodControl.getSettingsPane().setParams(cpodControl.getCPODParam()); + return cpodControl.getSettingsPane(); } @Override public void updateParams() { - CPODParams newParams=dlControl.getSettingsPane().getParams(dlControl.getCPODParam()); + CPODParams newParams=cpodControl.getSettingsPane().getParams(cpodControl.getCPODParam()); if (newParams!=null) { - dlControl.setCPODParams(newParams); + cpodControl.setCPODParams(newParams); } //setup the controlled unit. - dlControl.setupControlledUnit(); + cpodControl.setupControlledUnit(); } @Override diff --git a/src/dataGram/DatagramManager.java b/src/dataGram/DatagramManager.java index 1e8db795..206e5fe9 100644 --- a/src/dataGram/DatagramManager.java +++ b/src/dataGram/DatagramManager.java @@ -539,6 +539,8 @@ public class DatagramManager { else { PamController.getInstance().notifyTaskProgress( new SimplePamTaskUpdate("Finished Datagram Mapping", PamTaskUpdate.STATUS_DONE)); + publish(new DatagramProgress(PamTaskUpdate.STATUS_DONE, 1, 1)); + } } diff --git a/src/dataGram/DatagramProgress.java b/src/dataGram/DatagramProgress.java index 54449946..3fedf3b8 100644 --- a/src/dataGram/DatagramProgress.java +++ b/src/dataGram/DatagramProgress.java @@ -77,8 +77,7 @@ public class DatagramProgress extends PamTaskUpdate { } @Override - public double getProgress() { - System.out.println("DatagramProgress: " + processedUnits + " tot: " + totalUnits); + public double getProgress2() { double progress= ProgressIndicator.INDETERMINATE_PROGRESS; switch(getStatus()) { case DatagramProgress.STATUS_BLOCKCOUNT: @@ -95,13 +94,17 @@ public class DatagramProgress extends PamTaskUpdate { else progress=0; break; } + + //System.out.println("DatagramProgress: " + processedUnits + " tot: " + totalUnits + " progress: " + progress); + return progress; } @Override - public double getProgress2(){ + public double getProgress(){ + //seems like the current point is simply the percentage done... double progress; - if (pointsToUpdate>0) progress=((double)currentPoint)/pointsToUpdate; + if (pointsToUpdate>0) progress=((double)currentPoint)/100.; else progress=0; switch(getStatus()) { case DatagramProgress.STATUS_BLOCKCOUNT: @@ -110,14 +113,16 @@ public class DatagramProgress extends PamTaskUpdate { progress=0; break; case DatagramProgress.STATUS_STARTINGFILE: - progress=((double)currentPoint)/pointsToUpdate; + progress=((double)currentPoint)/100.; break; case DatagramProgress.STATUS_ENDINGFILE: - progress=((double)currentPoint)/pointsToUpdate; + progress=((double)currentPoint)/100.; break; case DatagramProgress.STATUS_UNITCOUNT: break; } + //System.out.println("DatagramProgress2: " + currentPoint + " tot: " + pointsToUpdate + " progress: " + progress); + return progress; } diff --git a/src/dataModelFX/connectionNodes/ModuleIconFactory.java b/src/dataModelFX/connectionNodes/ModuleIconFactory.java index 13ec59ab..e91144d0 100644 --- a/src/dataModelFX/connectionNodes/ModuleIconFactory.java +++ b/src/dataModelFX/connectionNodes/ModuleIconFactory.java @@ -2,6 +2,7 @@ package dataModelFX.connectionNodes; import dataModelFX.DataModelStyle; import javafx.scene.Node; +import javafx.scene.control.Label; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.StackPane; @@ -35,7 +36,7 @@ public class ModuleIconFactory { public enum ModuleIcon { DATAMAP, NMEA, GPS, MAP, SOUND_AQ, SOUND_OUTPUT, FFT, FILTER, CLICK, CLICK_TRAIN, RECORDER, WHISTLE_MOAN, NOISE_BAND, NOISE_FILT, DATABASE, BINARY, TIME_DISPLAY, DETECTION_DISPLAY, ARRAY, DEEP_LEARNING, MATCHED_CLICK_CLASSIFIER, - DECIMATOR + DECIMATOR, CPOD } /** @@ -126,6 +127,9 @@ public class ModuleIconFactory { case DECIMATOR: iconNode = getSVGIcon("/Resources/modules/decimator.svg"); break; + case CPOD: + iconNode = new Label("CPOD"); //TEMP + break; default: break; } @@ -261,6 +265,9 @@ public class ModuleIconFactory { case "decimator.DecimatorControl": icon=ModuleIcon.DECIMATOR; break; + case "cpod.CPODControl2": + icon=ModuleIcon.CPOD; + break; } return icon; } diff --git a/src/dataPlotsFX/data/TDDataInfoFX.java b/src/dataPlotsFX/data/TDDataInfoFX.java index 45185e3f..c070ed31 100644 --- a/src/dataPlotsFX/data/TDDataInfoFX.java +++ b/src/dataPlotsFX/data/TDDataInfoFX.java @@ -12,6 +12,7 @@ import javafx.scene.canvas.GraphicsContext; import javafx.scene.shape.Polygon; import PamController.PamController; import PamUtils.Coordinate3d; +import PamUtils.PamCalendar; import PamUtils.PamUtils; import PamView.HoverData; import PamView.GeneralProjector.ParameterType; @@ -373,8 +374,8 @@ public abstract class TDDataInfoFX { */ public void drawAllDataUnits(int plotNumber, GraphicsContext g, double scrollStart, TDProjectorFX tdProjector) { -// System.out.println("Max double value: " + PamCalendar.formatDateTime((long) Double.MAX_EXPONENT)); -// System.out.println("Max long value: " + PamCalendar.formatDateTime((long) Long.MAX_VALUE)); +// System.out.println("Max double value: " + this.getDataName() + PamCalendar.formatDateTime((long) Double.MAX_EXPONENT)); +// System.out.println("Max long value: " + this.getDataName() + PamCalendar.formatDateTime((long) Long.MAX_VALUE)); PamDataUnit dataUnit = null; @@ -391,7 +392,10 @@ public abstract class TDDataInfoFX { // scrollStart = PamCalendar.getTimeInMillis(); //work out start and stop times long loopEnd = (long) (scrollStart + (tdProjector.getVisibleTime() * 1.5)); - long loopStart = (long) (scrollStart - (tdProjector.getVisibleTime() * .5)); + long loopStart = (long) (scrollStart - (tdProjector.getVisibleTime() * 1.5)); + +// System.out.println("Loop start: " + this.getDataName() + PamCalendar.formatDateTime((long) loopStart)); +// System.out.println("Loop end: " + this.getDataName() + PamCalendar.formatDateTime((long) loopEnd)); //find a number close to the index start, ListIterator it = getUnitIterator( loopStart, plotNumber); @@ -402,6 +406,7 @@ public abstract class TDDataInfoFX { dataUnit = it.next(); count++; if (dataUnit!=null && shouldDraw(plotNumber, dataUnit)) { + if (dataUnit.getEndTimeInMilliseconds() < loopStart) { continue; } @@ -409,11 +414,13 @@ public abstract class TDDataInfoFX { break; } + drawCalls++; drawDataUnit(plotNumber, dataUnit, g, scrollStart, tdProjector ,TDSymbolChooserFX.NORMAL_SYMBOL); } } +// System.out.println("Found: " + drawCalls + " " + this.getDataName() + " to draw"); lastUnitDrawn(g, scrollStart, tdProjector, plotNumber); } //System.out.println("Total data units: " + count+ " draw calls: " +drawCalls ); diff --git a/src/dataPlotsFX/data/generic/GenericLinePlotInfo.java b/src/dataPlotsFX/data/generic/GenericLinePlotInfo.java index 97a06ed9..92e19034 100644 --- a/src/dataPlotsFX/data/generic/GenericLinePlotInfo.java +++ b/src/dataPlotsFX/data/generic/GenericLinePlotInfo.java @@ -2,6 +2,7 @@ package dataPlotsFX.data.generic; import PamController.PamController; import PamUtils.Coordinate3d; +import PamUtils.PamCalendar; import PamView.GeneralProjector; import PamView.HoverData; import PamView.symbol.PamSymbolChooser; @@ -47,21 +48,18 @@ public abstract class GenericLinePlotInfo extends TDDataInfoFX { } - - /* (non-Javadoc) * @see dataPlotsFX.data.TDDataInfoFX#drawDataUnit(int, PamguardMVC.PamDataUnit, javafx.scene.canvas.GraphicsContext, long, dataPlotsFX.projector.TDProjectorFX, int) */ @Override public Polygon drawDataUnit(int plotNumber, PamDataUnit pamDataUnit, GraphicsContext g, double scrollStart, TDProjectorFX tdProjector, int type) { - return drawPredicition(plotNumber, pamDataUnit, g, scrollStart, tdProjector, type); - } + /** - * Get the line data. Each double[] is a seperate line with N evenly spaced data points. + * Get the line data. Each double[] is a separate line with N evenly spaced data points. * @param pamDataUnit - the pam data unit containing the data. * @return the line data. */ @@ -98,15 +96,12 @@ public abstract class GenericLinePlotInfo extends TDDataInfoFX { double timeMillis = pamDataUnit.getTimeMilliseconds()+pamDataUnit.getDurationInMilliseconds()/2; double tC=tdProjector.getTimePix(timeMillis-scrollStart); - //draws lines so tc should be some slop in pixels. if (tC < -1000 || tC>tdProjector.getWidth()+1000) { + //System.out.println("Line is outside display " + tC); return null; } - //TODO -must sort out wrap - //dlControl.getDLParams().sampleHop; - double dataPixel; Coordinate3d c; Color color; @@ -128,16 +123,13 @@ public abstract class GenericLinePlotInfo extends TDDataInfoFX { //brighten the colour up. //color = Color.color(color.getRed()*0.8, color.getGreen()*0.8, color.getBlue()*0.8); - - //System.out.println("TDDataInfoFX: tc: "+tC+ " dataUnitTime: "+PamCalendar.formatTime(timeMillis)+" scrollStart: " - //+PamCalendar.formatTime((long) scrollStart)+" (timeMillis-scrollStart)/1000. "+((timeMillis-scrollStart)/1000.)); - - +// System.out.println("TDDataInfoFX: tc: "+tC+ " dataUnitTime: "+PamCalendar.formatTime((long) timeMillis)+" scrollStart: " +// +PamCalendar.formatTime((long) scrollStart)+" (timeMillis-scrollStart)/1000. "+((timeMillis-scrollStart)/1000.)); + c = tdProjector.getCoord3d(timeMillis, detData[i][j], 0); dataPixel = tdProjector.getYPix(detData[i][j]); - if (lastUnits[chan][i]==null) { lastUnits[chan][i] = new Point2D(tC, dataPixel); g.fillOval(tC, dataPixel, 5,5); @@ -147,7 +139,6 @@ public abstract class GenericLinePlotInfo extends TDDataInfoFX { if (tC>lastUnits[chan][i].getX() && (!this.getTDGraph().isWrap() || (tC=0 && lastUnits[chan][i].getX()0)) { //in wrap mode we can get some weird effects with tC co-ordintates. Still have not quite cracked this... - // if (Math.abs(tC - lastUnits[chan][i].getX())>100) { // System.out.println("tC: " + tC + " lastUnits[i].getX(): " + lastUnits[chan][i].getX() // + " " + tdProjector. getTimeAxis().getPosition((timeMillis-scrollStart)/1000.) + " " + tdProjector.getWidth()); @@ -155,12 +146,9 @@ public abstract class GenericLinePlotInfo extends TDDataInfoFX { g.strokeLine(tC, dataPixel, lastUnits[chan][i].getX(), lastUnits[chan][i].getY()); } lastUnits[chan][i] = new Point2D(tC, dataPixel); - } tdProjector.addHoverData(new HoverData(c , pamDataUnit, 0, plotNumber)); - } - //getSymbolChooser().getPamSymbol(pamDataUnit,type).draw(g, new Point2D(tC, dataPixel)); } } @@ -192,7 +180,8 @@ public abstract class GenericLinePlotInfo extends TDDataInfoFX { * @return the color for that prediciton */ public abstract LineInfo getColor(int i); - + + @Override public Double getDataValue(PamDataUnit pamDataUnit) { //this is not used because we have overridden the super drawing class. @@ -206,15 +195,13 @@ public abstract class GenericLinePlotInfo extends TDDataInfoFX { * @param changeType - notification flag. */ public void notifyChange(int changeType) { - //System.out.println("Prediction NOTIFYMODELCHANGED: "); +// System.out.println("Prediction NOTIFYMODELCHANGED: " + changeType); switch (changeType) { case PamController.CHANGED_PROCESS_SETTINGS: lastUnits = new Point2D[PamConstants.MAX_CHANNELS][]; -; break; case PamController.RUN_NORMAL: lastUnits = new Point2D[PamConstants.MAX_CHANNELS][]; - break; case PamController.PAM_STOPPING: lastUnits = new Point2D[PamConstants.MAX_CHANNELS][]; diff --git a/src/dataPlotsFX/layout/TDDisplayFX.java b/src/dataPlotsFX/layout/TDDisplayFX.java index 94592e3f..afbcdb52 100644 --- a/src/dataPlotsFX/layout/TDDisplayFX.java +++ b/src/dataPlotsFX/layout/TDDisplayFX.java @@ -615,9 +615,10 @@ public class TDDisplayFX extends PamBorderPane { * @param milliSeconds - the master clock position. */ public void scrollDisplayEnd(long milliSeconds) { + - if (!isViewer() && milliSeconds <= lastUpdate && milliSeconds > lastUpdate - tdParametersFX.visibleTimeRange) { - //System.out.println("milliSeconds <= lastUpdate && milliSeconds > lastUpdate - visibleRange"); + if (!isViewer() && lastUpdate>0 && milliSeconds <= lastUpdate && milliSeconds > lastUpdate - tdParametersFX.visibleTimeRange) { +// System.out.println("milliSeconds <= lastUpdate && milliSeconds > lastUpdate - visibleRange"); return; } @@ -849,7 +850,6 @@ public class TDDisplayFX extends PamBorderPane { @Override public void scrollValueChanged(AbstractPamScroller pamScroller) { - // System.out.println("TDDisplayFX: Scroll Value changed: " + System.currentTimeMillis()); // System.out.println(String.format("Scroller value changed get start %s, End %s, pos %s", PamCalendar.formatTime(timeScrollerFX.getMinimumMillis()), // PamCalendar.formatTime(timeScrollerFX.getMaximumMillis()),PamCalendar.formatTime(timeScrollerFX.getValueMillis()))); //have to set the repaint wait millis param to zero or else when scroll bar is moved quickly painting does not occur correctly. @@ -1183,11 +1183,15 @@ public class TDDisplayFX extends PamBorderPane { break; } + //forces a repaint after any changes. + lastUpdate=-1; + if (tdGraphs != null) { for (TDGraphFX tdg:tdGraphs) { tdg.notifyModelChanged(changeType); } } + } /** diff --git a/src/dataPlotsFX/layout/TDGraphFX.java b/src/dataPlotsFX/layout/TDGraphFX.java index c5b39858..4090f9dd 100644 --- a/src/dataPlotsFX/layout/TDGraphFX.java +++ b/src/dataPlotsFX/layout/TDGraphFX.java @@ -1124,7 +1124,7 @@ public class TDGraphFX extends PamBorderPane { * */ public synchronized void repaint(long tm, int flag) { - + // clear the current canvas's if (hasCanvas(flag, BASE_CANVAS)) { baseCanvas.getGraphicsContext2D().clearRect(0, 0, baseCanvas.getWidth(), baseCanvas.getHeight()); @@ -1151,16 +1151,18 @@ public class TDGraphFX extends PamBorderPane { boolean hasBase = false; synchronized (dataList) { for (TDDataInfoFX dataInfo : dataList) { + base = false; + if (!dataInfo.isShowing()) { - // System.out.println("dataInfo.isShowing(): " + dataInfo.getDataName()); + System.out.println("!dataInfo.isShowing(): " + dataInfo.getDataName()); continue; } scaleInfo = dataInfo.getScaleInfo(); if (scaleInfo == null) { - // System.out.println("scale info null " + dataInfo.getDataName() + "index: - // "+dataInfo.getScaleInfoIndex()); +// System.out.println("scale info null " + dataInfo.getDataName() + "index: +// "+dataInfo.getScaleInfoIndex()); continue; } @@ -1183,7 +1185,7 @@ public class TDGraphFX extends PamBorderPane { } ; - // ok so only repaint if we have the right CANVAS + // OK so only repaint if we have the right CANVAS if (base && hasCanvas(flag, BASE_CANVAS)) { paintDataUnits(gc, dataInfo, false); } else if (!base && hasCanvas(flag, FRONT_CANVAS)) { @@ -1287,6 +1289,7 @@ public class TDGraphFX extends PamBorderPane { // PamDataBlock dataBlock = dataInfo.getDataBlock(); // scroll start is the end of the display i.e. the last visible time in the past + // in real time mode. scrollStart = tdDisplay.getTimeScroller().getValueMillisD(); @@ -1524,7 +1527,7 @@ public class TDGraphFX extends PamBorderPane { * @param tm- if within millis of last repaint don't repaint */ public synchronized void repaint(long tm, int flag) { - + // Start of block moved over from the panel repaint(tm) function. long currentTime = System.currentTimeMillis(); if (currentTime - lastTime < tm) { diff --git a/src/dataPlotsFX/overlaymark/popUpMenu/TDPopUpMenuAdv.java b/src/dataPlotsFX/overlaymark/popUpMenu/TDPopUpMenuAdv.java index f2e452dc..8e1647e4 100644 --- a/src/dataPlotsFX/overlaymark/popUpMenu/TDPopUpMenuAdv.java +++ b/src/dataPlotsFX/overlaymark/popUpMenu/TDPopUpMenuAdv.java @@ -66,7 +66,8 @@ public class TDPopUpMenuAdv implements ExtPopMenu { } if (PamGUIManager.isFX()) { - popOver.show(tdGraphFX.getScene().getWindow(), e.getScreenX(), e.getScreenY()); //FX + //TODO - need to shift by the distance to arrow- not arbitrary 40 pixels + popOver.show(tdGraphFX.getScene().getWindow(), e.getScreenX(), e.getScreenY()-40); //FX } else { popOver.show(tdGraphFX, e.getScreenX(), e.getScreenY()); //Swing diff --git a/src/detectionPlotFX/rawDDPlot/RawSpectrumPlot.java b/src/detectionPlotFX/rawDDPlot/RawSpectrumPlot.java index f9242258..ef98e221 100644 --- a/src/detectionPlotFX/rawDDPlot/RawSpectrumPlot.java +++ b/src/detectionPlotFX/rawDDPlot/RawSpectrumPlot.java @@ -54,30 +54,7 @@ public class RawSpectrumPlot extends SpectrumPlot { plotProjector.setEnableScrollBar(true); } - -// @Override -// public double[][] getPowerSpectrum(PamDataUnit data) { -// return ((RawDataHolder) data).getDataTransforms().getPowerSpectrum(((RawDataHolder) data).getWaveData()[0].length); -// } -// @Override -// public double[][] getCepstrum(PamDataUnit data) { -// return ((RawDataHolder) data).getDataTransforms().getCepstrum(((RawDataHolder) data).getWaveData()[0].length); -// //return data.getRawDataTransforms().getCepstrum(channel, cepLength) -// } - - - -// -// public ClickSpectrumPlot(DetectionPlotDisplay displayPlot) { -// super(displayPlot); -// } -// -// -// @Override -// public String getName() { -// return "Spectrum"; -// } -// + /** * New click added to the display. * @param newClick @@ -169,18 +146,16 @@ public class RawSpectrumPlot extends SpectrumPlot { @Override public void paintPlot(PamDataUnit data, GraphicsContext gc, Rectangle rectangle, DetectionPlotProjector projector, int flag) { -// this.lastDataUnit=data; - //System.out.println("Paint plot projector: "+ projector); + + if (((RawDataHolder) data).getWaveData()==null) { + gc.clearRect(0, 0, rectangle.getWidth(), rectangle.getHeight()); + return; + } + if (flag== DetectionPlot.SCROLLPANE_DRAW) { - double[][] waveformTemp = ((RawDataHolder) data).getWaveData(); - if (waveformTemp==null) return; - -// System.out.println("Spectrum plot: " + " " + projector.getMinScrollLimit() + " " -// + projector.getMaxScrollLimit() + " " + projector.getAxis(Side.TOP).getMaxVal() + " wvfrm: " + WaveformPlot.getYScale(waveformTemp)); - WaveformPlot.paintWaveform(waveformTemp, data.getSequenceBitmap(), gc, rectangle, 0, waveformTemp[0].length, WaveformPlot.getYScale(waveformTemp), null, true, false); } diff --git a/src/pamScrollSystem/LoadQueueProgressData.java b/src/pamScrollSystem/LoadQueueProgressData.java index bebb4a9a..949c4cec 100644 --- a/src/pamScrollSystem/LoadQueueProgressData.java +++ b/src/pamScrollSystem/LoadQueueProgressData.java @@ -34,11 +34,13 @@ public class LoadQueueProgressData extends PamTaskUpdate { this.loadEnd = loadEnd; this.loadCurrent = loadCurrent; this.nLoaded = nLoaded; + setDualProgressUpdate(true); } public LoadQueueProgressData(int status) { super(); this.setStatus(PamTaskUpdate.STATUS_DONE); + setDualProgressUpdate(true); } @@ -119,6 +121,7 @@ public class LoadQueueProgressData extends PamTaskUpdate { @Override public double getProgress() { +// System.out.println( getStreamName() + " progress: " + iStream + " of " + totalStreams); if (getStreamName() != null) { return (double )iStream/ (double) totalStreams; } @@ -127,6 +130,7 @@ public class LoadQueueProgressData extends PamTaskUpdate { @Override public String getProgressString() { + if (getState() == LoadQueueProgressData.STATE_LINKINGSUBTABLE) { return String.format("Linking subtable data %d of %d", getIStream(), getTotalStreams()); @@ -141,13 +145,15 @@ public class LoadQueueProgressData extends PamTaskUpdate { } @Override - public double getProgress2() { + public double getProgress2() { +// System.out.println( getStreamName() + " progress2: " + getLoadStart() ); long interval =getLoadEnd() - getLoadStart(); - if (interval == 0) { + if (interval <= 0) { return ProgressIndicator.INDETERMINATE_PROGRESS; } else { long done =getLoadCurrent() - getLoadStart(); +// System.out.println( getStreamName() + " progress2: " + done + " " + interval + " start " + getLoadStart() + " end " + getLoadEnd()) return ((double) done )/ interval; } } diff --git a/src/pamViewFX/PamGuiFX.java b/src/pamViewFX/PamGuiFX.java index aca3d2cc..2acb7f03 100644 --- a/src/pamViewFX/PamGuiFX.java +++ b/src/pamViewFX/PamGuiFX.java @@ -252,7 +252,7 @@ public class PamGuiFX extends StackPane implements PamViewInterface { /**create left hiding pane**/ loadPane=new PamLoadingPane(this.pamGuiManagerFX); hidingLoadPane=new HidingPane(Side.TOP, loadPane, this, false); - hidingLoadPane.setPrefHeight(90); + hidingLoadPane.setPrefHeight(110); hidingLoadPane.removeHideButton(); hidingLoadPane.showHidePane(false); diff --git a/src/rawDeepLearningClassifier/dataPlotFX/DLPredictionPlotInfoFX.java b/src/rawDeepLearningClassifier/dataPlotFX/DLPredictionPlotInfoFX.java index e4e31b42..44fdca6f 100644 --- a/src/rawDeepLearningClassifier/dataPlotFX/DLPredictionPlotInfoFX.java +++ b/src/rawDeepLearningClassifier/dataPlotFX/DLPredictionPlotInfoFX.java @@ -210,7 +210,7 @@ public class DLPredictionPlotInfoFX extends GenericLinePlotInfo { public Polygon drawDataUnit(int plotNumber, PamDataUnit pamDataUnit, GraphicsContext g, double scrollStart, TDProjectorFX tdProjector, int type) { - //System.out.println("Get data type: " + getScaleInfo().getDataType()); +// System.out.println("Get prediciton data type: " + getScaleInfo().getDataType()); if (getScaleInfo().getDataType().equals(ParameterType.FREQUENCY)) { // frequency data ! return drawFrequencyData(plotNumber, pamDataUnit, g, scrollStart, tdProjector, type); } diff --git a/src/rawDeepLearningClassifier/dlClassification/archiveModel/ArchiveModelWorker.java b/src/rawDeepLearningClassifier/dlClassification/archiveModel/ArchiveModelWorker.java index ac045382..10c4bc51 100644 --- a/src/rawDeepLearningClassifier/dlClassification/archiveModel/ArchiveModelWorker.java +++ b/src/rawDeepLearningClassifier/dlClassification/archiveModel/ArchiveModelWorker.java @@ -113,8 +113,8 @@ public class ArchiveModelWorker extends GenericModelWorker { //HACK there seems to be some sort of bug in ketos where the params input shape is correct but the model input shape is wrong. if (dlModel.getInputShape()==null || !dlModel.getInputShape().equals(modelParams.defaultInputShape)) { - System.out.println("Model input shape: " + modelParams.defaultInputShape); - WarnOnce.showWarning("Model shape", "The model shape does not match the model metadata. \n Metadata shape will be used used.", WarnOnce.OK_OPTION); + System.err.println("Model input shape does not match: params: " + modelParams.defaultInputShape + " model: " + dlModel.getInputShape()); + //WarnOnce.showWarning("Model shape", "The model shape does not match the model metadata. \n Metadata shape will be used used.", WarnOnce.OK_OPTION); dlModel.setInputShape(modelParams.defaultInputShape); } diff --git a/src/rawDeepLearningClassifier/dlClassification/genericModel/GenericPrediction.java b/src/rawDeepLearningClassifier/dlClassification/genericModel/GenericPrediction.java index 8e50f89e..57e83218 100644 --- a/src/rawDeepLearningClassifier/dlClassification/genericModel/GenericPrediction.java +++ b/src/rawDeepLearningClassifier/dlClassification/genericModel/GenericPrediction.java @@ -39,6 +39,12 @@ public class GenericPrediction implements PredictionResult { public double analysisTime=0; + /** + * Constructor for a typical generic prediciton. + * @param prob - the probability for each class. + * @param classNameID - the ID's of the class names. + * @param isBinary - true if the model result passed a binary test (usually one species above a threshold) + */ public GenericPrediction(float[] prob, short[] classNameID, boolean isBinary) { this.prob=prob; this.classNameID = classNameID; diff --git a/src/rawDeepLearningClassifier/logging/ModelResultBinaryFactory.java b/src/rawDeepLearningClassifier/logging/ModelResultBinaryFactory.java index 08fb00ee..91b10536 100644 --- a/src/rawDeepLearningClassifier/logging/ModelResultBinaryFactory.java +++ b/src/rawDeepLearningClassifier/logging/ModelResultBinaryFactory.java @@ -115,7 +115,6 @@ public class ModelResultBinaryFactory { try { //System.out.println("Make model result: "); - int type = dis.readByte(); boolean isBinary = dis.readBoolean(); double scale = dis.readFloat(); @@ -150,9 +149,7 @@ public class ModelResultBinaryFactory { result = new GenericPrediction(data, isBinary); break; } - //System.out.println("New model result: "+ type); - return result; } catch (IOException e) {