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 edd9df426f
commit de97261e96
8 changed files with 84 additions and 24 deletions

View File

@ -230,7 +230,16 @@ public class ClickControlPane2 extends PamBorderPane implements TDSettingsPane {
dataSelectPane.addSettingsListener(()->{ dataSelectPane.addSettingsListener(()->{
//dynamic settings pane so have to repaint whenever a control is selected. //dynamic settings pane so have to repaint whenever a control is selected.
getParams(); 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); this.setCenter(tabPane);
@ -519,7 +528,7 @@ public class ClickControlPane2 extends PamBorderPane implements TDSettingsPane {
getParams(); getParams();
//on a parameter change must clear the FFT plot. //on a parameter change must clear the FFT plot.
clickPlotInfo.getClickFFTplotManager().clear(); clickPlotInfo.getClickFFTPlotManager().clear();
clickPlotInfo.getClickRawPlotManager().clear(); clickPlotInfo.getClickRawPlotManager().clear();
clickPlotInfo.getTDGraph().repaint(milliswait); clickPlotInfo.getTDGraph().repaint(milliswait);
@ -773,7 +782,7 @@ public class ClickControlPane2 extends PamBorderPane implements TDSettingsPane {
clickPlotInfo.getClickDisplayParams().fftHop = this.fftSpinnerHop.getValue().intValue(); clickPlotInfo.getClickDisplayParams().fftHop = this.fftSpinnerHop.getValue().intValue();
clickPlotInfo.getClickDisplayParams().fftLength = this.fftSpinnerLength.getValue().intValue(); clickPlotInfo.getClickDisplayParams().fftLength = this.fftSpinnerLength.getValue().intValue();
clickPlotInfo.getClickDisplayParams().colourMap = this.spectroControlPane.getColourArrayType(); clickPlotInfo.getClickDisplayParams().colourMap = this.spectroControlPane.getColourArrayType();
clickPlotInfo.getClickFFTplotManager().update(); clickPlotInfo.getClickFFTPlotManager().update();
/*** Data select pane****/ /*** Data select pane****/
//dynamic settings pane so have to repaint whenever a control is selected. //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; ClickDetection click = (ClickDetection) pamDataUnit;
//first check we can generally plot the click //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; //click has passed the first test! Now get the correct data value;
Double val = null; Double val = null;
switch (getCurrentScaleInfo().getDataType()) { 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. // * Used to determine which clicks should be plotted on the display by using the click data selector.
* @param click - the click to check. // * @param click - the click to check.
* @return true to plot the click. // * @return true to plot the click.
*/ // */
private synchronized boolean shouldPlot(ClickDetection click) { // private synchronized boolean shouldPlot(ClickDetection click) {
//
if (click == null) return false; // if (click == null) return false;
//
dataSelector.scoreData(click); // if (dataSelector.scoreData(click)<=0) return false;
//
if (clickDisplayParams.displayChannels > 0 && (clickDisplayParams.displayChannels & click.getChannelBitmap()) == 0) return false; // if (clickDisplayParams.displayChannels > 0 && (clickDisplayParams.displayChannels & click.getChannelBitmap()) == 0) return false;
//
return true; // return true;
} // }
@Override @Override
public TDSymbolChooserFX getSymbolChooser() { public TDSymbolChooserFX getSymbolChooser() {
@ -931,7 +931,7 @@ public class ClickPlotInfoFX extends TDDataInfoFX {
* time/frequency displays... * time/frequency displays...
* @return The FFT plot manager. * @return The FFT plot manager.
*/ */
public ClickFFTPlotManager2 getClickFFTplotManager() { public ClickFFTPlotManager2 getClickFFTPlotManager() {
return clickFFTplotManager; return clickFFTplotManager;
} }

View File

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

View File

@ -1,5 +1,6 @@
package rawDeepLearningClassifier.dataSelector; package rawDeepLearningClassifier.dataSelector;
import PamView.dialog.PamDialogPanel;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
import PamguardMVC.dataSelector.DataSelectParams; import PamguardMVC.dataSelector.DataSelectParams;
import pamViewFX.fxSettingsPanes.DynamicSettingsPane; import pamViewFX.fxSettingsPanes.DynamicSettingsPane;
@ -33,10 +34,16 @@ public interface DLDataFilter {
public void setParams(DataSelectParams params); public void setParams(DataSelectParams params);
/** /**
* Settings controls for this filter. * Settings controls for the deep learning filter.
* @return the cotnrols for this filter. * @return the controls for this filter.
*/ */
public DynamicSettingsPane<DataSelectParams> getSettingsPane(); 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; package rawDeepLearningClassifier.dataSelector;
import PamView.dialog.PamDialogPanel;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
import PamguardMVC.dataSelector.DataSelectParams; import PamguardMVC.dataSelector.DataSelectParams;
import pamViewFX.fxSettingsPanes.DynamicSettingsPane; import pamViewFX.fxSettingsPanes.DynamicSettingsPane;
@ -29,6 +30,8 @@ public class DLPredictionFilter implements DLDataFilter {
private DLPredictonPane dlPredictonPane; private DLPredictonPane dlPredictonPane;
private DLPredictionPanel dlPredictonPanel;
public DLPredictionFilter(DLControl dlcontrol) { public DLPredictionFilter(DLControl dlcontrol) {
this.dlcontrol = dlcontrol; this.dlcontrol = dlcontrol;
checkParamsClass() ; checkParamsClass() ;
@ -97,6 +100,14 @@ public class DLPredictionFilter implements DLDataFilter {
return dlPredictonPane; return dlPredictonPane;
} }
@Override
public PamDialogPanel getSettingsPanel() {
if (dlPredictonPanel ==null) {
dlPredictonPanel = new DLPredictionPanel(this);
}
return dlPredictonPanel;
}
public DLControl getDLControl() { public DLControl getDLControl() {
return this.dlcontrol; return this.dlcontrol;

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