Data selectors for deep learning models now working with FX

Still have to be implemented in Swing
This commit is contained in:
Jamie Mac 2024-07-15 16:46:30 +01:00
parent 53d6b7bd88
commit 93d12c81ba
8 changed files with 84 additions and 24 deletions

View File

@ -230,7 +230,16 @@ public class ClickControlPane2 extends PamBorderPane implements TDSettingsPane {
dataSelectPane.addSettingsListener(()->{
//dynamic settings pane so have to repaint whenever a control is selected.
getParams();
clickPlotInfo.getTDGraph().repaint(0);
/**
* If there are raw amplitude or frequency panes that have a buffer of painted units then
* these have to be cleared for the data selector
*/
clickPlotInfo.getClickRawPlotManager().clear();
clickPlotInfo.getClickFFTPlotManager().clear();
clickPlotInfo.getTDGraph().repaint(50);
});
this.setCenter(tabPane);
@ -519,7 +528,7 @@ public class ClickControlPane2 extends PamBorderPane implements TDSettingsPane {
getParams();
//on a parameter change must clear the FFT plot.
clickPlotInfo.getClickFFTplotManager().clear();
clickPlotInfo.getClickFFTPlotManager().clear();
clickPlotInfo.getClickRawPlotManager().clear();
clickPlotInfo.getTDGraph().repaint(milliswait);
@ -773,7 +782,7 @@ public class ClickControlPane2 extends PamBorderPane implements TDSettingsPane {
clickPlotInfo.getClickDisplayParams().fftHop = this.fftSpinnerHop.getValue().intValue();
clickPlotInfo.getClickDisplayParams().fftLength = this.fftSpinnerLength.getValue().intValue();
clickPlotInfo.getClickDisplayParams().colourMap = this.spectroControlPane.getColourArrayType();
clickPlotInfo.getClickFFTplotManager().update();
clickPlotInfo.getClickFFTPlotManager().update();
/*** Data select pane****/
//dynamic settings pane so have to repaint whenever a control is selected.

View File

@ -238,7 +238,7 @@ public class ClickPlotInfoFX extends TDDataInfoFX {
ClickDetection click = (ClickDetection) pamDataUnit;
//first check we can generally plot the click
if (!shouldPlot(click)) return null;
// if (!shouldPlot(click)) return null;
//click has passed the first test! Now get the correct data value;
Double val = null;
switch (getCurrentScaleInfo().getDataType()) {
@ -599,21 +599,21 @@ public class ClickPlotInfoFX extends TDDataInfoFX {
// }
/***
* Used to determine which clicks should be plotted on the display by using the click data selector.
* @param click - the click to check.
* @return true to plot the click.
*/
private synchronized boolean shouldPlot(ClickDetection click) {
if (click == null) return false;
dataSelector.scoreData(click);
if (clickDisplayParams.displayChannels > 0 && (clickDisplayParams.displayChannels & click.getChannelBitmap()) == 0) return false;
return true;
}
// /***
// * Used to determine which clicks should be plotted on the display by using the click data selector.
// * @param click - the click to check.
// * @return true to plot the click.
// */
// private synchronized boolean shouldPlot(ClickDetection click) {
//
// if (click == null) return false;
//
// if (dataSelector.scoreData(click)<=0) return false;
//
// if (clickDisplayParams.displayChannels > 0 && (clickDisplayParams.displayChannels & click.getChannelBitmap()) == 0) return false;
//
// return true;
// }
@Override
public TDSymbolChooserFX getSymbolChooser() {
@ -931,7 +931,7 @@ public class ClickPlotInfoFX extends TDDataInfoFX {
* time/frequency displays...
* @return The FFT plot manager.
*/
public ClickFFTPlotManager2 getClickFFTplotManager() {
public ClickFFTPlotManager2 getClickFFTPlotManager() {
return clickFFTplotManager;
}

View File

@ -318,7 +318,6 @@ public abstract class RawWavePlotManager {
//check if we can plot click on this plot pane.
if (!rawClipInfo.shouldDraw(plotNumber, pamDataUnit)) {
//System.out.println("Shoudl not draw!");
return null;
}

View File

@ -1,5 +1,6 @@
package rawDeepLearningClassifier.dataSelector;
import PamView.dialog.PamDialogPanel;
import PamguardMVC.PamDataUnit;
import PamguardMVC.dataSelector.DataSelectParams;
import pamViewFX.fxSettingsPanes.DynamicSettingsPane;
@ -33,10 +34,16 @@ public interface DLDataFilter {
public void setParams(DataSelectParams params);
/**
* Settings controls for this filter.
* @return the cotnrols for this filter.
* Settings controls for the deep learning filter.
* @return the controls for this filter.
*/
public DynamicSettingsPane<DataSelectParams> getSettingsPane();
/**
* Swing settings controls for the data deep learning filter.
* @return Swing dialog for the settings
*/
public PamDialogPanel getSettingsPanel();
}

View File

@ -1,6 +1,7 @@
package rawDeepLearningClassifier.dataSelector;
import PamView.dialog.PamDialogPanel;
import PamguardMVC.PamDataUnit;
import PamguardMVC.dataSelector.DataSelectParams;
import pamViewFX.fxSettingsPanes.DynamicSettingsPane;
@ -27,7 +28,9 @@ public class DLPredictionFilter implements DLDataFilter {
*/
private DLPredictionFilterParams filterParams = new DLPredictionFilterParams();
private DLPredictonPane dlPredictonPane;
private DLPredictonPane dlPredictonPane;
private DLPredictionPanel dlPredictonPanel;
public DLPredictionFilter(DLControl dlcontrol) {
this.dlcontrol = dlcontrol;
@ -96,6 +99,14 @@ public class DLPredictionFilter implements DLDataFilter {
}
return dlPredictonPane;
}
@Override
public PamDialogPanel getSettingsPanel() {
if (dlPredictonPanel ==null) {
dlPredictonPanel = new DLPredictionPanel(this);
}
return dlPredictonPanel;
}
public DLControl getDLControl() {

View File

@ -0,0 +1,34 @@
package rawDeepLearningClassifier.dataSelector;
import javax.swing.JComponent;
import PamView.dialog.PamDialogPanel;
/**
* Swing panel for Deep learning predicitons.
*/
public class DLPredictionPanel implements PamDialogPanel {
public DLPredictionPanel(DLPredictionFilter dlPredictionFilter) {
super();
}
@Override
public JComponent getDialogComponent() {
// TODO Auto-generated method stub
return null;
}
@Override
public void setParams() {
// TODO Auto-generated method stub
}
@Override
public boolean getParams() {
// TODO Auto-generated method stub
return false;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB