Fixed display bug.

Fixed several display bugs including predictions not showing on PAMGuard stop start.
This commit is contained in:
Jamie Mac 2024-03-08 17:10:17 +00:00
parent ed5968360b
commit 89627f94dc
22 changed files with 107 additions and 100 deletions

View File

@ -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>

View File

@ -502,6 +502,7 @@ 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 *******************

View File

@ -235,6 +235,7 @@
-fx-background-color: -fx-darkbackground;
-fx-background-radius: 5;
-fx-border-radius: 5;
-fx-padding: 0 0 0 0;
}
.popover > .arrow {

View File

@ -60,7 +60,12 @@ public class CPODDDDataInfo extends DDDataInfo<CPODClick> {
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<CPODClick> {
plotProjector.setMaxScrollLimit(lenMS);
plotProjector.setEnableScrollBar(true);
plotProjector.setAxisMinMax(0, 250, Side.BOTTOM);
}
@ -89,7 +93,6 @@ public class CPODDDDataInfo extends DDDataInfo<CPODClick> {
public CPODWaveformPlot(DetectionPlotDisplay detectionPlotDisplay) {
super(detectionPlotDisplay);
// TODO Auto-generated constructor stub
}
@Override

View File

@ -325,7 +325,6 @@ public class CPODPlotInfoFX extends GenericDataPlotInfo {
y2= tdProjector.getYPix(nycl);
break;
}
if (tdProjector.getOrientation()==Orientation.VERTICAL){
@ -381,10 +380,12 @@ 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;

View File

@ -46,7 +46,7 @@ public class CPODTDSettingsPane implements TDSettingsPane {
public CPODTDSettingsPane(CPODPlotInfoFX cpodPlotInfoFX) {
this.cpodPlotInfoFX=cpodPlotInfoFX;
mainPane = createMainPane();
mainPane.setPrefWidth(330);
mainPane.setPrefWidth(400);
}
/**

View File

@ -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

View File

@ -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));
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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<PamDataUnit> 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 );

View File

@ -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<tdProjector.getWidth()) && tC>=0 && lastUnits[chan][i].getX()<tdProjector.getWidth() && 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));
}
}
@ -193,6 +181,7 @@ public abstract class GenericLinePlotInfo extends TDDataInfoFX {
*/
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][];

View File

@ -616,8 +616,9 @@ public class TDDisplayFX extends PamBorderPane {
*/
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);
}
}
}
/**

View File

@ -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<PamDataUnit> 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();

View File

@ -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

View File

@ -55,29 +55,6 @@ public class RawSpectrumPlot extends SpectrumPlot<PamDataUnit> {
}
// @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<PamDataUnit> {
@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);
}

View File

@ -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());
@ -142,12 +146,14 @@ public class LoadQueueProgressData extends PamTaskUpdate {
@Override
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;
}
}

View File

@ -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);

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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;

View File

@ -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) {