|
|
|
@ -39,6 +39,18 @@ import pamViewFX.fxNodes.utilsFX.PamUtilsFX;
|
|
|
|
|
import pamViewFX.PamGuiManagerFX;
|
|
|
|
|
import pamViewFX.fxGlyphs.PamGlyphDude;
|
|
|
|
|
|
|
|
|
|
import java.awt.BorderLayout;
|
|
|
|
|
import java.awt.GridBagConstraints;
|
|
|
|
|
import java.awt.GridBagLayout;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
import javax.swing.JCheckBox;
|
|
|
|
|
import javax.swing.JComboBox;
|
|
|
|
|
import javax.swing.JLabel;
|
|
|
|
|
import javax.swing.JPanel;
|
|
|
|
|
import javax.swing.JTextField;
|
|
|
|
|
|
|
|
|
|
import java.awt.GridBagConstraints;
|
|
|
|
|
import java.awt.GridBagLayout;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
@ -171,10 +183,9 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
spectrumHolder.setPadding(new Insets(10,0,0,0));
|
|
|
|
|
spectrumTab.setContent(spectrumHolder);
|
|
|
|
|
|
|
|
|
|
/*********Bearing Tab****************/
|
|
|
|
|
/*********Spectrum Tab****************/
|
|
|
|
|
Tab bearingTab=new Tab("Bearing");
|
|
|
|
|
bearingTab.setGraphic(PamGlyphDude.createPamIcon("mdi2c-compass-outline", PamGuiManagerFX.iconSize));
|
|
|
|
|
bearingTab.setStyle("-fx-font-size: 14px; -fx-font-weight: bold;");
|
|
|
|
|
spectrumTab.setGraphic(PamGlyphDude.createPamIcon("mdi2c-compass-outline", PamGuiManagerFX.iconSize));
|
|
|
|
|
|
|
|
|
|
PamVBox bearingHolder=new PamVBox(5);
|
|
|
|
|
|
|
|
|
@ -189,7 +200,7 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
|
|
|
|
|
TabPane tabPane= new TabPane();
|
|
|
|
|
tabPane.setTabClosingPolicy(TabClosingPolicy.UNAVAILABLE);
|
|
|
|
|
tabPane.getTabs().addAll(waveformTab, spectrumTab, bearingTab);
|
|
|
|
|
tabPane.getTabs().addAll(waveformTab, spectrumTab);
|
|
|
|
|
|
|
|
|
|
holder.getChildren().add(optionBox);
|
|
|
|
|
holder.getChildren().add(tabPane);
|
|
|
|
@ -684,9 +695,9 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
//create the general options
|
|
|
|
|
private Node createOptionsPane(){
|
|
|
|
|
|
|
|
|
|
// PamGridPane pamGridPane=new PamGridPane();
|
|
|
|
|
// pamGridPane.setHgap(5);
|
|
|
|
|
// pamGridPane.setVgap(5);
|
|
|
|
|
PamGridPane pamGridPane=new PamGridPane();
|
|
|
|
|
pamGridPane.setHgap(5);
|
|
|
|
|
pamGridPane.setVgap(5);
|
|
|
|
|
|
|
|
|
|
simpleFilterPane=new SimpleFilterPaneFX();
|
|
|
|
|
|
|
|
|
@ -820,7 +831,7 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
// PamGridPane.setFillWidth(clickLengthHolder2, false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vboxholder=new PamVBox();
|
|
|
|
|
PamVBox vboxholder=new PamVBox();
|
|
|
|
|
vboxholder.setSpacing(5);
|
|
|
|
|
vboxholder.getChildren().addAll(clickLengthHolder1, clickLengthHolder2);
|
|
|
|
|
|
|
|
|
@ -910,9 +921,7 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
/**
|
|
|
|
|
* Spinner for the first control band
|
|
|
|
|
*/
|
|
|
|
|
private ArrayList<PamSpinner<Double>> thresholdSpinners;
|
|
|
|
|
|
|
|
|
|
private PamGridPane gridPaneHolder;
|
|
|
|
|
private ArrayList<PamSpinner<Double>> thresholdSpinners;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EnergyBandBox() {
|
|
|
|
@ -924,9 +933,9 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
//create the general options
|
|
|
|
|
private Node createOptionsPane(){
|
|
|
|
|
|
|
|
|
|
gridPaneHolder=new PamGridPane();
|
|
|
|
|
gridPaneHolder.setHgap(5);
|
|
|
|
|
gridPaneHolder.setVgap(5);
|
|
|
|
|
PamGridPane pamGridPane=new PamGridPane();
|
|
|
|
|
pamGridPane.setHgap(5);
|
|
|
|
|
pamGridPane.setVgap(5);
|
|
|
|
|
|
|
|
|
|
Label freqLabel=new Label("Frequency (Hz)");
|
|
|
|
|
gridPaneHolder.add(freqLabel, 0, 0);
|
|
|
|
@ -945,7 +954,7 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gridPaneHolder.add(testBandFreqPane, 1, 1);
|
|
|
|
|
pamGridPane.add(testBandFreqPane, 1, 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
contralBandFreqPanes = new ArrayList<FreqBandPane>();
|
|
|
|
@ -953,13 +962,13 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
|
|
|
|
|
for (int i=0; i<SweepClassifierSet.nControlBands ; i++) {
|
|
|
|
|
//control band 1
|
|
|
|
|
gridPaneHolder.add(new Label("Control Band"), 0, i+2);
|
|
|
|
|
pamGridPane.add(new Label("Control Band"), 0, i+2);
|
|
|
|
|
contralBandFreqPanes.add(new FreqBandPane(Orientation.HORIZONTAL));
|
|
|
|
|
contralBandFreqPanes.get(i).setBandText("");
|
|
|
|
|
gridPaneHolder.add(contralBandFreqPanes.get(i), 1, i+2);
|
|
|
|
|
pamGridPane.add(contralBandFreqPanes.get(i), 1, i+2);
|
|
|
|
|
thresholdSpinners.add(new PamSpinner<Double>(0,100.,6.,0));
|
|
|
|
|
thresholdSpinners.get(i).setEditable(true);
|
|
|
|
|
gridPaneHolder.add(thresholdSpinners.get(i), 2, i+2);
|
|
|
|
|
pamGridPane.add(thresholdSpinners.get(i), 2, i+2);
|
|
|
|
|
thresholdSpinners.get(i).getStyleClass().add(Spinner.STYLE_CLASS_SPLIT_ARROWS_HORIZONTAL);
|
|
|
|
|
thresholdSpinners.get(i).setMaxWidth(100);
|
|
|
|
|
|
|
|
|
@ -980,7 +989,7 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return gridPaneHolder;
|
|
|
|
|
return pamGridPane;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1064,13 +1073,11 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void disbleControls(boolean disable) {
|
|
|
|
|
this.gridPaneHolder.setDisable(disable);
|
|
|
|
|
|
|
|
|
|
// testBandFreqPane.setDisableFreqPane(disable);
|
|
|
|
|
// for (int j = 0; j < SweepClassifierSet.nControlBands; j++) {
|
|
|
|
|
// contralBandFreqPanes.get(j).setDisableFreqPane(disable);
|
|
|
|
|
// thresholdSpinners.get(j).setDisable(disable);
|
|
|
|
|
// }
|
|
|
|
|
testBandFreqPane.setDisableFreqPane(disable);
|
|
|
|
|
for (int j = 0; j < SweepClassifierSet.nControlBands; j++) {
|
|
|
|
|
contralBandFreqPanes.get(j).setDisableFreqPane(disable);
|
|
|
|
|
thresholdSpinners.get(j).setDisable(disable);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -1109,34 +1116,34 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
|
|
|
|
|
int gridy=0;
|
|
|
|
|
|
|
|
|
|
gridPaneHolder=new PamGridPane();
|
|
|
|
|
gridPaneHolder.setHgap(5);
|
|
|
|
|
gridPaneHolder.setVgap(5);
|
|
|
|
|
PamGridPane pamGridPane=new PamGridPane();
|
|
|
|
|
pamGridPane.setHgap(5);
|
|
|
|
|
pamGridPane.setVgap(5);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//search and integration range
|
|
|
|
|
gridPaneHolder.add(new Label("Search Range"),1,gridy);
|
|
|
|
|
pamGridPane.add(new Label("Search Range"),1,gridy);
|
|
|
|
|
|
|
|
|
|
searchRange=new FreqBandPane(Orientation.HORIZONTAL);
|
|
|
|
|
searchRange.setBandText("");
|
|
|
|
|
gridPaneHolder.add(searchRange,2,gridy);
|
|
|
|
|
pamGridPane.add(searchRange,2,gridy);
|
|
|
|
|
GridPane.setColumnSpan(searchRange, GridPane.REMAINING);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gridy++;
|
|
|
|
|
|
|
|
|
|
gridPaneHolder.add(new Label("Smooth"), 1,gridy);
|
|
|
|
|
pamGridPane.add(new Label("Smooth"), 1,gridy);
|
|
|
|
|
|
|
|
|
|
smoothing=new PamSpinner<Integer>(3,101,5,2);
|
|
|
|
|
smoothing.getStyleClass().add(Spinner.STYLE_CLASS_SPLIT_ARROWS_HORIZONTAL);
|
|
|
|
|
smoothing.setMaxWidth(100);
|
|
|
|
|
gridPaneHolder.add(smoothing, 2,gridy);
|
|
|
|
|
pamGridPane.add(smoothing, 2,gridy);
|
|
|
|
|
|
|
|
|
|
GridPane.setMargin(smoothing, new Insets(0,0,0,5)); //bit of a hack to make sure everything lines up nicely with the frequency pane.
|
|
|
|
|
|
|
|
|
|
//GridPane.setHgrow(smoothing, Priority.NEVER);
|
|
|
|
|
|
|
|
|
|
gridPaneHolder.add(new Label("bins"), 3,gridy);
|
|
|
|
|
pamGridPane.add(new Label("bins"), 3,gridy);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gridy++;
|
|
|
|
@ -1146,14 +1153,14 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
peakFreqPane.setDisableFreqPane(!peakFreqCheckBox.isSelected());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
gridPaneHolder.add(peakFreqCheckBox,0,gridy);
|
|
|
|
|
pamGridPane.add(peakFreqCheckBox,0,gridy);
|
|
|
|
|
|
|
|
|
|
gridPaneHolder.add(new Label("Peak Frequency"),1,gridy);
|
|
|
|
|
pamGridPane.add(new Label("Peak Frequency"),1,gridy);
|
|
|
|
|
|
|
|
|
|
peakFreqPane=new FreqBandPane(Orientation.HORIZONTAL);
|
|
|
|
|
//peakFreqPane.setHgap(0);
|
|
|
|
|
peakFreqPane.setBandText("");
|
|
|
|
|
gridPaneHolder.add(peakFreqPane,2,gridy);
|
|
|
|
|
pamGridPane.add(peakFreqPane,2,gridy);
|
|
|
|
|
GridPane.setColumnSpan(peakFreqPane, GridPane.REMAINING);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1170,28 +1177,26 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gridPaneHolder.add(peakWidthCheckBox,0,gridy);
|
|
|
|
|
gridPaneHolder.add(new Label("Peak Width"),1,gridy);
|
|
|
|
|
pamGridPane.add(peakWidthCheckBox,0,gridy);
|
|
|
|
|
pamGridPane.add(new Label("Peak Width"),1,gridy);
|
|
|
|
|
|
|
|
|
|
peakWidthPane=new FreqBandPane(Orientation.HORIZONTAL);
|
|
|
|
|
peakWidthPane.setBandText("");
|
|
|
|
|
gridPaneHolder.add(peakWidthPane,2,gridy);
|
|
|
|
|
pamGridPane.add(peakWidthPane,2,gridy);
|
|
|
|
|
GridPane.setColumnSpan(peakWidthPane, GridPane.REMAINING);
|
|
|
|
|
|
|
|
|
|
addValidatorFreqCheck(getValidator(), peakWidthPane, "peak width ", "peak_width");
|
|
|
|
|
|
|
|
|
|
gridy++;
|
|
|
|
|
|
|
|
|
|
gridPaneHolder.add(new Label(""), 1,gridy);
|
|
|
|
|
pamGridPane.add(new Label(""), 1,gridy);
|
|
|
|
|
|
|
|
|
|
threshold=new PamSpinner<Double>(1., 300., 6.,1.);
|
|
|
|
|
threshold.getStyleClass().add(Spinner.STYLE_CLASS_SPLIT_ARROWS_HORIZONTAL);
|
|
|
|
|
threshold.setPrefWidth(100);
|
|
|
|
|
GridPane.setMargin(threshold, new Insets(0,0,0,5)); //bit of a hack to make sure everything lines up nicely with the frequency pane.
|
|
|
|
|
pamGridPane.add(threshold,2,gridy);
|
|
|
|
|
|
|
|
|
|
gridPaneHolder.add(threshold,2,gridy);
|
|
|
|
|
|
|
|
|
|
gridPaneHolder.add(new Label("dB"), 3,gridy);
|
|
|
|
|
pamGridPane.add(new Label("dB"), 3,gridy);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gridy++;
|
|
|
|
@ -1202,19 +1207,19 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
meanFreq.setDisableFreqPane(!meanFreqCheckBox.isSelected());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
gridPaneHolder.add(meanFreqCheckBox,0,gridy);
|
|
|
|
|
pamGridPane.add(meanFreqCheckBox,0,gridy);
|
|
|
|
|
|
|
|
|
|
gridPaneHolder.add(new Label("Mean Frequency"),1,gridy);
|
|
|
|
|
pamGridPane.add(new Label("Mean Frequency"),1,gridy);
|
|
|
|
|
|
|
|
|
|
meanFreq=new FreqBandPane(Orientation.HORIZONTAL);
|
|
|
|
|
meanFreq.setBandText("");
|
|
|
|
|
gridPaneHolder.add(meanFreq,2,gridy);
|
|
|
|
|
pamGridPane.add(meanFreq,2,gridy);
|
|
|
|
|
GridPane.setColumnSpan(meanFreq, GridPane.REMAINING);
|
|
|
|
|
|
|
|
|
|
addValidatorFreqCheck(getValidator(), meanFreq, "mean freq. ", "mean_freq");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return gridPaneHolder;
|
|
|
|
|
return pamGridPane;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1246,6 +1251,20 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
// threshold.setDisable(enable);
|
|
|
|
|
// searchRange.setDisable(enable);
|
|
|
|
|
// meanFreq.setDisable(enable);
|
|
|
|
|
protected void disbleControls(boolean enable) {
|
|
|
|
|
peakFreqCheckBox.setDisable(enable);
|
|
|
|
|
peakWidthCheckBox.setDisable(enable);
|
|
|
|
|
meanFreqCheckBox.setDisable(enable);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Pane to set frequency band range */
|
|
|
|
|
peakFreqPane.setDisable(enable);
|
|
|
|
|
smoothing.setDisable(enable);
|
|
|
|
|
peakWidthPane.setDisable(enable);
|
|
|
|
|
threshold.setDisable(enable);
|
|
|
|
|
searchRange.setDisable(enable);
|
|
|
|
|
meanFreq.setDisable(enable);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -1291,27 +1310,27 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
|
|
|
|
|
private Node createZeroCrossPane(){
|
|
|
|
|
|
|
|
|
|
gridPaneHolder=new PamGridPane();
|
|
|
|
|
gridPaneHolder.setHgap(5);
|
|
|
|
|
gridPaneHolder.setVgap(5);
|
|
|
|
|
PamGridPane pamGridPane=new PamGridPane();
|
|
|
|
|
pamGridPane.setHgap(5);
|
|
|
|
|
pamGridPane.setVgap(5);
|
|
|
|
|
|
|
|
|
|
//Number of zeros crossings
|
|
|
|
|
Label zeroLabel;
|
|
|
|
|
gridPaneHolder.add(zeroLabel = new Label("Number of zero crossings"),0,0);
|
|
|
|
|
pamGridPane.add(zeroLabel = new Label("Number of zero crossings"),0,0);
|
|
|
|
|
|
|
|
|
|
zeroCrossingsMin=new PamSpinner<Integer>(0,999999,0,1);
|
|
|
|
|
zeroCrossingsMin.setEditable(true);
|
|
|
|
|
zeroCrossingsMin.getStyleClass().add(Spinner.STYLE_CLASS_SPLIT_ARROWS_HORIZONTAL);
|
|
|
|
|
zeroCrossingsMin.setPrefWidth(100);
|
|
|
|
|
gridPaneHolder.add(zeroCrossingsMin, 1,0);
|
|
|
|
|
pamGridPane.add(zeroCrossingsMin, 1,0);
|
|
|
|
|
|
|
|
|
|
gridPaneHolder.add(new Label("to"),2,0);
|
|
|
|
|
pamGridPane.add(new Label("to"),2,0);
|
|
|
|
|
|
|
|
|
|
zeroCrossingsMax=new PamSpinner<Integer>(0,999999,0,1);
|
|
|
|
|
zeroCrossingsMax.setEditable(true);
|
|
|
|
|
zeroCrossingsMax.getStyleClass().add(Spinner.STYLE_CLASS_SPLIT_ARROWS_HORIZONTAL);
|
|
|
|
|
zeroCrossingsMax.setPrefWidth(100);
|
|
|
|
|
gridPaneHolder.add(zeroCrossingsMax, 3,0);
|
|
|
|
|
pamGridPane.add(zeroCrossingsMax, 3,0);
|
|
|
|
|
|
|
|
|
|
//this.zeroCrossingsMax=zeroCorssingsMax;
|
|
|
|
|
|
|
|
|
@ -1358,13 +1377,13 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
|
|
|
|
|
//zero crossing freuquency sweep
|
|
|
|
|
|
|
|
|
|
gridPaneHolder.add(new Label("Zero crossing frequency sweep"),0,1);
|
|
|
|
|
pamGridPane.add(new Label("Zero crossing frequency sweep"),0,1);
|
|
|
|
|
|
|
|
|
|
freqZeroMin=new PamSpinner<Double>(0.,999999.,0.,1.);
|
|
|
|
|
freqZeroMin.setEditable(true);
|
|
|
|
|
freqZeroMin.getStyleClass().add(Spinner.STYLE_CLASS_SPLIT_ARROWS_HORIZONTAL);
|
|
|
|
|
freqZeroMin.setPrefWidth(100);
|
|
|
|
|
gridPaneHolder.add(freqZeroMin, 1,1);
|
|
|
|
|
pamGridPane.add(freqZeroMin, 1,1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1373,13 +1392,13 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gridPaneHolder.add(new Label("to"),2,1);
|
|
|
|
|
pamGridPane.add(new Label("to"),2,1);
|
|
|
|
|
|
|
|
|
|
freqZeroMax=new PamSpinner<Double>(0.,999999.,0,1);
|
|
|
|
|
freqZeroMax.setEditable(true);
|
|
|
|
|
freqZeroMax.getStyleClass().add(Spinner.STYLE_CLASS_SPLIT_ARROWS_HORIZONTAL);
|
|
|
|
|
freqZeroMax.setPrefWidth(100);
|
|
|
|
|
gridPaneHolder.add(freqZeroMax, 3,1);
|
|
|
|
|
pamGridPane.add(freqZeroMax, 3,1);
|
|
|
|
|
|
|
|
|
|
getValidator().createCheck()
|
|
|
|
|
.dependsOn("minzerofreq", freqZeroMin.valueProperty())
|
|
|
|
@ -1415,10 +1434,10 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gridPaneHolder.add(new Label("KHz/ms"),4,1);
|
|
|
|
|
pamGridPane.add(new Label("KHz/ms"),4,1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return gridPaneHolder;
|
|
|
|
|
return pamGridPane;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1477,11 +1496,10 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void disbleControls(boolean disable) {
|
|
|
|
|
gridPaneHolder.setDisable(disable);
|
|
|
|
|
// zeroCrossingsMin.setDisable(disable);
|
|
|
|
|
// zeroCrossingsMax.setDisable(disable);
|
|
|
|
|
// freqZeroMin.setDisable(disable);
|
|
|
|
|
// freqZeroMax.setDisable(disable);
|
|
|
|
|
zeroCrossingsMin.setDisable(disable);
|
|
|
|
|
zeroCrossingsMax.setDisable(disable);
|
|
|
|
|
freqZeroMin.setDisable(disable);
|
|
|
|
|
freqZeroMax.setDisable(disable);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -1495,17 +1513,12 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private TextField[] ampRange = new TextField[2];
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The main holder
|
|
|
|
|
*/
|
|
|
|
|
private PamGridPane gridPane;
|
|
|
|
|
|
|
|
|
|
public AmplitudeBlock() {
|
|
|
|
|
super("Amplitude Range", true);
|
|
|
|
|
setDescription("Set a minimum and maximum click amplitude for this type");
|
|
|
|
|
|
|
|
|
|
gridPane= new PamGridPane();
|
|
|
|
|
PamGridPane gridPane= new PamGridPane();
|
|
|
|
|
gridPane.setHgap(5);
|
|
|
|
|
gridPane.setVgap(5);
|
|
|
|
|
|
|
|
|
@ -1559,16 +1572,13 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void disbleControls(boolean disable) {
|
|
|
|
|
gridPane.setDisable(disable);
|
|
|
|
|
|
|
|
|
|
// for (int i = 0; i < 2; i++) {
|
|
|
|
|
// ampRange[i].setDisable(!getEnableBox());
|
|
|
|
|
// }
|
|
|
|
|
for (int i = 0; i < 2; i++) {
|
|
|
|
|
ampRange[i].setDisable(!getEnableBox());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* Parameters for testing bearing values.
|
|
|
|
@ -1581,12 +1591,18 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
/**
|
|
|
|
|
* The minimum correlation value.
|
|
|
|
|
*/
|
|
|
|
|
private Spinner<Double> minBearing;
|
|
|
|
|
private JTextField minBearing;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The maximum bearing field
|
|
|
|
|
*/
|
|
|
|
|
private Spinner<Double> maxBearing;
|
|
|
|
|
private JTextField maxBearing;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The enable bearings check box.
|
|
|
|
|
*/
|
|
|
|
|
private JCheckBox enableBearings;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* True if using multi-channel data
|
|
|
|
|
*/
|
|
|
|
@ -1595,47 +1611,43 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
/**
|
|
|
|
|
* Combo box to select whetrher bearings should be kept or excluded within limits.
|
|
|
|
|
*/
|
|
|
|
|
private ComboBox<String> bearingsExcludeBox;
|
|
|
|
|
|
|
|
|
|
private PamHBox bearingHolder;
|
|
|
|
|
private JComboBox<String> bearingsExcludeBox;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BearingBlock() {
|
|
|
|
|
super("Bearings", true);
|
|
|
|
|
super("Bearings", false);
|
|
|
|
|
|
|
|
|
|
JPanel p = new JPanel();
|
|
|
|
|
|
|
|
|
|
minBearing = new PamSpinner<Double>(-180, 180, 0, 1);
|
|
|
|
|
minBearing.getStyleClass().add(Spinner.STYLE_CLASS_SPLIT_ARROWS_HORIZONTAL);
|
|
|
|
|
minBearing.setMaxWidth(110);
|
|
|
|
|
minBearing.setEditable(true);
|
|
|
|
|
maxBearing = new PamSpinner<Double>(-180, 180, 0, 1);
|
|
|
|
|
maxBearing.getStyleClass().add(Spinner.STYLE_CLASS_SPLIT_ARROWS_HORIZONTAL);
|
|
|
|
|
maxBearing.setMaxWidth(110);
|
|
|
|
|
maxBearing.setEditable(true);
|
|
|
|
|
|
|
|
|
|
bearingsExcludeBox = new ComboBox<String>();
|
|
|
|
|
bearingsExcludeBox.getItems().add("Include only");
|
|
|
|
|
bearingsExcludeBox.getItems().add("Exclude");
|
|
|
|
|
minBearing = new JTextField(5);
|
|
|
|
|
maxBearing = new JTextField(5);
|
|
|
|
|
|
|
|
|
|
bearingHolder = new PamHBox();
|
|
|
|
|
bearingHolder.setSpacing(5);
|
|
|
|
|
bearingHolder.setAlignment(Pos.CENTER_LEFT);
|
|
|
|
|
bearingsExcludeBox = new JComboBox<String>();
|
|
|
|
|
bearingsExcludeBox.addItem("Include only");
|
|
|
|
|
bearingsExcludeBox.addItem("Exclude");
|
|
|
|
|
|
|
|
|
|
p.setLayout(new GridBagLayout());
|
|
|
|
|
GridBagConstraints c = new PamGridBagContraints();
|
|
|
|
|
|
|
|
|
|
bearingHolder.getChildren().add(bearingsExcludeBox);
|
|
|
|
|
bearingHolder.getChildren().add(new Label("bearings between "));
|
|
|
|
|
c.gridx += c.gridwidth;
|
|
|
|
|
bearingHolder.getChildren().add(minBearing);
|
|
|
|
|
bearingHolder.getChildren().add(new Label("\u00B0 and "));
|
|
|
|
|
bearingHolder.getChildren().add(maxBearing);
|
|
|
|
|
bearingHolder.getChildren().add(new Label("\u00B0"));
|
|
|
|
|
|
|
|
|
|
// c.gridx = 0;
|
|
|
|
|
// addComponent(p, enableBearings, c);
|
|
|
|
|
// c.gridx += c.gridwidth;
|
|
|
|
|
// addComponent(p, bearingsExcludeBox, c);
|
|
|
|
|
// c.gridx += c.gridwidth;
|
|
|
|
|
// addComponent(p, new JLabel("bearings between ", JLabel.RIGHT), c);
|
|
|
|
|
// c.gridx += c.gridwidth;
|
|
|
|
|
// addComponent(p, minBearing, c);
|
|
|
|
|
// c.gridx += c.gridwidth;
|
|
|
|
|
// addComponent(p, new JLabel(" and ", JLabel.RIGHT), c);
|
|
|
|
|
// c.gridx += c.gridwidth;
|
|
|
|
|
// addComponent(p, maxBearing, c);
|
|
|
|
|
// c.gridx += c.gridwidth;
|
|
|
|
|
// addComponent(p, new JLabel("(\u00B0)", JLabel.LEFT), c);
|
|
|
|
|
//
|
|
|
|
|
// add(BorderLayout.WEST, p);
|
|
|
|
|
|
|
|
|
|
this.multiChan = checkMultiChan();
|
|
|
|
|
|
|
|
|
|
this.getHolderPane().setCenter(bearingHolder);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1643,13 +1655,13 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
protected void setParams() {
|
|
|
|
|
sweepClassifierSet.checkBearingAllocation();
|
|
|
|
|
// setEnableBox(sweepClassifierSet.enableZeroCrossings);
|
|
|
|
|
//enableBearings.setSelected(sweepClassifierSet.enableBearingLims);
|
|
|
|
|
enableBearings.setSelected(sweepClassifierSet.enableBearingLims);
|
|
|
|
|
|
|
|
|
|
if (sweepClassifierSet.excludeBearingLims) bearingsExcludeBox.getSelectionModel().select(1);
|
|
|
|
|
else bearingsExcludeBox.getSelectionModel().select(0);
|
|
|
|
|
if (sweepClassifierSet.excludeBearingLims) bearingsExcludeBox.setSelectedIndex(1);
|
|
|
|
|
else bearingsExcludeBox.setSelectedIndex(0);
|
|
|
|
|
|
|
|
|
|
this.minBearing.getValueFactory().setValue(Math.toDegrees(sweepClassifierSet.bearingLims[0]));
|
|
|
|
|
this.maxBearing.getValueFactory().setValue(Math.toDegrees(sweepClassifierSet.bearingLims[1]));
|
|
|
|
|
this.minBearing.setText(String.format("%3.1f", Math.toDegrees(sweepClassifierSet.bearingLims[0])));
|
|
|
|
|
this.maxBearing.setText(String.format("%3.1f", Math.toDegrees(sweepClassifierSet.bearingLims[1])));
|
|
|
|
|
|
|
|
|
|
this.multiChan = checkMultiChan();
|
|
|
|
|
}
|
|
|
|
@ -1657,31 +1669,46 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected boolean getParams() {
|
|
|
|
|
if (enableBearings.isSelected()) {
|
|
|
|
|
|
|
|
|
|
sweepClassifierSet.excludeBearingLims = bearingsExcludeBox.getSelectionModel().getSelectedIndex()==1 ? true : false;
|
|
|
|
|
sweepClassifierSet.enableBearingLims = enableBearings.isSelected();
|
|
|
|
|
sweepClassifierSet.excludeBearingLims = bearingsExcludeBox.getSelectedIndex()==1 ? true : false;
|
|
|
|
|
|
|
|
|
|
sweepClassifierSet.bearingLims[0] = Math.toRadians(minBearing.getValue());
|
|
|
|
|
|
|
|
|
|
sweepClassifierSet.bearingLims[1] = Math.toRadians(maxBearing.getValue());
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
sweepClassifierSet.bearingLims[0] = Math.toRadians(Double.valueOf(minBearing.getText()));
|
|
|
|
|
}
|
|
|
|
|
catch (NumberFormatException e) {
|
|
|
|
|
return showWarning("Invalid minimum correlation value");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
sweepClassifierSet.bearingLims[1] = Math.toRadians(Double.valueOf(maxBearing.getText()));
|
|
|
|
|
}
|
|
|
|
|
catch (NumberFormatException e) {
|
|
|
|
|
return showWarning("Invalid maximum bearing limits value");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void enableControls() {
|
|
|
|
|
checkMultiChan();
|
|
|
|
|
|
|
|
|
|
enableBearings.setEnabled(multiChan);
|
|
|
|
|
bearingsExcludeBox.setEnabled(multiChan);
|
|
|
|
|
minBearing.setEnabled(multiChan);
|
|
|
|
|
maxBearing.setEnabled(multiChan);
|
|
|
|
|
|
|
|
|
|
if (!multiChan) return;
|
|
|
|
|
|
|
|
|
|
bearingsExcludeBox.setEnabled(enableBearings.isSelected());
|
|
|
|
|
minBearing.setEnabled(enableBearings.isSelected());
|
|
|
|
|
maxBearing.setEnabled(enableBearings.isSelected());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void disbleControls(boolean disable) {
|
|
|
|
|
checkMultiChan();
|
|
|
|
|
|
|
|
|
|
bearingHolder.setDisable(!multiChan);
|
|
|
|
|
// bearingsExcludeBox.setDisable(!multiChan);
|
|
|
|
|
// minBearing.setDisable(!multiChan);
|
|
|
|
|
// maxBearing.setDisable(!multiChan);
|
|
|
|
|
if (!multiChan) return;
|
|
|
|
|
bearingHolder.setDisable(disable);
|
|
|
|
|
|
|
|
|
|
// bearingsExcludeBox.setDisable(disable);
|
|
|
|
|
// minBearing.setDisable(disable);
|
|
|
|
|
// maxBearing.setDisable(disable);
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1694,22 +1721,22 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
private boolean checkMultiChan() {
|
|
|
|
|
boolean multiChan = false;
|
|
|
|
|
//do we have multi-channel clicks?
|
|
|
|
|
if (this.sweepClassifier.getClickDetector().getClickControl()!=null) {
|
|
|
|
|
int[] chanGroups = getClickControl().getClickParameters().getGroupedSourceParameters().getChannelGroups();
|
|
|
|
|
multiChan = false;
|
|
|
|
|
|
|
|
|
|
if (chanGroups==null) return multiChan;
|
|
|
|
|
|
|
|
|
|
for (int i=0; i<chanGroups.length; i++) {
|
|
|
|
|
int chans = getClickControl().getClickParameters().getGroupedSourceParameters().getGroupChannels(i);
|
|
|
|
|
// Debug.out.println("Check multi-channel: " + chanGroups[i] + " num: " + PamUtils.getNumChannels(chans));
|
|
|
|
|
if (PamUtils.getNumChannels(chans)>1) {
|
|
|
|
|
multiChan = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else multiChan = true;
|
|
|
|
|
// if (clickControl!=null) {
|
|
|
|
|
// int[] chanGroups = clickControl.getClickParameters().getGroupedSourceParameters().getChannelGroups();
|
|
|
|
|
// multiChan = false;
|
|
|
|
|
//
|
|
|
|
|
// if (chanGroups==null) return multiChan;
|
|
|
|
|
//
|
|
|
|
|
// for (int i=0; i<chanGroups.length; i++) {
|
|
|
|
|
// int chans = clickControl.getClickParameters().getGroupedSourceParameters().getGroupChannels(i);
|
|
|
|
|
//// Debug.out.println("Check multi-channel: " + chanGroups[i] + " num: " + PamUtils.getNumChannels(chans));
|
|
|
|
|
// if (PamUtils.getNumChannels(chans)>1) {
|
|
|
|
|
// multiChan = true;
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// else multiChan = true;
|
|
|
|
|
// Debug.out.println("Check multi-channel: " + multiChan);
|
|
|
|
|
|
|
|
|
|
return multiChan;
|
|
|
|
@ -1835,12 +1862,6 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Show a warning.
|
|
|
|
|
* @param string - the
|
|
|
|
|
* @param string2
|
|
|
|
|
* @return false usually
|
|
|
|
|
*/
|
|
|
|
|
private boolean showWarning(String string, String string2) {
|
|
|
|
|
//PamController.getInstance();
|
|
|
|
|
PamDialogFX.showWarning(null, string, string2);
|
|
|
|
|