mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-22 07:02:29 +00:00
commit
c182279d38
2
pom.xml
2
pom.xml
@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.pamguard</groupId>
|
||||
<artifactId>Pamguard</artifactId>
|
||||
<version>2.02.04a</version>
|
||||
<version>2.02.04f</version>
|
||||
<name>Pamguard Java12+</name>
|
||||
<description>Pamguard for Java 12+, using Maven to control dependcies</description>
|
||||
<url>www.pamguard.org</url>
|
||||
|
@ -222,6 +222,9 @@ abstract public class PamSymbolManager<T extends PamSymbolChooser> implements Pa
|
||||
* @param psc
|
||||
*/
|
||||
private void addSuperDetectionModifiers(PamSymbolChooser psc) {
|
||||
/**
|
||||
* This is going in an infinite loop. Need to do something to stop it !
|
||||
*/
|
||||
ArrayList<SuperDetDataBlock> superDetBlocks = OfflineSuperDetFilter.findPossibleSuperDetections(getPamDataBlock());
|
||||
|
||||
// Debug.out.println("The number of super det datablock is: " + superDetBlocks + " for the chooser: " + psc);
|
||||
@ -233,6 +236,12 @@ abstract public class PamSymbolManager<T extends PamSymbolChooser> implements Pa
|
||||
if (superMan == null) {
|
||||
continue;
|
||||
}
|
||||
if (superBlock == getPamDataBlock()) {
|
||||
continue;
|
||||
}
|
||||
if (superBlock.getClass() == getPamDataBlock().getClass()) {
|
||||
continue;
|
||||
}
|
||||
// Debug.out.println("The number of super det datablock superMan: " + superMan + " for the chooser: " + psc);
|
||||
|
||||
PamSymbolChooser superSC = superMan.getSymbolChooser("Super det': " + psc.getDisplayName(), psc.getProjector());
|
||||
|
@ -46,6 +46,7 @@ public abstract class CTDetectionGroupDataUnit extends DetectionGroupDataUnit im
|
||||
public int addSubDetections(List<PamDataUnit> list) {
|
||||
int h = super.addSubDetections(list);
|
||||
this.calcMinMaxAng();
|
||||
|
||||
//make sure there is a non null start sample otherwise
|
||||
//the click trian detector will crash in real time mode.
|
||||
// this.calcStartSample();
|
||||
|
@ -86,13 +86,20 @@ public class ClickTrainProcess extends PamInstantProcess {
|
||||
|
||||
//TODO - this is a bit messy. Ideally probably should have the datablock's long name in the settings but
|
||||
//this would break previous configurations...
|
||||
sourceDataBlock = PamController.getInstance().getDataBlock(ClickDetection.class,
|
||||
getClickTrainParams().dataSourceName);
|
||||
// sourceDataBlock = PamController.getInstance().getDataBlock(ClickDetection.class,
|
||||
// getClickTrainParams().dataSourceName);
|
||||
/*
|
||||
* Identify by long name since that is unique, otherwise doesn't work with multiple click detectors.
|
||||
*/
|
||||
sourceDataBlock = PamController.getInstance().getDataBlockByLongName(getClickTrainParams().dataSourceName);
|
||||
if (sourceDataBlock == null) {
|
||||
// otherwise find any click detector.
|
||||
sourceDataBlock = PamController.getInstance().getDataBlock(ClickDetection.class, 0);
|
||||
}
|
||||
|
||||
if (sourceDataBlock==null) {
|
||||
sourceDataBlock = PamController.getInstance().getDataBlock(CPODClick.class,
|
||||
getClickTrainParams().dataSourceName);
|
||||
|
||||
}
|
||||
|
||||
//System.out.println("CPOD sample rate: " + sourceDataBlock.getSampleRate());
|
||||
|
@ -154,7 +154,6 @@ public class BearingClassifier implements CTClassifier {
|
||||
|
||||
Debug.out.println("SPECIESID!! " + speciesID);
|
||||
|
||||
|
||||
return new BearingClassification(speciesID, meanBearingD, medianBearingD, stdBearingD);
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ public class StandardClassifier implements CTClassifier {
|
||||
for (int i=0; i<classifiers.size(); i++) {
|
||||
if (standardClssfrParams.ctClassifierParams[i]==null) {
|
||||
//set default settings
|
||||
standardClssfrParams.ctClassifierParams[i]= classifiers.get(i).getParams();
|
||||
standardClssfrParams.ctClassifierParams[i] = classifiers.get(i).getParams();
|
||||
}
|
||||
else {
|
||||
//the standard classifier should have settings set.
|
||||
@ -178,6 +178,7 @@ public class StandardClassifier implements CTClassifier {
|
||||
}
|
||||
|
||||
public StandardClassifierParams getParams() {
|
||||
|
||||
return standardClssfrParams;
|
||||
}
|
||||
|
||||
|
@ -848,6 +848,7 @@ public class MHTKernel<T> {
|
||||
*/
|
||||
public T getLastDataUnit() {
|
||||
if (this.dataUnits==null) return null;
|
||||
if (this.dataUnits.size()<1) return null;
|
||||
return dataUnits.get(dataUnits.size()-1);
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ public class CTFXGUI extends PamControlledGUIFX {
|
||||
//data source may have potentially changed. e.g. by a datamodelfx Need to set in params.
|
||||
//System.out.println("FFTControl: CHANGED_PROCESS_SETTINGS : " +fftProcess.getParentDataBlock());
|
||||
if (clickTrainControl.getClickTrainProcess().getParentDataBlock()!=null){
|
||||
clickTrainControl.getClickTrainParams().dataSourceName=clickTrainControl.getClickTrainProcess().getParentDataBlock().getDataName();
|
||||
clickTrainControl.getClickTrainParams().dataSourceName=clickTrainControl.getClickTrainProcess().getParentDataBlock().getLongDataName();
|
||||
}
|
||||
else clickTrainControl.getClickTrainParams().dataSourceName="";
|
||||
break;
|
||||
|
@ -94,7 +94,7 @@ public class CTSwingGUI extends PamControlledGUISwing {
|
||||
|
||||
@Override
|
||||
public JMenuItem createDetectionMenu(Frame parentFrame) {
|
||||
JMenu submenu = new JMenu("Click Train Detector");
|
||||
JMenu submenu = new JMenu(clickTrainControl.getUnitName());
|
||||
|
||||
JMenuItem menuItem = new JMenuItem("Detection Settings ...");
|
||||
|
||||
|
@ -408,7 +408,7 @@ public class ClickTrainAlgorithmPaneFX extends SettingsPane<ClickTrainParams> {
|
||||
public ClickTrainParams getParams(ClickTrainParams currParams) {
|
||||
try {
|
||||
currParams.dataSourceIndex = sourcePane.getSourceIndex();
|
||||
currParams.dataSourceName = sourcePane.getSourceName();
|
||||
currParams.dataSourceName = sourcePane.getSourceLongName();
|
||||
|
||||
|
||||
//use the data selector.
|
||||
@ -511,7 +511,7 @@ public class ClickTrainAlgorithmPaneFX extends SettingsPane<ClickTrainParams> {
|
||||
|
||||
// and fill in the data source list (may have changed - or might in later versions)
|
||||
ArrayList<PamDataBlock> rd = PamController.getInstance().getDataBlocks(ClickDetection.class, true);
|
||||
PamDataBlock datablock = PamController.getInstance().getRawDataBlock(clickTrainParams.dataSourceName);
|
||||
PamDataBlock datablock = PamController.getInstance().getDataBlockByLongName(clickTrainParams.dataSourceName);
|
||||
|
||||
//use the data selector.
|
||||
dataSelectorCheckBox.setSelected(clickTrainParams.useDataSelector);
|
||||
|
@ -170,12 +170,17 @@ public class CTClassifierPane extends PamBorderPane {
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
classifierListBox.getSelectionModel().select(params.type);
|
||||
|
||||
|
||||
setClassifierPane(params.type);
|
||||
|
||||
//species Id
|
||||
setBasicParams(params);
|
||||
|
||||
|
||||
|
||||
// //when setting parameters have to figure out what pane to create first!
|
||||
// currentClassifier = clickTrainControl.getClassifierManager().createClassifier(params.type);
|
||||
// //Classifier pane
|
||||
@ -197,7 +202,9 @@ public class CTClassifierPane extends PamBorderPane {
|
||||
*/
|
||||
private void setClassifierPane(CTClassifierType ctClassifierType) {
|
||||
if (ctClassifierType==null) return;
|
||||
|
||||
currentClassifier = clickTrainControl.getClassifierManager().createClassifier(ctClassifierType);
|
||||
|
||||
//Classifier pane- this also sets parameters for the classifier specific pane
|
||||
if (currentClassifier.getCTClassifierGraphics()!=null) {
|
||||
settingsHolder.setCenter(currentClassifier.getCTClassifierGraphics().getCTClassifierPane());
|
||||
|
@ -228,6 +228,7 @@ public class CTClassifiersPane extends PamBorderPane {
|
||||
|
||||
//set the parameters.
|
||||
tab = (ClassifierTab) pamTabPane.getTabs().get(i);
|
||||
|
||||
//set the parameters for the tab.
|
||||
tab.getCTClassifierPane().setParams(clickTrainParams.ctClassifierParams[i]);
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public class BearingClassifierGraphics implements CTClassifierGraphics {
|
||||
bearingClassifierPane = new BearingClassifierPane(bearingClassifer);
|
||||
}
|
||||
//params are set here.
|
||||
bearingClassifierPane.setParams(bearingClassifer.getParams());
|
||||
//bearingClassifierPane.setParams(bearingClassifer.getParams()); <- warning - causes an error in which params are overriden
|
||||
return (Pane) bearingClassifierPane.getContentNode();
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ public class BearingClassifierPane extends SettingsPane<BearingClassifierParams
|
||||
currParams.minStdBearingD = Math.toRadians(params.min.doubleValue());
|
||||
currParams.maxStdBearingD = Math.toRadians(params.max.doubleValue());
|
||||
currParams.useStD = params.enabled;
|
||||
|
||||
|
||||
return currParams;
|
||||
}
|
||||
|
||||
@ -126,6 +126,7 @@ public class BearingClassifierPane extends SettingsPane<BearingClassifierParams
|
||||
|
||||
@Override
|
||||
public void setParams(BearingClassifierParams input) {
|
||||
|
||||
//bearing limits
|
||||
this.bearingLims.setParams(Math.toDegrees(input.bearingLimMin), Math.toDegrees(input.bearingLimMax), true);
|
||||
|
||||
|
@ -366,7 +366,7 @@ public class CTDataSelectPanel implements PamDialogPanel {
|
||||
return true;
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
// e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -134,9 +134,12 @@ public abstract class SpectrumPlot <D extends PamDataUnit> implements Detection
|
||||
this.sR=sR;
|
||||
|
||||
int[] minmax = getAxisMinMaxSamples(plotProjector);
|
||||
|
||||
if (minmax[1]>=data.getSampleDuration()) minmax[1]=(int) (data.getSampleDuration()-1);
|
||||
|
||||
if (data.getSampleDuration()!=null) {
|
||||
if (minmax[1]>=data.getSampleDuration()) minmax[1]=(int) (data.getSampleDuration()-1);
|
||||
}
|
||||
if (minmax[0]<0 || minmax[0]>=minmax[1]) minmax[0]=0;
|
||||
|
||||
|
||||
//System.out.println("Min max: " + minmax[0] + " " + minmax[1]);
|
||||
|
||||
|
@ -14,7 +14,9 @@ import javax.swing.JCheckBoxMenuItem;
|
||||
import javax.swing.JMenu;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.JPopupMenu;
|
||||
import javax.swing.JPopupMenu.Separator;
|
||||
import javax.swing.JRadioButtonMenuItem;
|
||||
import javax.swing.JSeparator;
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import PamView.PamSymbol;
|
||||
@ -197,6 +199,12 @@ public class PamUtilsFX {
|
||||
if (JMenuItem.class.isAssignableFrom(item.getClass())) {
|
||||
itemList.add(swingMenuItemToFX( (JMenuItem) item));
|
||||
}
|
||||
else {
|
||||
Component unkItem = item;
|
||||
if (item instanceof Separator) {
|
||||
// MenuItem mi = new Separator();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return itemList;
|
||||
@ -300,6 +308,9 @@ public class PamUtilsFX {
|
||||
radioItem.setSelected(((JRadioButtonMenuItem) swingItem).isSelected());
|
||||
|
||||
}
|
||||
// else if (swingItem.getClass() == JSeparator.class) {
|
||||
//
|
||||
// }
|
||||
if (fxItem == null) {
|
||||
return null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user