Updates to CPOD module

Display imporevements
This commit is contained in:
Jamie Mac 2024-02-14 06:24:29 +00:00
parent 0f220102c8
commit 66fb82743b
10 changed files with 159 additions and 29 deletions

View File

@ -6,7 +6,7 @@
<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-17">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>

View File

@ -1,6 +1,6 @@
eclipse.preferences.version=1
encoding//src/rawDeepLearningClassifer/segmenter/SegmenterProcess.java=UTF-8
encoding//src/test=ISO-8859-1
encoding//src/test/resources=ISO-8859-1
encoding/<project>=ISO-8859-1
encoding/src=ISO-8859-1
encoding//src/test=UTF-8
encoding//src/test/resources=UTF-8
encoding/<project>=UTF-8
encoding/src=UTF-8

View File

@ -1,9 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.codegen.targetPlatform=21
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.compliance=21
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@ -13,4 +13,4 @@ org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
org.eclipse.jdt.core.compiler.source=21

View File

@ -1,17 +1,11 @@
package clickDetector.tdPlots;
import java.awt.Color;
import PamView.GeneralProjector;
import PamView.PamColors;
import PamView.symbol.StandardSymbolChooser;
import PamView.symbol.StandardSymbolManager;
import PamView.symbol.StandardSymbolOptions;
import PamView.symbol.SymbolData;
import PamguardMVC.PamDataBlock;
import PamguardMVC.PamDataUnit;
import clickDetector.ClickTrainDetection;
import clickDetector.offlineFuncs.OfflineEventDataUnit;
public class ClickEventSymbolChooser extends StandardSymbolChooser {

View File

@ -1,12 +1,6 @@
package clickDetector.tdPlots;
import PamView.GeneralProjector;
import PamView.symbol.StandardSymbolChooser;
import PamView.symbol.StandardSymbolManager;
import PamView.symbol.SymbolData;
import PamView.symbol.modifier.SuperDetSymbolModifier;
import PamguardMVC.PamDataBlock;
import PamguardMVC.superdet.SuperDetDataBlock;
import PamguardMVC.superdet.swing.SuperDetectionSymbolManager;
import clickDetector.offlineFuncs.OfflineEventDataBlock;

View File

@ -17,7 +17,6 @@ import PamController.SettingsPane;
import PamView.PamDetectionOverlayGraphics;
import PamView.PamSymbol;
import PamView.WrapperControlledGUISwing;
import clickTrainDetector.logging.ClickTrainDetSubLogging;
import cpod.dataPlotFX.CPODDPlotProvider;
import cpod.dataPlotFX.CPODPlotProviderFX;
import cpod.fx.CPODGUIFX;
@ -111,6 +110,8 @@ public class CPODControl2 extends PamControlledUnit implements PamSettings {
//must set overlay draw so that hover text can be extracted from general projector and thus plotted on TDGraphFX . This is a HACK and should be sorted.
cp1DataBlock.setOverlayDraw(new PamDetectionOverlayGraphics(cp1DataBlock, new PamSymbol()));
// // add the CP3 data block
// cpodProcess.addOutputDataBlock(cp3DataBlock = new CPODClickDataBlock("CP3 Data",
// cpodProcess, CPODMap.FILE_CP3));
@ -125,6 +126,9 @@ public class CPODControl2 extends PamControlledUnit implements PamSettings {
clickTrainDataBlock= new CPODClickTrainDataBlock(this, cpodProcess, "CPOD Click Trains", 0);
clickTrainDataBlock.SetLogging(clickTrainDetLogging = new CPODClickTrainLogging(this, clickTrainDataBlock));
clickTrainDetLogging.setSubLogging(new CPODSubDetLogging(clickTrainDetLogging, clickTrainDataBlock));
//create symbols for clicks trains
clickTrainDataBlock.setPamSymbolManager(new CPODTrainSymbolManager(clickTrainDataBlock));
//makes sure the click trains are loaded
int maxndays = 5; //maximum days to load.
AbstractScrollManager.getScrollManager().addToSpecialDatablock(clickTrainDataBlock, maxndays*24*60*60*1000L , maxndays*24*60*60*1000L);

View File

@ -537,17 +537,12 @@ public class CPODImporter {
int count =0;
for (Integer key: cpodClickTrains.keySet()) {
if (count%100 ==0) {
if (count%100 == 0) {
this.updateMessage(("Add click train data to datablock: " + count + " of " + cpodClickTrains.keySet().size()));
this.updateProgress(count, cpodClickTrains.keySet().size());
// System.out.println("Add click train data to datablock: " + count + " " + cpodClickTrains.keySet().size());
}
if (count ==3000) {
//temp
break;
}
clickTrainDataBlock.addPamData(cpodClickTrains.get(key));
count++;

View File

@ -50,6 +50,9 @@ public class CPODSymbolManager extends StandardSymbolManager {
//add the peak frequency modifier that allows clicks to be coloured by peak frequency.
psc.addSymbolModifier(new PeakFreqModifier(psc));
//add the peak frequency modifier that allows clicks to be coloured by peak frequency.
psc.addSymbolModifier(new CPODClickTrainModifier(psc));
// we can also add some default behaviour here to match the old behaviour
// these will get overridden once user options are set, but it's good to give defaults.
// SymbolModifier eventMod = psc.hasSymbolModifier(SuperDetSymbolModifier.class);

View File

@ -0,0 +1,16 @@
package cpod;
import PamView.symbol.SymbolData;
import PamguardMVC.superdet.swing.SuperDetectionSymbolManager;
public class CPODTrainSymbolManager extends SuperDetectionSymbolManager {
public CPODTrainSymbolManager(CPODClickTrainDataBlock pamDataBlock) {
super(pamDataBlock, new SymbolData());
super.setSpecialColourName("Event Colour");
}
}

View File

@ -1,11 +1,42 @@
package decimator.layoutFX;
import java.awt.BorderLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import javax.swing.AbstractButton;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;
import javax.swing.border.TitledBorder;
import PamController.PamController;
import PamController.SettingsPane;
import PamDetection.RawDataUnit;
import PamView.dialog.PamGridBagContraints;
import PamView.dialog.SourcePanel;
import PamView.panel.PamAlignmentPanel;
import PamguardMVC.PamDataBlock;
import dataMap.filemaps.OfflineFileDialogPanel;
import decimator.DecimatorControl;
import decimator.DecimatorParams;
import decimator.DecimatorParamsDialog.DefaultFilterButton;
import decimator.DecimatorParamsDialog.FilterButton;
import decimator.DecimatorParamsDialog.SPMonitor;
import decimator.DecimatorParamsDialog.SPSelection;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.Pane;
import pamViewFX.fxNodes.PamBorderPane;
import pamViewFX.fxNodes.PamButton;
import pamViewFX.fxNodes.PamGridPane;
import pamViewFX.fxNodes.PamVBox;
import pamViewFX.fxNodes.utilityPanes.SourcePaneFX;
/**
*
@ -17,14 +48,99 @@ public class DecimatorSettingsPane extends SettingsPane<DecimatorParams> {
private PamBorderPane mainPane;
private DecimatorControl decimatorControl;
private SourcePaneFX sourcePanel;
private Label sourceSampleRate;
private float inputSampleRate;
private TextField newSampleRate;
public DecimatorSettingsPane(DecimatorControl aquisitionControl) {
super(null);
mainPane= new PamBorderPane();
this.decimatorControl = aquisitionControl;
mainPane.setCenter(new Label("Hello Decimator Pane"));
}
private Pane createPane() {
PamVBox mainPanel = new PamVBox();
GridBagConstraints constraints = new PamGridBagContraints();
// insets = new Insets(2,2,2,2);
sourcePanel = new SourcePaneFX( RawDataUnit.class, true, true);
sourcePanel.addSelectionListener((obsval, oldVal, newVal)->{
newDataSource();
});
// sourcePanel.addSourcePanelMonitor(new SPMonitor());
mainPanel.getChildren().add(sourcePanel.getPane());
PamGridPane decimatorPanel = new PamGridPane();
Label label = new Label("Decimator settings");
int gridx = 0;
int gridy = 0;
decimatorPanel.add(new Label("Source sample rate "), gridx, gridy);
gridx++;
decimatorPanel.add(sourceSampleRate = new Label(" - Hz"), gridx, gridy);
gridx = 0;
gridy ++;
decimatorPanel.add(new JLabel("Output sample rate "), gridx, gridy);
gridx ++;
decimatorPanel.add(newSampleRate = new TextField(), gridx, gridy);
gridx ++;
decimatorPanel.add(new JLabel(" Hz"), gridx, gridy);
gridy ++;
gridx = 0;
gridwidth = 1;
decimatorPanel.add(filterButton = new PamButton("Filter settings"), gridx, gridy);
filterButton.addActionListener(new FilterButton());
gridx = 1;
gridwidth = 2;
addComponent(decimatorPanel, defaultFilterButton = new PamButton("Default Filter"), gridx, gridy);
defaultFilterButton.addActionListener(new DefaultFilterButton());
gridx = 0;
gridwidth = 3;
gridy++;
addComponent(decimatorPanel, filterInfo = new JLabel("Filter: "), gridx, gridy);
gridx = 0;
gridwidth = 1;
gridy++;
addComponent(decimatorPanel, new JLabel("Interpolation: ", JLabel.RIGHT), gridx, gridy);
gridx += gridwidth;
gridwidth = 2;
addComponent(decimatorPanel, interpolator = new JComboBox<String>(), gridx, gridy);
interpolator.addItem("None");
interpolator.addItem("Linear");
interpolator.addItem("Quadratic");
isViewer = PamController.getInstance().getRunMode() == PamController.RUN_PAMVIEW;
if (isViewer) {
JTabbedPane tabbedPane = new JTabbedPane();
offlineDAQDialogPanel = new OfflineFileDialogPanel(decimatorControl, this);
tabbedPane.add("Offline Files", offlineDAQDialogPanel.getComponent());
tabbedPane.add("Runtime Settings", mainPanel);
setDialogComponent(tabbedPane);
}
else {
setDialogComponent(mainPanel);
}
setHelpPoint("sound_processing.decimatorHelp.docs.decimator_decimator");
filterButton.setToolTipText("Manual adjustment of filter settings");
defaultFilterButton.setToolTipText("Set a default filter (6th order Butterworth low pass at Decimator Nyquist frequency)");
interpolator.setToolTipText("If Decimation / upsampling is not by an integer value, you should use interpolation to improve waveform reconstruction");
}
@Override
@ -55,5 +171,13 @@ public class DecimatorSettingsPane extends SettingsPane<DecimatorParams> {
// TODO Auto-generated method stub
}
private void newDataSource() {
PamDataBlock block = sourcePanel.getSource();
if (block != null) {
sourceSampleRate.setText(String.format("%.1f Hz",
inputSampleRate = block.getSampleRate()));
}
}
}