Updates to exporter and detection display in FX GUI

This commit is contained in:
Jamie Mac 2024-04-18 12:09:36 +01:00
parent ca2fef11e5
commit a1adff82cb
26 changed files with 442 additions and 161 deletions

View File

@ -6,7 +6,7 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk-21.0.2.13-hotspot"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/Amazon Coretto 21">
<attributes> <attributes>
<attribute name="module" value="true"/> <attribute name="module" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>

1
.gitignore vendored
View File

@ -106,3 +106,4 @@ settings.xml
.project .project
.classpath .classpath
.classpath .classpath
.classpath

View File

@ -1,6 +1,7 @@
package Acquisition.filedate; package Acquisition.filedate;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.GridBagConstraints; import java.awt.GridBagConstraints;
import java.awt.GridBagLayout; import java.awt.GridBagLayout;
@ -15,6 +16,9 @@ import javax.swing.JLabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JTextField; import javax.swing.JTextField;
import org.kordamp.ikonli.materialdesign2.MaterialDesignC;
import org.kordamp.ikonli.swing.FontIcon;
import PamUtils.PamCalendar; import PamUtils.PamCalendar;
import PamView.dialog.PamGridBagContraints; import PamView.dialog.PamGridBagContraints;
@ -35,7 +39,9 @@ public class FileDateDialogStrip {
private JButton settingsButton; private JButton settingsButton;
private ImageIcon settingsIcon = new ImageIcon(ClassLoader.getSystemResource("Resources/SettingsButtonSmall2.png")); // private ImageIcon settingsIcon = new ImageIcon(ClassLoader.getSystemResource("Resources/SettingsButtonSmall2.png"));
public static FontIcon settingsIcon = FontIcon.of(MaterialDesignC.COG, 20, Color.DARK_GRAY);
private Window parent; private Window parent;

View File

@ -1,6 +1,7 @@
package Map; package Map;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Frame; import java.awt.Frame;
import java.awt.GridBagConstraints; import java.awt.GridBagConstraints;
import java.awt.GridBagLayout; import java.awt.GridBagLayout;
@ -16,6 +17,9 @@ import javax.swing.JPanel;
import javax.swing.JTextField; import javax.swing.JTextField;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;
import org.kordamp.ikonli.materialdesign2.MaterialDesignC;
import org.kordamp.ikonli.swing.FontIcon;
import PamController.PamController; import PamController.PamController;
import PamView.dialog.PamDialog; import PamView.dialog.PamDialog;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
@ -85,7 +89,8 @@ public class MapDetectionsDialog extends PamDialog {
MapDetectionData md; MapDetectionData md;
ImageIcon settingsIcon = new ImageIcon(ClassLoader.getSystemResource("Resources/SettingsButtonSmall2.png")); // ImageIcon settingsIcon = new ImageIcon(ClassLoader.getSystemResource("Resources/SettingsButtonSmall2.png"));
FontIcon settingsIcon = FontIcon.of(MaterialDesignC.COG, 20, Color.DARK_GRAY);
for (int i = 0; i < n; i++) { for (int i = 0; i < n; i++) {
md = mapDetectionsParameters.mapDetectionDatas.get(i); md = mapDetectionsParameters.mapDetectionDatas.get(i);

View File

@ -1,8 +1,13 @@
package PamView.component; package PamView.component;
import java.awt.Color;
import javax.swing.ImageIcon; import javax.swing.ImageIcon;
import javax.swing.JButton; import javax.swing.JButton;
import org.kordamp.ikonli.materialdesign2.MaterialDesignC;
import org.kordamp.ikonli.swing.FontIcon;
public class PamSettingsIconButton extends JButton { public class PamSettingsIconButton extends JButton {
/** /**
@ -10,8 +15,9 @@ public class PamSettingsIconButton extends JButton {
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static final ImageIcon settingsIcon = new ImageIcon(ClassLoader.getSystemResource("Resources/SettingsButtonSmall2.png")); // private static final ImageIcon settingsIcon = new ImageIcon(ClassLoader.getSystemResource("Resources/SettingsButtonSmall2.png"));
private static final FontIcon settingsIcon = FontIcon.of(MaterialDesignC.COG, 20, Color.DARK_GRAY);
/** /**
* Create a simple square button using the given icon. * Create a simple square button using the given icon.
*/ */

View File

@ -1,9 +1,15 @@
package PamView.dialog; package PamView.dialog;
import java.awt.Color;
import javax.swing.Action; import javax.swing.Action;
import javax.swing.Icon;
import javax.swing.ImageIcon; import javax.swing.ImageIcon;
import javax.swing.JButton; import javax.swing.JButton;
import org.kordamp.ikonli.materialdesign2.MaterialDesignC;
import org.kordamp.ikonli.swing.FontIcon;
/** /**
* Standard settings button with the little cogwheel for use throughout Swing components. * Standard settings button with the little cogwheel for use throughout Swing components.
* @author dg50 * @author dg50
@ -20,8 +26,9 @@ public class SettingsButton extends JButton {
super(makeIcon()); super(makeIcon());
} }
private static ImageIcon makeIcon() { private static Icon makeIcon() {
return new ImageIcon(ClassLoader.getSystemResource("Resources/SettingsButtonSmall2.png")); return FontIcon.of(MaterialDesignC.COG, 20, Color.DARK_GRAY);
// return new ImageIcon(ClassLoader.getSystemResource("Resources/SettingsButtonSmall2.png"));
} }
/** /**

View File

@ -104,7 +104,7 @@ public class DetectionDisplayControl2 extends UserDisplayControlFX {
*/ */
public boolean newDataBlockAdded(PamDataBlock pamDataBlock){ public boolean newDataBlockAdded(PamDataBlock pamDataBlock){
System.out.println("NEW DATA BLOCK DETECTION DISPLAY: " + pamDataBlock); //System.out.println("NEW DATA BLOCK DETECTION DISPLAY: " + pamDataBlock);
//if null then no parent- simply set the DDataInfo to null; //if null then no parent- simply set the DDataInfo to null;
if (pamDataBlock==null) { if (pamDataBlock==null) {
@ -127,6 +127,8 @@ public class DetectionDisplayControl2 extends UserDisplayControlFX {
//set the paramters. //set the paramters.
displays=new ArrayList<UserDisplayNodeFX>(); displays=new ArrayList<UserDisplayNodeFX>();
displays.add(detectionDisplay); displays.add(detectionDisplay);
//TODO
// detectionDisplay.setEnableScrollBar(false); //make this an option
} }
return displays; return displays;
} }
@ -148,7 +150,7 @@ public class DetectionDisplayControl2 extends UserDisplayControlFX {
@Override @Override
public void addData(PamObservable o, PamDataUnit arg) { public void addData(PamObservable o, PamDataUnit arg) {
System.out.println("DetectionDisplay: INCOMING data unit: "+ arg); //System.out.println("DetectionDisplay: INCOMING data unit: "+ arg);
//send the data unit to the display. //send the data unit to the display.
detectionDisplay.setDataUnit(arg); detectionDisplay.setDataUnit(arg);
} }

View File

@ -4,7 +4,6 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import PamController.PamSettingManager;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
import PamguardMVC.superdet.SuperDetection; import PamguardMVC.superdet.SuperDetection;
@ -24,7 +23,6 @@ import javafx.scene.control.TabPane;
import javafx.scene.control.TabPane.TabClosingPolicy; import javafx.scene.control.TabPane.TabClosingPolicy;
import javafx.scene.layout.BorderPane; import javafx.scene.layout.BorderPane;
import javafx.scene.layout.Pane; import javafx.scene.layout.Pane;
import javafx.scene.layout.Region;
import javafx.scene.layout.StackPane; import javafx.scene.layout.StackPane;
import pamViewFX.PamGuiManagerFX; import pamViewFX.PamGuiManagerFX;
import pamViewFX.fxGlyphs.PamGlyphDude; import pamViewFX.fxGlyphs.PamGlyphDude;
@ -33,19 +31,16 @@ import pamViewFX.fxNodes.PamButton;
import pamViewFX.fxNodes.PamHBox; import pamViewFX.fxNodes.PamHBox;
import pamViewFX.fxNodes.PamStackPane; import pamViewFX.fxNodes.PamStackPane;
import pamViewFX.fxNodes.hidingPane.HidingPane; import pamViewFX.fxNodes.hidingPane.HidingPane;
import pamViewFX.fxNodes.internalNode.PamInternalPane;
import pamViewFX.fxStyles.PamStylesManagerFX; import pamViewFX.fxStyles.PamStylesManagerFX;
import userDisplayFX.UserDisplayNodeFX;
import userDisplayFX.UserDisplayNodeParams;
/** /**
* *
* A display which shows a list of data units with arrows allowing the user to * A detection plot display with convenience functions to set any type of data unit.
* navigate through the different data units.
* *
* @author Jamie Macaulay * @author Jamie Macaulay
* *
*/ */
@SuppressWarnings("rawtypes")
public class DetectionGroupDisplay extends PamBorderPane { public class DetectionGroupDisplay extends PamBorderPane {
public static final int DISPLAY_COMPACT = 0; public static final int DISPLAY_COMPACT = 0;
@ -368,14 +363,15 @@ public class DetectionGroupDisplay extends PamBorderPane {
* Sets the current in the display. * Sets the current in the display.
* @param pamDataUnit - the current data unit to set. * @param pamDataUnit - the current data unit to set.
* @param detectionDisplay- the detection display plot to set the data unit for. * @param detectionDisplay- the detection display plot to set the data unit for.
* @return true of a new data info has been added - usually means a different type of detection to display compared to the last detection.
*/ */
public void setDataUnit(PamDataUnit<?, ?> dataUnit){ public boolean setDataUnit(PamDataUnit<?, ?> dataUnit){
detectionDisplay.clearPane(); detectionDisplay.clearPane();
if (dataUnit==null) { if (dataUnit==null) {
detectionDisplay.removeDataInfo(); detectionDisplay.removeDataInfo();
return; return true;
} }
// TDDataInfoFX dataInfo = this.tdGraphFX.findDataInfo(dataUnit); // TDDataInfoFX dataInfo = this.tdGraphFX.findDataInfo(dataUnit);
@ -407,7 +403,7 @@ public class DetectionGroupDisplay extends PamBorderPane {
dDataInfoHashMap.put(dataUnit.getParentDataBlock(), dDataInfo); dDataInfoHashMap.put(dataUnit.getParentDataBlock(), dDataInfo);
} }
if (dDataInfo==null) return; if (dDataInfo==null) return true;
//only change the dDataInfo if it's different,. //only change the dDataInfo if it's different,.
boolean newDataInfo = false; boolean newDataInfo = false;
@ -435,6 +431,25 @@ public class DetectionGroupDisplay extends PamBorderPane {
// clearSingleType(); // clearSingleType();
//TODO....highlight data unit. //TODO....highlight data unit.
return newDataInfo;
}
/**
* Attempts to set the detectionPlot
* @param plotName
* @return
*/
public boolean setDetectionPlot(String plotName) {
//set the current detection plot based in the name
boolean setOk = currentDataInfo.setCurrentDetectionPlot(plotName);
//update the detection settings pane so it shows the correct plot names etc.
detectionDisplay.getDataTypePane().notifyDataChange();
return setOk;
} }
@ -445,7 +460,7 @@ public class DetectionGroupDisplay extends PamBorderPane {
*/ */
public void triggerListeners(PamDataUnit oldDataUnit, PamDataUnit newDataUnit) { public void triggerListeners(PamDataUnit oldDataUnit, PamDataUnit newDataUnit) {
for (GroupDisplayListener aListener : displayListeners) { for (GroupDisplayListener aListener : displayListeners) {
aListener.newDataUnitSlected(oldDataUnit, newDataUnit); aListener.newDataUnitSelected(oldDataUnit, newDataUnit);
} }
} }
@ -497,6 +512,14 @@ public class DetectionGroupDisplay extends PamBorderPane {
return detectionGroup.get(currentUnitIndex); return detectionGroup.get(currentUnitIndex);
} }
/**
* Show the scroll bar which allows the user to chnage time limits.
* @param enableScrollBarPane - true to enable the time scroll bar.
*/
public void setEnableScrollBar(boolean enableScrollBarPane) {
this.detectionDisplay.setEnableScrollBar(enableScrollBarPane);
}

View File

@ -7,6 +7,7 @@ import PamController.PamController;
import PamController.PamSettingManager; import PamController.PamSettingManager;
import PamController.PamSettings; import PamController.PamSettings;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
import PamguardMVC.PamDataUnit;
import javafx.geometry.Side; import javafx.geometry.Side;
import javafx.scene.layout.Region; import javafx.scene.layout.Region;
import pamViewFX.fxNodes.internalNode.PamInternalPane; import pamViewFX.fxNodes.internalNode.PamInternalPane;
@ -29,7 +30,9 @@ public class DetectionGroupDisplayFX extends DetectionGroupDisplay implements U
*/ */
private PamInternalPane internalFrame; private PamInternalPane internalFrame;
private DetectionDisplayControl2 displayControl; private DetectionDisplayControl2 displayControl;
private PamDataUnit<?, ?> currentDetection;
public DetectionGroupDisplayFX(DetectionDisplayControl2 displayControl){ public DetectionGroupDisplayFX(DetectionDisplayControl2 displayControl){
super(DetectionGroupDisplay.DISPLAY_COMPACT); super(DetectionGroupDisplay.DISPLAY_COMPACT);
@ -152,9 +155,9 @@ public class DetectionGroupDisplayFX extends DetectionGroupDisplay implements U
prepareDisplayParams(); prepareDisplayParams();
detectionPlotParams = getDisplayParams(); detectionPlotParams = getDisplayParams();
System.out.println("SAVE DETECTION DISPLAY DATA SOURCE: " + detectionPlotParams.dataSource); // System.out.println("SAVE DETECTION DISPLAY DATA SOURCE: " + detectionPlotParams.dataSource);
System.out.println("SAVE DETECTION DISPLAY TAB NAME: " + detectionPlotParams.tabName); // System.out.println("SAVE DETECTION DISPLAY TAB NAME: " + detectionPlotParams.tabName);
return detectionPlotParams; return detectionPlotParams;
} }
@ -182,9 +185,8 @@ public class DetectionGroupDisplayFX extends DetectionGroupDisplay implements U
return false; return false;
} }
System.out.println("LOAD DETECTION DISPLAY DATA SOURCE: " + settings.dataSource); // System.out.println("LOAD DETECTION DISPLAY DATA SOURCE: " + settings.dataSource);
System.out.println("LOAD DETECTION DISPLAY DATA SOURCE: " + settings.tabName); // System.out.println("LOAD DETECTION DISPLAY DATA SOURCE: " + settings.tabName);
this.detectionPlotParams = settings.clone(); this.detectionPlotParams = settings.clone();
return true; return true;
@ -204,5 +206,37 @@ public class DetectionGroupDisplayFX extends DetectionGroupDisplay implements U
public UserDisplayControlFX getUserDisplayControl() { public UserDisplayControlFX getUserDisplayControl() {
return displayControl; return displayControl;
} }
@Override
public boolean setDataUnit(PamDataUnit<?, ?> dataUnit){
/**
* The extra stuff here is to make sure that the plot types for a specific detectin are saved. So for example
* if viewing click spectrum then the spectrum plot is selected whenever 1) PAMGuard is opned again or 2) switching from
* one type of detection ot another e.g. whistle to click, then the click does nto revert to shwoing a waveform instead
* of spectrum.
*/
if (currentDetection!=null) {
//save the current selected detection plot for the particular type of data unit.
String detectionPlotName = this.getDetectionDisplay().getCurrentDataInfo().getCurrentDetectionPlot().getName();
// System.out.println("SET CURRENT DETECTION PLOT TO USE IS: " + detectionPlotName);
detectionPlotParams.dataAxisMap.put(currentDetection.getParentDataBlock().getLongDataName(), detectionPlotName);
}
this.currentDetection = dataUnit;
//setup the new data unit
boolean newDataInfo = super.setDataUnit(dataUnit);
if (newDataInfo && dataUnit!=null) {
//if there's a new data info we may want to set the detection back to it's most recent selection
String detectionPlotName = detectionPlotParams.dataAxisMap.get(dataUnit.getParentDataBlock().getLongDataName());
// System.out.println("THE CURRENT DETECTION PLOT TO USE IS: " + detectionPlotName);
setDetectionPlot(detectionPlotName);
}
return newDataInfo;
}
} }

View File

@ -1,5 +1,7 @@
package detectionPlotFX; package detectionPlotFX;
import java.util.HashMap;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType; import PamModel.parametermanager.PamParameterSet.ParameterSetType;
@ -13,17 +15,25 @@ import userDisplayFX.UserDisplayNodeParams;
* *
*/ */
public class DetectionPlotParams extends UserDisplayNodeParams implements Cloneable, ManagedParameters { public class DetectionPlotParams extends UserDisplayNodeParams implements Cloneable, ManagedParameters {
/**
*
*/
static final long serialVersionUID = 2L;
/** /**
* The data source for the detection plot. * The data source for the detection plot.
*/ */
public String dataSource = null; public String dataSource = null;
/** /**
* * Saves which data axis is used for which data block. The key is the data block long name and the
* result is the name of the plot e.g. waveform. In this way users can set how they want the data plots to display
* different types of data units and the dispay types are saved on PAMGuard opne and close.
*/ */
static final long serialVersionUID = 1L; public HashMap<String , String > dataAxisMap = new HashMap<String , String >();
/* (non-Javadoc) /* (non-Javadoc)

View File

@ -16,5 +16,5 @@ public interface GroupDisplayListener {
* @param oldDataUnit - the old data unit. * @param oldDataUnit - the old data unit.
* @param newDataUnit - the new selected data unit. * @param newDataUnit - the new selected data unit.
*/ */
public void newDataUnitSlected(PamDataUnit oldDataUnit, PamDataUnit newDataUnit); public void newDataUnitSelected(PamDataUnit oldDataUnit, PamDataUnit newDataUnit);
} }

View File

@ -2,7 +2,6 @@ package detectionPlotFX.data;
import java.util.ArrayList; import java.util.ArrayList;
import PamController.PamController; import PamController.PamController;
import PamDetection.PamDetection;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
import detectionPlotFX.DDScaleInfo; import detectionPlotFX.DDScaleInfo;
@ -12,7 +11,6 @@ import detectionPlotFX.projector.DetectionPlotProjector;
import javafx.scene.canvas.GraphicsContext; import javafx.scene.canvas.GraphicsContext;
import javafx.scene.shape.Rectangle; import javafx.scene.shape.Rectangle;
import pamViewFX.fxNodes.PamBorderPane; import pamViewFX.fxNodes.PamBorderPane;
import pamViewFX.fxNodes.pamAxis.PamAxisFX;
import pamViewFX.fxNodes.pamAxis.PamAxisPane2; import pamViewFX.fxNodes.pamAxis.PamAxisPane2;
/** /**
@ -23,23 +21,23 @@ import pamViewFX.fxNodes.pamAxis.PamAxisPane2;
* *
*/ */
public abstract class DDDataInfo<T extends PamDataUnit> { public abstract class DDDataInfo<T extends PamDataUnit> {
/** /**
* Reference to the detection display plot * Reference to the detection display plot
*/ */
private DetectionPlotDisplay dDPlot; private DetectionPlotDisplay dDPlot;
/** /**
* Pane whihc holds plot specifc settings. * Pane whihc holds plot specifc settings.
*/ */
private PamBorderPane settingsPane= new PamBorderPane(); private PamBorderPane settingsPane= new PamBorderPane();
/** /**
* The data block which the DDDataInfo is associated with * The data block which the DDDataInfo is associated with
*/ */
private PamDataBlock pamDataBlock; private PamDataBlock pamDataBlock;
/** /**
* The scale information. Holds the min and max values for the x and y axis. * The scale information. Holds the min and max values for the x and y axis.
*/ */
@ -49,12 +47,12 @@ public abstract class DDDataInfo<T extends PamDataUnit> {
* True if in viewer mode. * True if in viewer mode.
*/ */
private boolean isViewer=false; private boolean isViewer=false;
/** /**
* List of detection plots which can display the data unit. * List of detection plots which can display the data unit.
*/ */
private ArrayList<DetectionPlot> detectionPlots; private ArrayList<DetectionPlot> detectionPlots;
/* /*
* The index of the current detection plot * The index of the current detection plot
*/ */
@ -64,23 +62,23 @@ public abstract class DDDataInfo<T extends PamDataUnit> {
* The sample rate * The sample rate
*/ */
private float hardSampleRate=-1; private float hardSampleRate=-1;
// /**
// * Create the DDDataInfo // /**
// * @param dDDataProvider - the data provider // * Create the DDDataInfo
// * @param dDPlot - the detection plot // * @param dDDataProvider - the data provider
// * @param pamDataBlock - the parent datablock // * @param dDPlot - the detection plot
// */ // * @param pamDataBlock - the parent datablock
// public DDDataInfo(DetectionPlotDisplay dDPlot, PamDataBlock pamDataBlock) { // */
// super(); // public DDDataInfo(DetectionPlotDisplay dDPlot, PamDataBlock pamDataBlock) {
// this.dDPlot=dDPlot; // super();
// this.pamDataBlock = pamDataBlock; // this.dDPlot=dDPlot;
// this.isViewer = (PamController.getInstance().getRunMode() == PamController.RUN_PAMVIEW); // this.pamDataBlock = pamDataBlock;
// detectionPlots=new ArrayList<DetectionPlot>(); // this.isViewer = (PamController.getInstance().getRunMode() == PamController.RUN_PAMVIEW);
// } // detectionPlots=new ArrayList<DetectionPlot>();
// }
/** /**
* Create the DDDataInfo * Create the DDDataInfo
* @param dDDataProvider - the dataplot provider * @param dDDataProvider - the dataplot provider
@ -94,7 +92,7 @@ public abstract class DDDataInfo<T extends PamDataUnit> {
this.isViewer = (PamController.getInstance().getRunMode() == PamController.RUN_PAMVIEW); this.isViewer = (PamController.getInstance().getRunMode() == PamController.RUN_PAMVIEW);
detectionPlots=new ArrayList<DetectionPlot>(); detectionPlots=new ArrayList<DetectionPlot>();
} }
/** /**
* Create the DDdata info wothout reference to a provider * Create the DDdata info wothout reference to a provider
* @param dDPlot - - the data plot * @param dDPlot - - the data plot
@ -107,20 +105,20 @@ public abstract class DDDataInfo<T extends PamDataUnit> {
this.isViewer = (PamController.getInstance().getRunMode() == PamController.RUN_PAMVIEW); this.isViewer = (PamController.getInstance().getRunMode() == PamController.RUN_PAMVIEW);
detectionPlots=new ArrayList<DetectionPlot>(); detectionPlots=new ArrayList<DetectionPlot>();
} }
// /** // /**
// * Create the DDdata info wothout reference to a provider // * Create the DDdata info wothout reference to a provider
// * @param dDPlot - - the data plot // * @param dDPlot - - the data plot
// * @param pamDataBlock - the parent datablopck // * @param pamDataBlock - the parent datablopck
// */ // */
// public DDDataInfo(DetectionPlotDisplay dDPlot, float sR) { // public DDDataInfo(DetectionPlotDisplay dDPlot, float sR) {
// super(); // super();
// this.dDPlot=dDPlot; // this.dDPlot=dDPlot;
// this.hardSampleRate=sR; // this.hardSampleRate=sR;
// this.isViewer = (PamController.getInstance().getRunMode() == PamController.RUN_PAMVIEW); // this.isViewer = (PamController.getInstance().getRunMode() == PamController.RUN_PAMVIEW);
// detectionPlots=new ArrayList<DetectionPlot>(); // detectionPlots=new ArrayList<DetectionPlot>();
// } // }
/** /**
* Get the data block for this information * Get the data block for this information
* @return the datablock. This can be null. * @return the datablock. This can be null.
@ -128,8 +126,8 @@ public abstract class DDDataInfo<T extends PamDataUnit> {
public PamDataBlock getDataBlock() { public PamDataBlock getDataBlock() {
return pamDataBlock; return pamDataBlock;
} }
/** /**
* Get the sample rate. This is acquired form the datablock if one exists. Otherwise a hard * Get the sample rate. This is acquired form the datablock if one exists. Otherwise a hard
* wired sample rate is used. * wired sample rate is used.
@ -139,9 +137,9 @@ public abstract class DDDataInfo<T extends PamDataUnit> {
if (pamDataBlock!=null) return pamDataBlock.getSampleRate(); if (pamDataBlock!=null) return pamDataBlock.getSampleRate();
else return hardSampleRate; else return hardSampleRate;
} }
/** /**
* Set the sample rate. This is only used if the parent data block is null. * Set the sample rate. This is only used if the parent data block is null.
* @return the sample rate. * @return the sample rate.
@ -149,7 +147,7 @@ public abstract class DDDataInfo<T extends PamDataUnit> {
public void setHardSampleRate(float hardSampleRate) { public void setHardSampleRate(float hardSampleRate) {
this.hardSampleRate = hardSampleRate; this.hardSampleRate = hardSampleRate;
} }
/** /**
* Add a type of data unit to the list. * Add a type of data unit to the list.
* @param unitType String name of the data unit. * @param unitType String name of the data unit.
@ -157,7 +155,7 @@ public abstract class DDDataInfo<T extends PamDataUnit> {
public void addDetectionPlot(DetectionPlot<?> detectionPlot) { public void addDetectionPlot(DetectionPlot<?> detectionPlot) {
detectionPlots.add(detectionPlot); detectionPlots.add(detectionPlot);
} }
/** /**
* Get a detection plot * Get a detection plot
* @param the index of the detection plot to get. * @param the index of the detection plot to get.
@ -165,14 +163,14 @@ public abstract class DDDataInfo<T extends PamDataUnit> {
public DetectionPlot<?> getDetectionPlot(int i) { public DetectionPlot<?> getDetectionPlot(int i) {
return detectionPlots.get(i); return detectionPlots.get(i);
} }
/** /**
* The number of possible detection plots for the data unit. * The number of possible detection plots for the data unit.
*/ */
public int getDetectionPlotCount(){ public int getDetectionPlotCount(){
return detectionPlots.size(); return detectionPlots.size();
} }
/** /**
* Get the scale information. This holds the min and max values for the x and y axis along with other * Get the scale information. This holds the min and max values for the x and y axis along with other
* axis related parameters. * axis related parameters.
@ -188,42 +186,57 @@ public abstract class DDDataInfo<T extends PamDataUnit> {
public DetectionPlotDisplay getDetectionPlotDisplay() { public DetectionPlotDisplay getDetectionPlotDisplay() {
return dDPlot; return dDPlot;
} }
/* /*
* Sets the current detection plot to be shown. * Sets the current detection plot to be shown.
* @param index of the plot in the plot list. * @param index of the plot in the plot list.
*/ */
public void setCurrentDetectionPlot(int index) { public void setCurrentDetectionPlot(int index) {
this.currentDetectionPlotIndex=index; this.currentDetectionPlotIndex=index;
if (index>=0 && index<detectionPlots.size()){ if (index>=0 && index<detectionPlots.size()){
detectionPlots.get(index).setupPlot(); detectionPlots.get(index).setupPlot();
if (detectionPlots.get(index).getSettingsPane()!=null){ if (detectionPlots.get(index).getSettingsPane()!=null){
settingsPane.setCenter(detectionPlots.get(index).getSettingsPane()); settingsPane.setCenter(detectionPlots.get(index).getSettingsPane());
settingsPane.setMinHeight(detectionPlots.get(index).getSettingsPane().getMinHeight()); settingsPane.setMinHeight(detectionPlots.get(index).getSettingsPane().getMinHeight());
} }
else { else {
settingsPane.setCenter(null); settingsPane.setCenter(null);
} }
//need to force a layout //need to force a layout
for (PamAxisPane2 axis : dDPlot.getAllAxisPanes()){ for (PamAxisPane2 axis : dDPlot.getAllAxisPanes()){
axis.layout(); axis.layout();
} }
dDPlot.layout(); dDPlot.layout();
} }
else settingsPane.setCenter(null); else settingsPane.setCenter(null);
} }
/** /**
* Set the current plot to be shown. * Set the current plot to be shown.
* @param plot the plot to show. * @param plot the plot to show.
*/ */
public void setCurrentDetectionPlot(DetectionPlot plot) { public void setCurrentDetectionPlot(DetectionPlot plot) {
int index=detectionPlots.indexOf(plot); int index=detectionPlots.indexOf(plot);
setCurrentDetectionPlot(index); setCurrentDetectionPlot(index);
}
/**
* Set the current plot to be shown based on the detections plot name
* @param the name of the plot to show
* @param true if the plot was set - otherwise false (i.e. if the name was wrong)
*/
public boolean setCurrentDetectionPlot(String plotName) {
for (int i=0; i<detectionPlots.size(); i++) {
if (detectionPlots.get(i).getName().equals(plotName)) {
setCurrentDetectionPlot(i);
return true;
}
}
return false;
} }
/** /**
@ -234,8 +247,8 @@ public abstract class DDDataInfo<T extends PamDataUnit> {
if (currentDetectionPlotIndex<0 || currentDetectionPlotIndex>=detectionPlots.size()) return null; if (currentDetectionPlotIndex<0 || currentDetectionPlotIndex>=detectionPlots.size()) return null;
return detectionPlots.get(currentDetectionPlotIndex); return detectionPlots.get(currentDetectionPlotIndex);
} }
/** /**
* Get the settings pane for this DDDataInfo. This holds plot specific settings. * Get the settings pane for this DDDataInfo. This holds plot specific settings.
* @return * @return
@ -243,7 +256,7 @@ public abstract class DDDataInfo<T extends PamDataUnit> {
public PamBorderPane getSettingsPane(){ public PamBorderPane getSettingsPane(){
return settingsPane; return settingsPane;
} }
/** /**
* Paint data into the graphics window. * Paint data into the graphics window.
@ -255,17 +268,17 @@ public abstract class DDDataInfo<T extends PamDataUnit> {
* @param a flag with extra information - e.g. if this is a scroll bar paint or not. * @param a flag with extra information - e.g. if this is a scroll bar paint or not.
*/ */
public void drawData(GraphicsContext g, Rectangle windowRect, DetectionPlotProjector projector, T pamDataUnit, int flag){ public void drawData(GraphicsContext g, Rectangle windowRect, DetectionPlotProjector projector, T pamDataUnit, int flag){
if (getCurrentDetectionPlot()==null) return; if (getCurrentDetectionPlot()==null) return;
g.clearRect(0, 0, windowRect.getWidth(), windowRect.getHeight()); g.clearRect(0, 0, windowRect.getWidth(), windowRect.getHeight());
getCurrentDetectionPlot().setupAxis((PamDataUnit) pamDataUnit, this.getHardSampleRate(), projector); getCurrentDetectionPlot().setupAxis((PamDataUnit) pamDataUnit, this.getHardSampleRate(), projector);
getCurrentDetectionPlot().paintPlot((PamDataUnit) pamDataUnit, g, windowRect, projector, flag); getCurrentDetectionPlot().paintPlot((PamDataUnit) pamDataUnit, g, windowRect, projector, flag);
} }
/** /**
* Paint data into the graphics window. * Paint data into the graphics window.
@ -276,8 +289,8 @@ public abstract class DDDataInfo<T extends PamDataUnit> {
* @param newDataUnit - the data unit to plot. * @param newDataUnit - the data unit to plot.
*/ */
public void drawData(GraphicsContext g, Rectangle windowRect, DetectionPlotProjector projector, T pamDataUnit){ public void drawData(GraphicsContext g, Rectangle windowRect, DetectionPlotProjector projector, T pamDataUnit){
drawData( g, windowRect, projector, pamDataUnit, DetectionPlot.STANDARD_DRAW); drawData( g, windowRect, projector, pamDataUnit, DetectionPlot.STANDARD_DRAW);
} }
@ -286,23 +299,23 @@ public abstract class DDDataInfo<T extends PamDataUnit> {
getCurrentDetectionPlot().setupAxis((PamDataUnit) pamDataUnit, this.getHardSampleRate(), projector); getCurrentDetectionPlot().setupAxis((PamDataUnit) pamDataUnit, this.getHardSampleRate(), projector);
} }
// /** // /**
// * Gets a value for a specific data unit which should be in the // * Gets a value for a specific data unit which should be in the
// * same units as the scale information. This will then be // * same units as the scale information. This will then be
// * converted into a plot position by the TDGraph. // * converted into a plot position by the TDGraph.
// * @param pamDataUnit // * @param pamDataUnit
// * @return data value or null if this data point should not be plotted. // * @return data value or null if this data point should not be plotted.
// */ // */
// abstract public Double[] getYValue(PamDataUnit pamDataUnit); // abstract public Double[] getYValue(PamDataUnit pamDataUnit);
// //
// /** // /**
// * Gets a value for a specific data unit which should be in the // * Gets a value for a specific data unit which should be in the
// * same units as the scale information. This will then be // * same units as the scale information. This will then be
// * converted into a plot position by the TDGraph. // * converted into a plot position by the TDGraph.
// * @param pamDataUnit // * @param pamDataUnit
// * @return data value or null if this data point should not be plotted. // * @return data value or null if this data point should not be plotted.
// */ // */
// abstract public Double[] getXValue(PamDataUnit pamDataUnit); // abstract public Double[] getXValue(PamDataUnit pamDataUnit);
} }

View File

@ -87,7 +87,6 @@ public class DDDataPane2 extends PamBorderPane {
dataPlots.getItems().add(ddDataInfo.getDetectionPlot(i).getName()); dataPlots.getItems().add(ddDataInfo.getDetectionPlot(i).getName());
if (ddDataInfo.getCurrentDetectionPlot()==ddDataInfo.getDetectionPlot(i)) { if (ddDataInfo.getCurrentDetectionPlot()==ddDataInfo.getDetectionPlot(i)) {
index=i; index=i;
} }

View File

@ -73,8 +73,7 @@ public class DetectionPlotDisplay extends PamBorderPane {
/** /**
* Pane which sits on the right hand side and * Pane which sits on the right hand side and
*/ */
private PamBorderPane settingsHolder; private PamBorderPane settingsHolder;
/** /**

View File

@ -57,7 +57,6 @@ public class ExportOptions implements PamSettings {
if (exportProcessDialog==null) { if (exportProcessDialog==null) {
exportProcessDialog= new ExportProcessDialog(exportManager); exportProcessDialog= new ExportProcessDialog(exportManager);
} }
this.exportProcessDialog.showOfflineDialog(parentFrame, this.storageParameters); this.exportProcessDialog.showOfflineDialog(parentFrame, this.storageParameters);
// ExportParams newParams = StorageOptionsDialog.showDialog(parentFrame, storageParameters); // ExportParams newParams = StorageOptionsDialog.showDialog(parentFrame, storageParameters);

View File

@ -1,13 +1,19 @@
package export.MLExport; package export.MLExport;
import java.io.File; import java.io.File;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
import export.PamDataUnitExporter; import export.PamDataUnitExporter;
import us.hebi.matlab.mat.format.Mat5; import us.hebi.matlab.mat.format.Mat5;
import us.hebi.matlab.mat.format.Mat5File;
import us.hebi.matlab.mat.types.Matrix;
import us.hebi.matlab.mat.types.Sink;
import us.hebi.matlab.mat.types.Sinks;
import us.hebi.matlab.mat.types.Struct; import us.hebi.matlab.mat.types.Struct;
import us.hebi.matlab.mat.util.Casts;
/** /**
@ -47,7 +53,21 @@ public class MLDetectionsManager implements PamDataUnitExporter {
} }
@Override @Override
public boolean exportData(File fileName, List<PamDataUnit> dataUnits) { public boolean exportData(File fileName, List<PamDataUnit> dataUnits, boolean append) {
try {
Mat5File matFile = Mat5.newMatFile();
Sink sink = Sinks.newMappedFile(fileName, Casts.sint32(1000000));
matFile.writeTo(sink);//Streams the data into a MAT file?
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return false;
}
return false; return false;
} }
@ -141,6 +161,39 @@ public class MLDetectionsManager implements PamDataUnitExporter {
public String getName() { public String getName() {
return "MATLAB"; return "MATLAB";
} }
public static void main(String args[]) {
String fileName = "/Users/au671271/MATLAB-Drive/MATLAB/PAMGUARD/_test/export_test.mat";
try {
Mat5File matFile = Mat5.newMatFile();
Struct mlStruct = Mat5.newStruct(3, 1);
Matrix triggerMap = Mat5.newScalar(Math.random());
mlStruct.set("triggerMap", 0, triggerMap);
mlStruct.set("triggerMap", 1, triggerMap);
mlStruct.set("triggerMap", 2, triggerMap);
matFile.addArray("test_struct", mlStruct);
//basic method to write to a file
Mat5.writeToFile(matFile, fileName);
// Sink sink = Sinks.newMappedFile(new File(fileName), Casts.sint32(1000000));
//
// matFile.writeTo(sink);
//
// sink.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

View File

@ -23,9 +23,10 @@ public interface PamDataUnitExporter {
* @param fileName - the file to export to * @param fileName - the file to export to
* @param prefix - file prefix for filenames. * @param prefix - file prefix for filenames.
* @param dataUnits - the data units to export. * @param dataUnits - the data units to export.
* @param true to append the data to the current file - otherwise a new file is written.
* @return true if exported successfully. * @return true if exported successfully.
*/ */
public boolean exportData(File fileName, List<PamDataUnit> dataUnits); public boolean exportData(File fileName, List<PamDataUnit> dataUnits, boolean append);
/** /**
* Get the extension for the output file type * Get the extension for the output file type

View File

@ -1,11 +1,14 @@
package export; package export;
import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import PamUtils.PamCalendar;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
import export.MLExport.MLDetectionsManager; import export.MLExport.MLDetectionsManager;
import export.RExport.RExportManager; import export.RExport.RExportManager;
import export.layoutFX.ExportParams;
import export.wavExport.WavFileExportManager; import export.wavExport.WavFileExportManager;
/** /**
@ -13,37 +16,96 @@ import export.wavExport.WavFileExportManager;
* offline processing. * offline processing.
*/ */
public class PamExporterManager { public class PamExporterManager {
/**
* The number of data units to save before saving.
*/
private static int BUFFER_SIZE = 1000;
/**
* Keep the file size to around 1GB per file
*/
private static int MAX_FILE_SIZE_MB = 1024;
/**
* A buffer of data units so we are not opening a file everytime a new data is passed to the export.
*/
private ArrayList<PamDataUnit> dataUnitBuffer = new ArrayList<PamDataUnit>();
/** /**
* A list of the avilable exporters. * A list of the avilable exporters.
*/ */
private ArrayList<PamDataUnitExporter> pamExporters; private ArrayList<PamDataUnitExporter> pamExporters;
/**
* The current file.
*/
private File currentFile;
/**
* Reference to the current export paramters.
*/
private ExportParams exportParams = new ExportParams();
public PamExporterManager() { public PamExporterManager() {
pamExporters = new ArrayList<PamDataUnitExporter>(); pamExporters = new ArrayList<PamDataUnitExporter>();
//add the MATLAB export //add the MATLAB export
pamExporters.add(new MLDetectionsManager()); pamExporters.add(new MLDetectionsManager());
pamExporters.add(new RExportManager()); pamExporters.add(new RExportManager());
pamExporters.add(new WavFileExportManager()); pamExporters.add(new WavFileExportManager());
} }
/** /**
* Add a data unit to the export list. * Add a data unit to the export list.
*/ */
public void exportDataUnit(PamDataUnit<?, ?> dataUnit) { public boolean exportDataUnit(PamDataUnit<?, ?> dataUnit) {
// TODO Auto-generated method stub boolean exportOK = true;
//if the data unit is null then save everything to the buffer.
if (currentFile == null || isFileSizeMax(currentFile)) {
//create a new file - note each exporter is responsible for closing the file after writing
//so previous files should already be closed
String fileName = (exportParams.folder + File.separator + PamCalendar.formatDate2(dataUnit.getTimeMilliseconds(), false)
+ "." + pamExporters.get(exportParams.exportChoice).getFileExtension());
currentFile = new File(fileName);
}
dataUnitBuffer.add(dataUnit);
if (BUFFER_SIZE>=BUFFER_SIZE) {
exportOK = pamExporters.get(exportParams.exportChoice).exportData(currentFile, dataUnitBuffer, true);
dataUnitBuffer.clear();
}
return exportOK;
}
/**
* Check whether the current file is greater than the maximum allowed file size.
* @param currentFile2 - the current file
* @return true of greater than or equal to the maximum file size.
*/
private boolean isFileSizeMax(File currentFile2) {
return getFileSizeMegaBytes(currentFile2) >= MAX_FILE_SIZE_MB;
}
/**
* Get the file size in MegaBytes
* @param file
* @return
*/
private static double getFileSizeMegaBytes(File file) {
return (double) file.length() / (1024 * 1024);
} }
public boolean canExportDataBlock(PamDataBlock dataBlock) { public boolean canExportDataBlock(PamDataBlock dataBlock) {
for (PamDataUnitExporter exporter:pamExporters) { for (PamDataUnitExporter exporter:pamExporters) {
if (exporter.hasCompatibleUnits(dataBlock.getUnitClass())) return true; if (exporter.hasCompatibleUnits(dataBlock.getUnitClass())) return true;
} }
return false; return false;
} }
@ -62,7 +124,7 @@ public class PamExporterManager {
*/ */
public PamDataUnitExporter getExporter(int i) { public PamDataUnitExporter getExporter(int i) {
return pamExporters.get(i); return pamExporters.get(i);
} }

View File

@ -137,7 +137,7 @@ public class RExportManager implements PamDataUnitExporter {
@Override @Override
public boolean exportData(File fileName, List<PamDataUnit> dataUnits) { public boolean exportData(File fileName, List<PamDataUnit> dataUnits, boolean append) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return false; return false;
} }

View File

@ -16,10 +16,14 @@ public class ExportParams implements Serializable, Cloneable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* The index of the ex;port choice. * The index of the export choice.
*/ */
public int exportChoice = 0; public int exportChoice = 0;
/**
* The folder to save to.
*/
public String folder = System.getProperty("user.home");
@Override @Override
public ExportParams clone() { public ExportParams clone() {

View File

@ -140,6 +140,12 @@ public class ExportProcessDialog {
*/ */
private JSpinner spinner; private JSpinner spinner;
private ButtonGroup buttonGroup;
/**
* A list of the export buttons so they are easy to select.
*/
private JToggleButton[] exportButtons;
public ExportOLDialog(Window parentFrame, OfflineTaskGroup taskGroup, String title) { public ExportOLDialog(Window parentFrame, OfflineTaskGroup taskGroup, String title) {
@ -150,24 +156,30 @@ public class ExportProcessDialog {
mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.PAGE_AXIS)); mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.PAGE_AXIS));
mainPanel.setBorder(new TitledBorder("Export Settings")); mainPanel.setBorder(new TitledBorder("Export Settings"));
ButtonGroup buttonGroup = new ButtonGroup(); buttonGroup = new ButtonGroup();
PamPanel buttonPanel = new PamPanel(); PamPanel buttonPanel = new PamPanel();
ActionListener listener = actionEvent -> { ActionListener listener = actionEvent -> {
System.out.println(actionEvent.getActionCommand() + " Selected"); System.out.println(actionEvent.getActionCommand() + " Selected");
//TODO set the buttons to be disabled or enabled.
}; };
exportButtons = new JToggleButton[exportManager.getNumExporters()];
for (int i = 0; i < exportManager.getNumExporters(); i++) { for (int i = 0; i < exportManager.getNumExporters(); i++) {
JToggleButton b = new JToggleButton(); JToggleButton b = new JToggleButton();
b.setToolTipText("Export to " + exportManager.getExporter(i).getName() + " file (" + exportManager.getExporter(i).getFileExtension() + ")"); b.setToolTipText("Export to " + exportManager.getExporter(i).getName() + " file (" + exportManager.getExporter(i).getFileExtension() + ")");
FontIcon icon = FontIcon.of(getIconFromString(exportManager.getExporter(i).getIconString())); FontIcon icon = FontIcon.of(getIconFromString(exportManager.getExporter(i).getIconString()));
icon.setIconSize(25); icon.setIconSize(25);
icon.setIconColor(Color.GRAY); icon.setIconColor(Color.DARK_GRAY);
b.setIcon(icon); b.setIcon(icon);
b.addActionListener(listener); b.addActionListener(listener);
exportButtons[i]=b;
buttonGroup.add(b); buttonGroup.add(b);
buttonPanel.add(b); buttonPanel.add(b);
} }
@ -267,12 +279,13 @@ public class ExportProcessDialog {
return super.getParams(); return super.getParams();
} }
public void setParams(ExportParams params) { public void setParams(ExportParams params) {
if (params ==null) currentParams = new ExportParams(); if (params ==null) currentParams = new ExportParams();
currentParams = params.clone(); currentParams = params.clone();
buttonGroup.clearSelection();
exportButtons[params.exportChoice].setSelected(true);
} }
} }

View File

@ -1,7 +1,10 @@
package export.swing; package export.swing;
import PamController.PamController;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
import PamguardMVC.dataSelector.DataSelectDialog;
import PamguardMVC.dataSelector.DataSelector;
import dataMap.OfflineDataMapPoint; import dataMap.OfflineDataMapPoint;
import export.PamExporterManager; import export.PamExporterManager;
import offlineProcessing.OfflineTask; import offlineProcessing.OfflineTask;
@ -14,12 +17,21 @@ import offlineProcessing.OfflineTask;
*/ */
public class ExportTask extends OfflineTask<PamDataUnit<?,?>>{ public class ExportTask extends OfflineTask<PamDataUnit<?,?>>{
PamExporterManager exporter; /**
* Reference to the data exporter which manages exporting of data.
*/
private PamExporterManager exporter;
/**
* The data selector for the data block
*/
private DataSelector dataSelector;
public ExportTask(PamDataBlock<PamDataUnit<?, ?>> parentDataBlock, PamExporterManager exporter) { public ExportTask(PamDataBlock<PamDataUnit<?, ?>> parentDataBlock, PamExporterManager exporter) {
super(parentDataBlock); super(parentDataBlock);
this.exporter = exporter; this.exporter = exporter;
// TODO Auto-generated constructor stub dataSelector=parentDataBlock.getDataSelectCreator().getDataSelector(this.getUnitName() +"_clicks", false, null);
} }
@Override @Override
@ -41,7 +53,29 @@ public class ExportTask extends OfflineTask<PamDataUnit<?,?>>{
@Override @Override
public void loadedDataComplete() { public void loadedDataComplete() {
// TODO Auto-generated method stub //force the exporter so save any remaning data units in the buffer
exporter.exportDataUnit(null);
}
/**
* task has settings which can be called
* @return true or false
*/
public boolean hasSettings() {
return dataSelector!=null;
}
/**
* Call any task specific settings
* @return true if settings may have changed.
*/
public boolean callSettings() {
dataSelector.getDialogPanel().setParams();
DataSelectDialog dataSelectDialog = new DataSelectDialog(PamController.getMainFrame(),
this.getDataBlock(), dataSelector, null);
return dataSelectDialog.showDialog();
} }

View File

@ -431,7 +431,7 @@ public class WavFileExportManager implements PamDataUnitExporter {
@Override @Override
public boolean exportData(File fileName, public boolean exportData(File fileName,
List<PamDataUnit> dataUnits) { List<PamDataUnit> dataUnits, boolean append) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return false; return false;
} }

View File

@ -1,6 +1,7 @@
package offlineProcessing; package offlineProcessing;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.GridBagConstraints; import java.awt.GridBagConstraints;
import java.awt.GridBagLayout; import java.awt.GridBagLayout;
import java.awt.Insets; import java.awt.Insets;
@ -24,6 +25,9 @@ import javax.swing.SwingConstants;
import javax.swing.WindowConstants; import javax.swing.WindowConstants;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;
import org.kordamp.ikonli.materialdesign2.MaterialDesignC;
import org.kordamp.ikonli.swing.FontIcon;
import PamUtils.PamCalendar; import PamUtils.PamCalendar;
import PamUtils.TxtFileUtils; import PamUtils.TxtFileUtils;
import PamView.CancelObserver; import PamView.CancelObserver;
@ -90,7 +94,9 @@ public class OLProcessDialog extends PamDialog {
private PamPanel timeChunkDataPanel; private PamPanel timeChunkDataPanel;
public static ImageIcon settings = new ImageIcon(ClassLoader.getSystemResource("Resources/SettingsButtonSmall2.png")); // public static ImageIcon settings = new ImageIcon(ClassLoader.getSystemResource("Resources/SettingsButtonSmall2.png"));
public static FontIcon settings = FontIcon.of(MaterialDesignC.COG, 20, Color.DARK_GRAY);
TaskStatus currentStatus = TaskStatus.IDLE; TaskStatus currentStatus = TaskStatus.IDLE;

View File

@ -36,7 +36,7 @@ public class PAMGuiFXSettings implements Serializable, Cloneable {
/** /**
* True if PG is in fullscreen on startup * True if PG is in fullscreen on startup
*/ */
public boolean fullscreen = true; public boolean fullscreen = false;
/* (non-Javadoc) /* (non-Javadoc)

View File

@ -1,6 +1,7 @@
package targetMotionModule.panels; package targetMotionModule.panels;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.FlowLayout; import java.awt.FlowLayout;
import java.awt.Frame; import java.awt.Frame;
@ -13,7 +14,6 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import javax.swing.ButtonGroup; import javax.swing.ButtonGroup;
import javax.swing.ImageIcon;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JLabel; import javax.swing.JLabel;
@ -24,6 +24,9 @@ import javax.swing.JToolBar;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;
import org.kordamp.ikonli.materialdesign2.MaterialDesignC;
import org.kordamp.ikonli.swing.FontIcon;
import targetMotionModule.TargetMotionControl; import targetMotionModule.TargetMotionControl;
import targetMotionModule.TargetMotionInformation; import targetMotionModule.TargetMotionInformation;
import targetMotionModule.TargetMotionLocaliser; import targetMotionModule.TargetMotionLocaliser;
@ -74,8 +77,9 @@ public class TargetMotionMainPanel<T extends PamDataUnit> implements PamTabPanel
public JTextField comment; public JTextField comment;
private PamPanel southPanel; private PamPanel southPanel;
public ImageIcon settings = new ImageIcon(ClassLoader // public ImageIcon settings = new ImageIcon(ClassLoader
.getSystemResource("Resources/SettingsButtonSmall2.png")); // .getSystemResource("Resources/SettingsButtonSmall2.png"));
public static FontIcon settings = FontIcon.of(MaterialDesignC.COG, 20, Color.DARK_GRAY);
public TargetMotionMainPanel(TargetMotionLocaliser<T> targetMotionLocaliser) { public TargetMotionMainPanel(TargetMotionLocaliser<T> targetMotionLocaliser) {