mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-22 07:02:29 +00:00
work on deployment wizards
This commit is contained in:
parent
639f33607e
commit
70fbeaafde
2
.project
2
.project
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>PamGuard Main DG</name>
|
||||
<name>PamGuard Main Tethys</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
|
@ -1,2 +1,4 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding//src/rawDeepLearningClassifer/segmenter/SegmenterProcess.java=UTF-8
|
||||
encoding/<project>=UTF-8
|
||||
encoding/src=UTF-8
|
||||
|
@ -4,7 +4,7 @@
|
||||
<groupId>org.pamguard</groupId>
|
||||
<artifactId>Pamguard</artifactId>
|
||||
<name>Pamguard Java12+</name>
|
||||
<version>2.02.09e</version>
|
||||
<version>2.02.09f</version>
|
||||
<description>Pamguard for Java 12+, using Maven to control dependcies</description>
|
||||
<url>www.pamguard.org</url>
|
||||
<organization>
|
||||
@ -17,6 +17,7 @@
|
||||
<resource>
|
||||
<directory>src</directory>
|
||||
<excludes>
|
||||
<exclude>META-INF/*.SF,META-INF/*.DSA,META-INF/*.RSA</exclude>
|
||||
<exclude>**/*.java</exclude>
|
||||
<exclude>jars/*.*</exclude>
|
||||
</excludes>
|
||||
@ -196,6 +197,10 @@
|
||||
<properties>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<javafx.version>16</javafx.version>
|
||||
<jaxb.runtime.version>2.4.0-b180830.0438</jaxb.runtime.version>
|
||||
<jaxb.xjc.version>2.4.0-b180830.0438</jaxb.xjc.version>
|
||||
<jaxb.api.version>2.4.0-b180830.0359</jaxb.api.version>
|
||||
</properties>
|
||||
</project>
|
||||
|
4
repo/tethys/org/javaclient/3.0/_remote.repositories
Normal file
4
repo/tethys/org/javaclient/3.0/_remote.repositories
Normal file
@ -0,0 +1,4 @@
|
||||
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
|
||||
#Thu Dec 21 11:13:37 GMT 2023
|
||||
javaclient-3.0.jar>=
|
||||
javaclient-3.0.pom>=
|
BIN
repo/tethys/org/javaclient/3.0/javaclient-3.0.jar
Normal file
BIN
repo/tethys/org/javaclient/3.0/javaclient-3.0.jar
Normal file
Binary file not shown.
9
repo/tethys/org/javaclient/3.0/javaclient-3.0.pom
Normal file
9
repo/tethys/org/javaclient/3.0/javaclient-3.0.pom
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>tethys.org</groupId>
|
||||
<artifactId>javaclient</artifactId>
|
||||
<version>3.0</version>
|
||||
<description>POM was created from install:install-file</description>
|
||||
</project>
|
12
repo/tethys/org/javaclient/maven-metadata-local.xml
Normal file
12
repo/tethys/org/javaclient/maven-metadata-local.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<metadata>
|
||||
<groupId>tethys.org</groupId>
|
||||
<artifactId>javaclient</artifactId>
|
||||
<versioning>
|
||||
<release>3.0</release>
|
||||
<versions>
|
||||
<version>3.0</version>
|
||||
</versions>
|
||||
<lastUpdated>20231221111337</lastUpdated>
|
||||
</versioning>
|
||||
</metadata>
|
4
repo/tethys/org/nilus/3.0/_remote.repositories
Normal file
4
repo/tethys/org/nilus/3.0/_remote.repositories
Normal file
@ -0,0 +1,4 @@
|
||||
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
|
||||
#Thu Dec 21 11:14:13 GMT 2023
|
||||
nilus-3.0.pom>=
|
||||
nilus-3.0.jar>=
|
11
repo/tethys/org/nilus/3.0/m2e-lastUpdated.properties
Normal file
11
repo/tethys/org/nilus/3.0/m2e-lastUpdated.properties
Normal file
@ -0,0 +1,11 @@
|
||||
#Thu Dec 21 16:45:12 GMT 2023
|
||||
bedatadriven|https\://nexus.bedatadriven.com/content/groups/public/|javadoc=1703177112968
|
||||
talan|https\://nexus.talanlabs.com/content/repositories/releases/|javadoc=1703177112968
|
||||
repo|file\://C\:\\Users\\dg50\\source\\repos\\PAMGuardDG_2/repo|javadoc=1703177112968
|
||||
central|https\://repo1.maven.org/maven2|sources=1703157324238
|
||||
unidata-all|https\://artifacts.unidata.ucar.edu/repository/unidata-all/|javadoc=1703177112968
|
||||
repo|file\://C\:\\Users\\dg50\\source\\repos\\PAMGuardDG_2/repo|sources=1703157324238
|
||||
talan|https\://nexus.talanlabs.com/content/repositories/releases/|sources=1703157324238
|
||||
bedatadriven|https\://nexus.bedatadriven.com/content/groups/public/|sources=1703157324238
|
||||
unidata-all|https\://artifacts.unidata.ucar.edu/repository/unidata-all/|sources=1703157324238
|
||||
central|https\://repo1.maven.org/maven2|javadoc=1703177112968
|
12
repo/tethys/org/nilus/3.0/nilus-3.0-javadoc.jar.lastUpdated
Normal file
12
repo/tethys/org/nilus/3.0/nilus-3.0-javadoc.jar.lastUpdated
Normal file
@ -0,0 +1,12 @@
|
||||
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
|
||||
#Thu Dec 21 16:45:12 GMT 2023
|
||||
@default-talan-https\://nexus.talanlabs.com/content/repositories/releases/.lastUpdated=1703177112601
|
||||
https\://repo1.maven.org/maven2/.error=
|
||||
file\://C\:\\Users\\dg50\\source\\repos\\PAMGuardDG_2/repo/.error=
|
||||
file\://C\:\\Users\\dg50\\source\\repos\\PAMGuardDG_2/repo/.lastUpdated=1703177110940
|
||||
https\://artifacts.unidata.ucar.edu/repository/unidata-all/.error=
|
||||
https\://nexus.bedatadriven.com/content/groups/public/.error=
|
||||
https\://nexus.bedatadriven.com/content/groups/public/.lastUpdated=1703177112519
|
||||
https\://artifacts.unidata.ucar.edu/repository/unidata-all/.lastUpdated=1703177112101
|
||||
https\://repo1.maven.org/maven2/.lastUpdated=1703177112965
|
||||
https\://nexus.talanlabs.com/content/repositories/releases/.error=Could not transfer artifact tethys.org\:nilus\:jar\:javadoc\:3.0 from/to talan (https\://nexus.talanlabs.com/content/repositories/releases/)\: nexus.talanlabs.com
|
12
repo/tethys/org/nilus/3.0/nilus-3.0-sources.jar.lastUpdated
Normal file
12
repo/tethys/org/nilus/3.0/nilus-3.0-sources.jar.lastUpdated
Normal file
@ -0,0 +1,12 @@
|
||||
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
|
||||
#Thu Dec 21 11:15:24 GMT 2023
|
||||
@default-talan-https\://nexus.talanlabs.com/content/repositories/releases/.lastUpdated=1703157323819
|
||||
https\://repo1.maven.org/maven2/.error=
|
||||
file\://C\:\\Users\\dg50\\source\\repos\\PAMGuardDG_2/repo/.error=
|
||||
file\://C\:\\Users\\dg50\\source\\repos\\PAMGuardDG_2/repo/.lastUpdated=1703157322932
|
||||
https\://artifacts.unidata.ucar.edu/repository/unidata-all/.error=
|
||||
https\://nexus.bedatadriven.com/content/groups/public/.error=
|
||||
https\://nexus.bedatadriven.com/content/groups/public/.lastUpdated=1703157323770
|
||||
https\://artifacts.unidata.ucar.edu/repository/unidata-all/.lastUpdated=1703157323508
|
||||
https\://repo1.maven.org/maven2/.lastUpdated=1703157324237
|
||||
https\://nexus.talanlabs.com/content/repositories/releases/.error=Could not transfer artifact tethys.org\:nilus\:jar\:sources\:3.0 from/to talan (https\://nexus.talanlabs.com/content/repositories/releases/)\: nexus.talanlabs.com
|
BIN
repo/tethys/org/nilus/3.0/nilus-3.0.jar
Normal file
BIN
repo/tethys/org/nilus/3.0/nilus-3.0.jar
Normal file
Binary file not shown.
9
repo/tethys/org/nilus/3.0/nilus-3.0.pom
Normal file
9
repo/tethys/org/nilus/3.0/nilus-3.0.pom
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>tethys.org</groupId>
|
||||
<artifactId>nilus</artifactId>
|
||||
<version>3.0</version>
|
||||
<description>POM was created from install:install-file</description>
|
||||
</project>
|
12
repo/tethys/org/nilus/maven-metadata-local.xml
Normal file
12
repo/tethys/org/nilus/maven-metadata-local.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<metadata>
|
||||
<groupId>tethys.org</groupId>
|
||||
<artifactId>nilus</artifactId>
|
||||
<versioning>
|
||||
<release>3.0</release>
|
||||
<versions>
|
||||
<version>3.0</version>
|
||||
</versions>
|
||||
<lastUpdated>20231221111413</lastUpdated>
|
||||
</versioning>
|
||||
</metadata>
|
@ -5,6 +5,7 @@ import java.lang.reflect.Field;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamModel.parametermanager.PrivatePamParameterData;
|
||||
|
||||
public class AISParameters implements Serializable, Cloneable, ManagedParameters {
|
||||
@ -51,7 +52,7 @@ public class AISParameters implements Serializable, Cloneable, ManagedParameters
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
try {
|
||||
Field field = this.getClass().getDeclaredField("nmeaSource");
|
||||
ps.put(new PrivatePamParameterData(this, field) {
|
||||
|
@ -5,6 +5,7 @@ import java.io.Serializable;
|
||||
import NMEA.NMEABitArray;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamUtils.LatLong;
|
||||
|
||||
/**
|
||||
@ -160,7 +161,7 @@ sensor.
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ import java.util.Calendar;
|
||||
import NMEA.NMEABitArray;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamUtils.PamCalendar;
|
||||
|
||||
public class AISStaticData extends AISReport implements Serializable, ManagedParameters{
|
||||
@ -393,7 +394,7 @@ public class AISStaticData extends AISReport implements Serializable, ManagedPar
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -283,6 +283,16 @@ public class AcquisitionControl extends RawInputControlledUnit implements PamSet
|
||||
return daqControllers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDataLocation() {
|
||||
if (offlineFileServer == null) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
return offlineFileServer.getDataLocation();
|
||||
}
|
||||
}
|
||||
|
||||
public AcquisitionProcess getDaqProcess() {
|
||||
return acquisitionProcess;
|
||||
}
|
||||
|
@ -151,6 +151,7 @@ public class AcquisitionDialog extends PamDialog {
|
||||
acquisitionParameters = oldParams.clone();
|
||||
|
||||
acquisitionControl = daqControl;
|
||||
// singleInstance = null;
|
||||
|
||||
if (singleInstance == null || singleInstance.getOwner() != parentFrame) {
|
||||
singleInstance = new AcquisitionDialog(parentFrame);
|
||||
|
@ -10,6 +10,7 @@ import Array.Preamplifier;
|
||||
import PamController.PamController;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamModel.parametermanager.PrivatePamParameterData;
|
||||
import PamguardMVC.PamConstants;
|
||||
|
||||
@ -320,7 +321,7 @@ public class AcquisitionParameters implements Serializable, Cloneable, ManagedPa
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
try {
|
||||
Field field = this.getClass().getDeclaredField("channelList");
|
||||
ps.put(new PrivatePamParameterData(this, field) {
|
||||
|
@ -5,6 +5,7 @@ import java.lang.reflect.Field;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamModel.parametermanager.PrivatePamParameterData;
|
||||
import binaryFileStorage.BinaryHeader;
|
||||
import binaryFileStorage.BinaryObjectData;
|
||||
@ -30,7 +31,7 @@ class DaqStatusModuleHeader extends ModuleHeader implements Serializable, Manage
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
try {
|
||||
Field field = this.getClass().getDeclaredField("daqName");
|
||||
ps.put(new PrivatePamParameterData(this, field) {
|
||||
|
@ -5,6 +5,7 @@ import java.util.ArrayList;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
||||
/**
|
||||
* Used by FileInputSystem
|
||||
@ -78,7 +79,7 @@ public class FileInputParameters implements Serializable, Cloneable, ManagedPara
|
||||
return null;
|
||||
}
|
||||
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
return ps;
|
||||
}
|
||||
}
|
||||
|
@ -700,7 +700,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
|
||||
if (currentFile > 0 && currentFile >= allFiles.size()) {
|
||||
fileListComplete();
|
||||
}
|
||||
// System.out.println("FolderinputSytem: daqHasEnded");
|
||||
System.out.println("FolderinputSytem: daqHasEnded");
|
||||
}
|
||||
|
||||
private void setFolderProgress() {
|
||||
|
@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import simulatedAcquisition.SimProcess;
|
||||
|
||||
/**
|
||||
@ -47,7 +48,7 @@ public class SoundCardParameters implements Serializable, Cloneable, ManagedPara
|
||||
return null;
|
||||
}
|
||||
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
return ps;
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import java.util.TimeZone;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import soundtrap.STXMLFile;
|
||||
|
||||
public class StandardFileDateSettings implements Serializable, Cloneable, ManagedParameters {
|
||||
@ -150,7 +151,7 @@ public class StandardFileDateSettings implements Serializable, Cloneable, Manage
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
|
||||
return ps;
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import Acquisition.AcquisitionControl;
|
||||
import Acquisition.AcquisitionDialog;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
||||
public class PPSParameters implements Cloneable, Serializable, ManagedParameters {
|
||||
|
||||
@ -36,7 +37,7 @@ public class PPSParameters implements Cloneable, Serializable, ManagedParameters
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ import java.lang.reflect.Field;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamModel.parametermanager.PrivatePamParameterData;
|
||||
import PamUtils.LatLong;
|
||||
|
||||
@ -95,7 +96,7 @@ public class AirgunParameters implements Serializable, Cloneable, ManagedParamet
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
|
||||
try {
|
||||
Field field = this.getClass().getDeclaredField("dimE");
|
||||
ps.put(new PrivatePamParameterData(this, field) {
|
||||
|
@ -45,6 +45,8 @@ public class ArrayDialog extends PamDialog implements ActionListener {
|
||||
|
||||
private HydrophoneDiagram hydrophoneDiagram;
|
||||
|
||||
private InstrumentIdentityPanel instrumentIdentityPanel;
|
||||
|
||||
private JButton okButton, cancelButton;
|
||||
|
||||
private JButton newArrayButton, copyArrayButton, importArrayButton, exportArrayButton;
|
||||
@ -69,11 +71,14 @@ public class ArrayDialog extends PamDialog implements ActionListener {
|
||||
eastPanel.add(channelPanel.getChannelPanel());
|
||||
|
||||
environmentPanel = new EnvironmentPanel(this);
|
||||
instrumentIdentityPanel = new InstrumentIdentityPanel();
|
||||
// eastPanel.add(environmentPanel.getEnvironmentPanel());
|
||||
|
||||
hydrophoneDiagram = new HydrophoneDiagram(this);
|
||||
JPanel westPanel = new JPanel(new BorderLayout());
|
||||
westPanel.add(BorderLayout.CENTER, hydrophoneDiagram.getPlotPanel());
|
||||
westPanel.add(BorderLayout.SOUTH, environmentPanel.getEnvironmentPanel());
|
||||
westPanel.add(BorderLayout.NORTH, instrumentIdentityPanel.getComponent());
|
||||
|
||||
|
||||
splitPanel.add(westPanel);
|
||||
@ -144,6 +149,7 @@ public class ArrayDialog extends PamDialog implements ActionListener {
|
||||
hydrophoneDialogPanel.setParams(selArray);
|
||||
channelPanel.setParams();
|
||||
hydrophoneDiagram.rePaint();
|
||||
instrumentIdentityPanel.setParams(selArray);
|
||||
if (selArray != null) {
|
||||
environmentPanel.setNewSpeed(selArray.getSpeedOfSound());
|
||||
}
|
||||
@ -171,6 +177,7 @@ public class ArrayDialog extends PamDialog implements ActionListener {
|
||||
array.setSpeedOfSound(environmentPanel.getNewSpeed());
|
||||
array.setSpeedOfSoundError(environmentPanel.getNewError());
|
||||
hydrophoneDialogPanel.getParams();
|
||||
instrumentIdentityPanel.getParams(array);
|
||||
|
||||
if (checkDaqChannels(array) == false) {
|
||||
return false;
|
||||
@ -250,6 +257,7 @@ public class ArrayDialog extends PamDialog implements ActionListener {
|
||||
environmentPanel.setNewSpeed(currentArray.getSpeedOfSound());
|
||||
environmentPanel.setNewError(currentArray.getSpeedOfSoundError());
|
||||
}
|
||||
instrumentIdentityPanel.setParams(currentArray);
|
||||
}
|
||||
|
||||
void newChannelSelection() {
|
||||
|
@ -28,6 +28,7 @@ import java.util.Arrays;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamModel.parametermanager.PrivatePamParameterData;
|
||||
import pamMaths.PamVector;
|
||||
import PamView.PamSymbol;
|
||||
@ -158,7 +159,7 @@ public class Hydrophone implements Serializable, Cloneable, ManagedParameters {
|
||||
return sensitivity;
|
||||
}
|
||||
|
||||
protected void setSensitivity(double sensitivity) {
|
||||
public void setSensitivity(double sensitivity) {
|
||||
this.sensitivity = sensitivity;
|
||||
}
|
||||
|
||||
@ -333,7 +334,7 @@ public class Hydrophone implements Serializable, Cloneable, ManagedParameters {
|
||||
/**
|
||||
* @return Returns the coordinate.
|
||||
*/
|
||||
protected double[] getCoordinates() {
|
||||
public double[] getCoordinates() {
|
||||
return Arrays.copyOf(coordinate,3);
|
||||
}
|
||||
|
||||
@ -364,7 +365,7 @@ public class Hydrophone implements Serializable, Cloneable, ManagedParameters {
|
||||
/**
|
||||
* @param preampGain The preampGain to set.
|
||||
*/
|
||||
protected void setPreampGain(double preampGain) {
|
||||
public void setPreampGain(double preampGain) {
|
||||
this.preampGain = preampGain;
|
||||
}
|
||||
|
||||
@ -478,7 +479,7 @@ public class Hydrophone implements Serializable, Cloneable, ManagedParameters {
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet pps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet pps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
Field f;
|
||||
try {
|
||||
f = this.getClass().getDeclaredField("coordinate");
|
||||
|
@ -7,6 +7,7 @@ import Array.streamerOrigin.StreamerDataIterator;
|
||||
import GPS.GpsData;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamModel.parametermanager.PrivatePamParameterData;
|
||||
import PamUtils.LatLong;
|
||||
import PamguardMVC.PamDataBlock;
|
||||
@ -225,7 +226,7 @@ abstract public class HydrophoneLocator implements Serializable, Cloneable, Mana
|
||||
*/
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
try {
|
||||
Field field = this.getClass().getDeclaredField("pamArray");
|
||||
ps.put(new PrivatePamParameterData(this, field) {
|
||||
|
72
src/Array/InstrumentIdentityPanel.java
Normal file
72
src/Array/InstrumentIdentityPanel.java
Normal file
@ -0,0 +1,72 @@
|
||||
package Array;
|
||||
|
||||
import java.awt.GridBagConstraints;
|
||||
import java.awt.GridBagLayout;
|
||||
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.border.TitledBorder;
|
||||
|
||||
import PamView.dialog.PamGridBagContraints;
|
||||
import PamView.panel.WestAlignedPanel;
|
||||
|
||||
/**
|
||||
* Instrument identity panel, contrians additional fields required by Tethys.
|
||||
* @author dg50
|
||||
*
|
||||
*/
|
||||
public class InstrumentIdentityPanel {
|
||||
|
||||
private JPanel mainPanel;
|
||||
|
||||
private JTextField instrumentId;
|
||||
|
||||
private JTextField instrumentType;
|
||||
|
||||
public InstrumentIdentityPanel() {
|
||||
mainPanel = new WestAlignedPanel();
|
||||
mainPanel.setBorder(new TitledBorder("Instrument information"));
|
||||
mainPanel.setLayout(new GridBagLayout());
|
||||
GridBagConstraints c = new PamGridBagContraints();
|
||||
mainPanel.add(new JLabel("Instrument Type ", JLabel.RIGHT), c);
|
||||
c.gridx++;
|
||||
mainPanel.add(instrumentType = new JTextField(20), c);
|
||||
c.gridx = 0;
|
||||
c.gridy++;
|
||||
mainPanel.add(new JLabel("Instrument Id ", JLabel.RIGHT), c);
|
||||
c.gridx++;
|
||||
mainPanel.add(instrumentId = new JTextField(20), c);
|
||||
|
||||
instrumentType.setToolTipText("Instrument type, e.g. Towed array, HARP, EAR, Popup, DMON, Rock Hopper, etc.");
|
||||
instrumentId.setToolTipText("Instrument identifier, e.g. serial number");
|
||||
|
||||
}
|
||||
|
||||
public JComponent getComponent() {
|
||||
return mainPanel;
|
||||
}
|
||||
|
||||
public void setParams(PamArray currentArray) {
|
||||
if (currentArray == null) {
|
||||
currentArray = ArrayManager.getArrayManager().getCurrentArray();
|
||||
}
|
||||
if (currentArray == null) {
|
||||
return;
|
||||
}
|
||||
instrumentType.setText(currentArray.getInstrumentType());
|
||||
instrumentId.setText(currentArray.getInstrumentId());
|
||||
}
|
||||
|
||||
public void getParams(PamArray currentArray) {
|
||||
if (currentArray == null) {
|
||||
currentArray = ArrayManager.getArrayManager().getCurrentArray();
|
||||
}
|
||||
if (currentArray == null) {
|
||||
return;
|
||||
}
|
||||
currentArray.setInstrumentType(instrumentType.getText());
|
||||
currentArray.setInstrumentId(instrumentId.getText());
|
||||
}
|
||||
}
|
@ -16,5 +16,10 @@ abstract public class MovingHydrophoneLocator extends SimpleHydrophoneLocator {
|
||||
super(pamArray, streamer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isChangeable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -35,6 +35,7 @@ import Array.streamerOrigin.StreamerDataIterator;
|
||||
import GPS.GpsData;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamModel.parametermanager.PrivatePamParameterData;
|
||||
import PamUtils.LatLong;
|
||||
import PamUtils.PamArrayUtils;
|
||||
@ -91,6 +92,33 @@ public class PamArray implements Serializable, Cloneable, ManagedParameters {
|
||||
|
||||
private String arrayFile;
|
||||
|
||||
/**
|
||||
* Type, used for Tethys and other meta data control
|
||||
*/
|
||||
private String instrumentType;
|
||||
|
||||
/**
|
||||
* Array Id. Can be anything. Compulsory for Tethys.
|
||||
*/
|
||||
private String instrumentId;
|
||||
|
||||
public String getInstrumentType() {
|
||||
return instrumentType;
|
||||
}
|
||||
|
||||
public void setInstrumentType(String instrumentType) {
|
||||
this.instrumentType = instrumentType;
|
||||
}
|
||||
|
||||
public String getInstrumentId() {
|
||||
return instrumentId;
|
||||
}
|
||||
|
||||
public void setInstrumentId(String instrumentId) {
|
||||
this.instrumentId = instrumentId;
|
||||
}
|
||||
|
||||
|
||||
// private int originInterpolation = ORIGIN_USE_LATEST;
|
||||
private int originInterpolation = ORIGIN_USE_PRECEEDING;
|
||||
|
||||
@ -1574,7 +1602,7 @@ public class PamArray implements Serializable, Cloneable, ManagedParameters {
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
try {
|
||||
Field field = this.getClass().getDeclaredField("streamers");
|
||||
ps.put(new PrivatePamParameterData(this, field) {
|
||||
|
@ -25,6 +25,7 @@ import java.io.Serializable;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -79,7 +80,7 @@ public class Preamplifier implements Serializable, Cloneable, ManagedParameters
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,7 @@ import PamController.PamController;
|
||||
import PamController.masterReference.MasterReferencePoint;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamModel.parametermanager.PrivatePamParameterData;
|
||||
import PamUtils.LatLong;
|
||||
import PamUtils.PamCalendar;
|
||||
@ -767,7 +768,7 @@ public class Streamer implements Serializable, Cloneable, ManagedParameters {
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
try {
|
||||
Field field = this.getClass().getDeclaredField("coordinate");
|
||||
ps.put(new PrivatePamParameterData(this, field) {
|
||||
|
@ -259,6 +259,7 @@ public class StreamerDialog extends PamDialog {
|
||||
// }
|
||||
singleInstance.currentArray = currentArray;
|
||||
singleInstance.defaultStreamer = streamer;//.clone();
|
||||
// singleInstance.st
|
||||
singleInstance.setParams();
|
||||
singleInstance.setVisible(true);
|
||||
return singleInstance.defaultStreamer;
|
||||
@ -549,6 +550,17 @@ public class StreamerDialog extends PamDialog {
|
||||
pack();
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
OriginSettings os = defaultStreamer.getOriginSettings(currentOriginMethod.getClass());
|
||||
if (os != null) {
|
||||
currentOriginMethod.setOriginSettings(os);
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
// will throw if it tries to set the wrong type of settings.
|
||||
}
|
||||
|
||||
enableControls();
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@ package Array.streamerOrigin;
|
||||
import PamController.SettingsObject;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
||||
/**
|
||||
* Class to hold settings for the different origin methods.
|
||||
@ -47,7 +48,7 @@ public abstract class OriginSettings implements SettingsObject, Cloneable, Manag
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@ import java.util.Arrays;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import mcc.MccJniInterface;
|
||||
import mcc.mccjna.MCCConstants;
|
||||
|
||||
@ -67,7 +68,7 @@ public class ArrayAccelParams implements Serializable, Cloneable, ManagedParamet
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@ import java.lang.reflect.Field;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamModel.parametermanager.PrivatePamParameterData;
|
||||
import PamView.GroupedSourceParameters;
|
||||
import PamguardMVC.PamConstants;
|
||||
@ -44,7 +45,7 @@ public class AzigramParameters implements Serializable, ManagedParameters, Clone
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
try {
|
||||
Field field = this.getClass().getDeclaredField("name");
|
||||
ps.put(new PrivatePamParameterData(this, field) {
|
||||
|
@ -7,6 +7,7 @@ import org.w3c.dom.Element;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
||||
/**
|
||||
* FilterPArameters for use when the filter is on it's own (within a FilterController)
|
||||
@ -39,7 +40,7 @@ public class FilterParameters_2 implements Serializable, Cloneable, ManagedParam
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -30,6 +30,7 @@ import org.w3c.dom.Element;
|
||||
import PamController.PamControlledUnit;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamUtils.FrequencyFormat;
|
||||
|
||||
/**
|
||||
@ -358,7 +359,7 @@ public class FilterParams implements Serializable, Cloneable, ManagedParameters
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@ import java.lang.reflect.Field;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamModel.parametermanager.PrivatePamParameterData;
|
||||
|
||||
public class GPSParameters implements Serializable, Cloneable, ManagedParameters {
|
||||
@ -175,7 +176,7 @@ public class GPSParameters implements Serializable, Cloneable, ManagedParameters
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
try {
|
||||
Field field = this.getClass().getDeclaredField("nmeaSource");
|
||||
ps.put(new PrivatePamParameterData(this, field) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
package GPS;
|
||||
|
||||
import PamUtils.PamCalendar;
|
||||
import PamguardMVC.PamDataUnit;
|
||||
|
||||
public class GpsDataUnit extends PamDataUnit {
|
||||
@ -52,12 +53,18 @@ public class GpsDataUnit extends PamDataUnit {
|
||||
*/
|
||||
@Override
|
||||
public String getSummaryString() {
|
||||
// TODO Auto-generated method stub
|
||||
String str = super.getSummaryString();
|
||||
// String str = super.getSummaryString();
|
||||
String str = String.format("<html>%s<br>UID:%d, Database: %d<br>%s<br>",
|
||||
"GPS Data", getUID(), getDatabaseIndex(), PamCalendar.formatDBDateTime(getTimeMilliseconds(), true));
|
||||
if (gpsData != null) {
|
||||
str += gpsData.summaryString();
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double[] getFrequency() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -295,7 +295,8 @@ public class GpsLogger extends SQLLogging {
|
||||
* time from the UTC column which is NOT the GpsData time which was the real GPS time.
|
||||
*/
|
||||
int gpsIntTimeVal = gpsTime.getIntegerValue();
|
||||
Object ts = getTableDefinition().getTimeStampItem().getValue();
|
||||
PamTableDefinition pamTableDef = (PamTableDefinition) getTableDefinition();
|
||||
Object ts = pamTableDef.getTimeStampItem().getValue();
|
||||
long gpsDate = sqlTypes.millisFromTimeStamp(ts);
|
||||
if (gpsDate%1000 == 0) {
|
||||
// some databases may have stored the milliseconds, in which
|
||||
|
@ -17,6 +17,7 @@ import java.lang.reflect.Field;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PrivatePamParameterData;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamView.GroupedSourceParameters;
|
||||
|
||||
public class IshDetParams implements Serializable, Cloneable, ManagedParameters {
|
||||
@ -96,7 +97,7 @@ public class IshDetParams implements Serializable, Cloneable, ManagedParameters
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
try {
|
||||
Field field = this.getClass().getDeclaredField("inputDataSource");
|
||||
ps.put(new PrivatePamParameterData(this, field) {
|
||||
|
@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
||||
/**
|
||||
* Ishamel display parameters for the Spectrogram plug in.
|
||||
@ -42,7 +43,7 @@ public class IshDisplayParams implements Serializable, Cloneable, ManagedParamet
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -8,14 +8,13 @@ import java.sql.Types;
|
||||
|
||||
import PamguardMVC.PamDataBlock;
|
||||
import PamguardMVC.PamDataUnit;
|
||||
|
||||
import generalDatabase.EmptyTableDefinition;
|
||||
//import pamDatabase.SQLLogging;
|
||||
//import PamguardMVC.RecyclingDataBlock;
|
||||
import generalDatabase.PamDetectionLogging;
|
||||
|
||||
public class IshLogger extends PamDetectionLogging {
|
||||
IshDetControl ishDetControl;
|
||||
PamTableDefinition tableDefinition;
|
||||
PamTableItem systemDate, durationSecs, secSinceStart, peakHeight;
|
||||
// Peak is more important than start time for matched filter & spectrogram correlation
|
||||
PamTableItem peakSample, peakDelaySecs;
|
||||
@ -25,7 +24,7 @@ public class IshLogger extends PamDetectionLogging {
|
||||
super(pamDataBlock, UPDATE_POLICY_WRITENEW);
|
||||
this.ishDetControl = ishDetControl;
|
||||
|
||||
tableDefinition = getTableDefinition();
|
||||
EmptyTableDefinition tableDefinition = getTableDefinition();
|
||||
|
||||
// PamTableItem tableItem;
|
||||
// setUpdatePolicy(UPDATE_POLICY_WRITENEW);
|
||||
|
@ -14,14 +14,13 @@ import IshmaelDetector.IshDetection;
|
||||
import PamUtils.LatLong;
|
||||
import PamguardMVC.PamDataBlock;
|
||||
import PamguardMVC.PamDataUnit;
|
||||
|
||||
import generalDatabase.EmptyTableDefinition;
|
||||
//import pamDatabase.SQLLogging;
|
||||
//import PamguardMVC.RecyclingDataBlock;
|
||||
import generalDatabase.PamDetectionLogging;
|
||||
|
||||
public class IshLocSqlLogging extends PamDetectionLogging {
|
||||
IshLocControl ishLocControl;
|
||||
PamTableDefinition tableDefinition;
|
||||
PamTableItem systemDate, durationSecs, secSinceStart, peakHeight;
|
||||
private PamTableItem latitude, longitude, refLatitude, refLongitude, x, y, z;
|
||||
|
||||
@ -30,7 +29,7 @@ public class IshLocSqlLogging extends PamDetectionLogging {
|
||||
super(pamDataBlock, UPDATE_POLICY_WRITENEW);
|
||||
this.ishLocControl = ishDetControl;
|
||||
|
||||
tableDefinition = getTableDefinition();
|
||||
EmptyTableDefinition tableDefinition = getTableDefinition();
|
||||
tableDefinition.addTableItem(latitude = new PamTableItem("Latitude", Types.DOUBLE));
|
||||
tableDefinition.addTableItem(longitude = new PamTableItem("Longitude", Types.DOUBLE));
|
||||
tableDefinition.addTableItem(refLatitude = new PamTableItem("ReferenceLatitude", Types.DOUBLE));
|
||||
|
@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
||||
public class KernelSmoothingParameters implements Serializable, Cloneable, ManagedParameters {
|
||||
|
||||
@ -25,7 +26,7 @@ public class KernelSmoothingParameters implements Serializable, Cloneable, Manag
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import fftFilter.FFTFilterParams;
|
||||
|
||||
/**
|
||||
@ -157,7 +158,7 @@ public class DelayMeasurementParams implements Serializable, Cloneable, ManagedP
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
||||
public class MCMCParams2 implements Serializable, Cloneable, ManagedParameters {
|
||||
|
||||
@ -126,7 +127,7 @@ public class MCMCParams2 implements Serializable, Cloneable, ManagedParameters
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
||||
|
||||
public class MCMCParams implements Serializable, Cloneable, ManagedParameters {
|
||||
@ -64,7 +65,7 @@ public class MCMCParams implements Serializable, Cloneable, ManagedParameters {
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
||||
|
||||
/**
|
||||
@ -69,7 +70,7 @@ public class HyperbolicParams implements Serializable, Cloneable, ManagedParamet
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import Spectrogram.WindowFunction;
|
||||
|
||||
/**
|
||||
@ -104,7 +105,7 @@ public class RawOrFFTParams implements Serializable, Cloneable, RawOrFFTParamsIn
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,15 @@ public class GebcoMapFile implements MapFileManager {
|
||||
* @see Map.MapFile#readFileData(java.io.File)
|
||||
*/
|
||||
public boolean readFileData(File file) {
|
||||
return readMapFile(file, true);
|
||||
try {
|
||||
return readMapFile(file, true);
|
||||
}
|
||||
catch (Exception e) {
|
||||
// trap error someone reported at end November 22. Suspect it was their corrupt map file causing problems.
|
||||
String err = String.format("Map file %s is missing or corrupt and cannot be loaded", file.getName());
|
||||
WarnOnce.showWarning("Map File Error", err, WarnOnce.OK_OPTION);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean readMapFile(File gebcoFile, boolean readContours) {
|
||||
|
@ -7,6 +7,7 @@ import java.util.ListIterator;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
||||
/**
|
||||
* PArameters for MapDetectionsManager which
|
||||
@ -65,7 +66,7 @@ public class MapDetectionsParameters implements Serializable, Cloneable, Managed
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,7 @@ import java.lang.reflect.Field;
|
||||
import Array.Hydrophone;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamModel.parametermanager.PrivatePamParameterData;
|
||||
|
||||
public class MapParameters implements Serializable, Cloneable, ManagedParameters {
|
||||
@ -301,7 +302,7 @@ public class MapParameters implements Serializable, Cloneable, ManagedParameters
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -20,9 +20,15 @@
|
||||
*/
|
||||
package Map;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.awt.event.MouseMotionAdapter;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import GPS.GPSControl;
|
||||
import GPS.GPSDataBlock;
|
||||
import GPS.GpsDataUnit;
|
||||
import PamController.PamController;
|
||||
import PamUtils.Coordinate3d;
|
||||
import PamUtils.LatLong;
|
||||
import PamUtils.PamCoordinate;
|
||||
@ -385,6 +391,45 @@ public class MapRectProjector extends MapProjector {
|
||||
return xTrans;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHoverText(Point mousePoint, int ploNumberMatch) {
|
||||
String text = super.getHoverText(mousePoint, ploNumberMatch);
|
||||
if (text == null) {
|
||||
return findGpsTrackText(mousePoint, ploNumberMatch);
|
||||
}
|
||||
else {
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
private String findGpsTrackText(Point mousePoint, int ploNumberMatch) {
|
||||
GPSControl gpsControl = GPSControl.getGpsControl();
|
||||
if (gpsControl == null) {
|
||||
return null;
|
||||
}
|
||||
LatLong currentPos = getDataPosition(new Coordinate3d(mousePoint.x, mousePoint.y));
|
||||
GPSDataBlock gpsDataBlock = gpsControl.getGpsDataBlock();
|
||||
double dist = Double.MAX_VALUE;
|
||||
GpsDataUnit closest = null;
|
||||
ListIterator<GpsDataUnit> it = gpsDataBlock.getListIterator(0);
|
||||
while (it.hasNext()) {
|
||||
GpsDataUnit gpsUnit = it.next();
|
||||
double r = gpsUnit.getGpsData().distanceToMetres(currentPos);
|
||||
if (r < dist) {
|
||||
dist = r;
|
||||
closest = gpsUnit;
|
||||
}
|
||||
}
|
||||
if (closest == null) {
|
||||
return null;
|
||||
}
|
||||
double rPix = dist*this.pixelsPerMetre;
|
||||
if (rPix > 20) {
|
||||
return null;
|
||||
}
|
||||
return closest.getSummaryString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
||||
public class GridbaseParameters implements Cloneable, Serializable, ManagedParameters {
|
||||
|
||||
@ -25,7 +26,7 @@ public class GridbaseParameters implements Cloneable, Serializable, ManagedParam
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,7 @@ import java.io.Serializable;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import serialComms.jserialcomm.PJSerialComm;
|
||||
|
||||
public class NMEAParameters implements Serializable, Cloneable, ManagedParameters {
|
||||
@ -149,7 +150,7 @@ public class NMEAParameters implements Serializable, Cloneable, ManagedParameter
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -33,6 +33,13 @@ public interface OfflineDataStore {
|
||||
*/
|
||||
public String getDataSourceName();
|
||||
|
||||
/**
|
||||
* Get the data location. This may be a specific file, or might be a folder
|
||||
* if data are in many files, a URI, etc.
|
||||
* @return store locations
|
||||
*/
|
||||
public String getDataLocation();
|
||||
|
||||
/**
|
||||
* Load data for a given datablock between two time limits.
|
||||
* @param dataBlock datablock owner of the data
|
||||
|
@ -23,6 +23,7 @@ package PamController;
|
||||
import java.awt.Component;
|
||||
import java.awt.Frame;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JMenu;
|
||||
@ -39,7 +40,9 @@ import org.w3c.dom.Element;
|
||||
import PamController.status.ModuleStatus;
|
||||
import PamController.status.ModuleStatusManager;
|
||||
import PamController.status.ProcessCheck;
|
||||
import PamModel.PamModel;
|
||||
import PamModel.PamModuleInfo;
|
||||
import PamModel.PamPluginInterface;
|
||||
import PamView.ClipboardCopier;
|
||||
import PamView.PamGui;
|
||||
import PamView.PamSidePanel;
|
||||
@ -881,6 +884,23 @@ public abstract class PamControlledUnit implements SettingsNameProvider {
|
||||
return instanceIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get detail if this is a plugin.
|
||||
* @return plugin detail, or null if it's not a plugin.
|
||||
*/
|
||||
public PamPluginInterface getPlugin() {
|
||||
List<PamPluginInterface> pluginList = ((PamModel) PamController.getInstance().getModelInterface()).getPluginList();
|
||||
if (pluginList == null) {
|
||||
return null;
|
||||
}
|
||||
for (PamPluginInterface plugin : pluginList) {
|
||||
if (plugin.getClassName().equals(this.getClass().getName())) {
|
||||
return plugin;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The PamConfiguration holds the master list of modules which form part of a
|
||||
* configuration. It should be accessed to find list of datablocks, etc. rather than
|
||||
|
@ -36,6 +36,7 @@ import org.apache.commons.io.input.ClassLoaderObjectInputStream;
|
||||
import PamModel.PamModel;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamView.dialog.warn.WarnOnce;
|
||||
|
||||
|
||||
@ -398,7 +399,7 @@ public class PamControlledUnitSettings implements Serializable, ManagedParameter
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -57,6 +57,7 @@ import fftManager.FFTDataUnit;
|
||||
import generalDatabase.DBControlUnit;
|
||||
import javafx.application.Platform;
|
||||
import javafx.stage.Stage;
|
||||
import metadata.MetaDataContol;
|
||||
import Array.ArrayManager;
|
||||
import PamController.command.MulticastController;
|
||||
import PamController.command.NetworkController;
|
||||
@ -452,6 +453,7 @@ public class PamController implements PamControllerInterface, PamSettings {
|
||||
System.out.println("");
|
||||
System.out.println("Note - ignore the following SLF4J warn/error messages, they are not applicable to this application");
|
||||
ArrayManager.getArrayManager(); // create the array manager so that it get's it's settings
|
||||
MetaDataContol.getMetaDataControl();
|
||||
|
||||
/**
|
||||
* Check for archived files and unpack automatically.
|
||||
@ -1161,6 +1163,8 @@ public class PamController implements PamControllerInterface, PamSettings {
|
||||
}
|
||||
|
||||
if (saveSettings) {
|
||||
startTime = PamCalendar.getSessionStartTime();
|
||||
// System.out.printf("Saving settings for start time %s\n", PamCalendar.formatDBDateTime(startTime));
|
||||
saveSettings(PamCalendar.getSessionStartTime());
|
||||
}
|
||||
|
||||
@ -1319,6 +1323,9 @@ public class PamController implements PamControllerInterface, PamSettings {
|
||||
}
|
||||
guiFrameManager.pamEnded();
|
||||
|
||||
long stopTime = PamCalendar.getTimeInMillis();
|
||||
saveEndSettings(stopTime);
|
||||
|
||||
// no good having this here since it get's called at the end of every file.
|
||||
// if (GlobalArguments.getParam(PamController.AUTOEXIT) != null) {
|
||||
//// can exit here, since we've auto started, can auto exit.
|
||||
@ -1437,6 +1444,26 @@ public class PamController implements PamControllerInterface, PamSettings {
|
||||
pamConfiguration.saveSettings(timeNow);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets called in pamStart and may / will attempt to store all
|
||||
* PAMGUARD settings via the database and binary storage modules.
|
||||
*/
|
||||
private void saveEndSettings(long timeNow) {
|
||||
// System.out.printf("Updating settings with end time %s\n", PamCalendar.formatDBDateTime(timeNow));
|
||||
ArrayList<PamControlledUnit> pamControlledUnits = pamConfiguration.getPamControlledUnits();
|
||||
PamControlledUnit pcu;
|
||||
PamSettingsSource settingsSource;
|
||||
for (int iU = 0; iU < pamControlledUnits.size(); iU++) {
|
||||
pcu = pamControlledUnits.get(iU);
|
||||
if (PamSettingsSource.class.isAssignableFrom(pcu.getClass())) {
|
||||
settingsSource = (PamSettingsSource) pcu;
|
||||
settingsSource.saveEndSettings(timeNow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Export configuration into an XML file
|
||||
* @param parentFrame
|
||||
@ -2407,7 +2434,7 @@ public class PamController implements PamControllerInterface, PamSettings {
|
||||
if (dbc == null) {
|
||||
return null;
|
||||
}
|
||||
return dbc.getDatabaseName();
|
||||
return dbc.getLongDatabaseName();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
20
src/PamController/PamSensor.java
Normal file
20
src/PamController/PamSensor.java
Normal file
@ -0,0 +1,20 @@
|
||||
package PamController;
|
||||
|
||||
/**
|
||||
* Interface to define modules which can be considered as sensors of some sort.
|
||||
* e.g. depth and orientation modules and the SoundTrap clickdetecotr
|
||||
* @author dg50
|
||||
*
|
||||
*/
|
||||
public interface PamSensor {
|
||||
|
||||
public String getUnitName();
|
||||
|
||||
public String getUnitType();
|
||||
|
||||
public String getSensorDescription();
|
||||
|
||||
public String getSensorId();
|
||||
|
||||
|
||||
}
|
@ -476,7 +476,7 @@ public class PamSettingManager {
|
||||
*/
|
||||
public PamSettings findSettingsOwner(String unitType, String unitName, String unitClassName) {
|
||||
for (PamSettings owner:owners) {
|
||||
if (owner.getClass() != null) {
|
||||
if (owner.getClass() != null && unitClassName != null) {
|
||||
if (owner.getClass().getName().equals(unitClassName) == false) {
|
||||
continue;
|
||||
}
|
||||
|
@ -20,6 +20,14 @@ public interface PamSettingsSource {
|
||||
*/
|
||||
public boolean saveStartSettings(long timeNow);
|
||||
|
||||
/**
|
||||
* Save settings when processing ends.
|
||||
* This may just be an update of the settings saves with saveStartSettings, e.g. an end time.
|
||||
* @param timeNow
|
||||
* @return true if saved correctly.
|
||||
*/
|
||||
public boolean saveEndSettings(long timeNow);
|
||||
|
||||
/**
|
||||
* Get the number of different settings
|
||||
* within the settings source.
|
||||
|
@ -31,7 +31,7 @@ public class PamguardVersionInfo {
|
||||
* Version number, major version.minorversion.sub-release.
|
||||
* Note: can't go higher than sub-release 'f'
|
||||
*/
|
||||
static public final String version = "2.02.09e";
|
||||
static public final String version = "2.02.09f";
|
||||
|
||||
/**
|
||||
* Release date
|
||||
|
@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
||||
/**
|
||||
* Very simple class used in an ArrayList of used modules that
|
||||
@ -54,8 +55,16 @@ public class UsedModuleInfo implements Serializable, ManagedParameters {
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
return ps;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the unit name of the module being imported.
|
||||
* @return
|
||||
*/
|
||||
public String getUnitName() {
|
||||
return unitName;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -116,14 +116,16 @@ public class SettingsImport {
|
||||
*/
|
||||
private PamControlledUnit importReplace(SettingsImportGroup importGroup, String replaceModule) {
|
||||
PamControlledUnitSettings mainSet = importGroup.getMainSettings();
|
||||
PamControlledUnit unit = PamController.getInstance().findControlledUnit(mainSet.getUnitType(), replaceModule);
|
||||
UsedModuleInfo importInfo = importGroup.getUsedModuleInfo();
|
||||
PamControlledUnit unit = PamController.getInstance().findControlledUnit(importInfo.getUnitType(), replaceModule);
|
||||
if (unit == null) {
|
||||
System.out.println("Unable to find " + mainSet.getUnitType() + " " + mainSet.getUnitName() + " for settings replacement");
|
||||
System.out.println("Unable to find " + importInfo.getUnitType() + " " + importInfo.getUnitName() + " for settings replacement");
|
||||
return null;
|
||||
}
|
||||
// check we can cast it to PamSettings
|
||||
if (PamSettings.class.isAssignableFrom(unit.getClass())) {
|
||||
if (PamSettings.class.isAssignableFrom(unit.getClass()) && mainSet != null) {
|
||||
try {
|
||||
mainSet.setUnitName(replaceModule);
|
||||
((PamSettings) unit).restoreSettings(mainSet);
|
||||
}
|
||||
catch (Exception e) {
|
||||
@ -132,7 +134,7 @@ public class SettingsImport {
|
||||
System.err.println(e.getMessage());
|
||||
}
|
||||
}
|
||||
loadSubUnitSettings(importGroup, mainSet.getUnitName());
|
||||
loadSubUnitSettings(importGroup, replaceModule);
|
||||
return unit;
|
||||
}
|
||||
|
||||
@ -149,7 +151,15 @@ public class SettingsImport {
|
||||
}
|
||||
PamSettingManager setManager = PamSettingManager.getInstance();
|
||||
for (PamControlledUnitSettings pamSettings:subSets) {
|
||||
PamSettings owner = setManager.findSettingsOwner(pamSettings.getUnitType(), unitName, pamSettings.getOwnerClassName());
|
||||
/*
|
||||
* class name in pamSettings is no longer correct, so cannot use pamSettings.getOwnerClassName().
|
||||
* but the classnames of all the sub modules are unknown (and will be different form the unit class name
|
||||
* which can be got from importGroup.getPamModuleInfo().getClassName
|
||||
* so will have to do this only on the unit type and name and hope for no conflicts (catch exception).
|
||||
*/
|
||||
// PamModuleInfo moduleInfo = importGroup.getPamModuleInfo();
|
||||
// String className = moduleInfo.getClassName();
|
||||
PamSettings owner = setManager.findSettingsOwner(pamSettings.getUnitType(), unitName, null);
|
||||
if (owner == null) {
|
||||
System.out.println(String.format("Cannot find settings owner for %s %s in current model", pamSettings.getUnitType(), unitName));
|
||||
continue;
|
||||
@ -168,7 +178,8 @@ public class SettingsImport {
|
||||
|
||||
private PamControlledUnit importNew(SettingsImportGroup importGroup) {
|
||||
PamControlledUnitSettings mainSet = importGroup.getMainSettings();
|
||||
String moduleName = mainSet.getUnitName();
|
||||
UsedModuleInfo importInfo = importGroup.getUsedModuleInfo();
|
||||
String moduleName = importInfo.unitName;
|
||||
|
||||
// check we've got a name that doesnt' exist and replace it if if does.
|
||||
// int startChar = 0;
|
||||
@ -199,11 +210,11 @@ public class SettingsImport {
|
||||
|
||||
PamControlledUnit unit = PamController.getInstance().addModule(PamController.getMainFrame(), moduleInfo);
|
||||
if (unit == null) {
|
||||
System.out.println("Unable to find " + mainSet.getUnitType() + " " + mainSet.getUnitName() + " for settings replacement");
|
||||
System.out.println("Unable to find " + importInfo.getUnitType() + " " + importInfo.getUnitName() + " for settings replacement");
|
||||
return null;
|
||||
}
|
||||
// check we can cast it to PamSettings
|
||||
if (PamSettings.class.isAssignableFrom(unit.getClass())) {
|
||||
if (PamSettings.class.isAssignableFrom(unit.getClass()) && mainSet != null) {
|
||||
try {
|
||||
mainSet.setUnitName(unit.getUnitName()); // need to force the unit name for some modules.
|
||||
((PamSettings) unit).restoreSettings(mainSet);
|
||||
|
@ -195,12 +195,14 @@ public class SettingsImportDialog extends PamDialog {
|
||||
@Override
|
||||
public Object getValueAt(int rowIndex, int columnIndex) {
|
||||
SettingsImportGroup set = groupedSettings.get(rowIndex);
|
||||
PamControlledUnitSettings mainSet = set.getMainSettings();
|
||||
// PamControlledUnitSettings mainSet = set.getMainSettings();
|
||||
switch (columnIndex) {
|
||||
case 0:
|
||||
return mainSet.getUnitType();
|
||||
return set.getUsedModuleInfo().getUnitType();
|
||||
// return mainSet.getUnitType();
|
||||
case 1:
|
||||
return mainSet.getUnitName();
|
||||
return set.getUsedModuleInfo().unitName;
|
||||
// return mainSet.getUnitName();
|
||||
case 2:
|
||||
// return choiceBoxes[rowIndex].getSelectedItem().toString();
|
||||
return set.getImportChoice().toString();
|
||||
|
@ -82,8 +82,10 @@ public class SettingsImportGroup {
|
||||
try {
|
||||
ownerClass = Class.forName(usedModuleInfo.className);
|
||||
} catch (ClassNotFoundException e) {
|
||||
|
||||
System.out.println("Unknown class in loaded settings: " + usedModuleInfo.className);
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
// e.printStackTrace();
|
||||
}
|
||||
ArrayList<PamControlledUnit> existingModules =
|
||||
PamController.getInstance().findControlledUnits(ownerClass);
|
||||
|
@ -29,6 +29,7 @@ import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
|
||||
import com.sun.javafx.runtime.VersionInfo;
|
||||
|
||||
@ -42,12 +43,14 @@ import PamController.PamguardVersionInfo;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterData;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamUtils.PamCalendar;
|
||||
import PamUtils.XMLUtils;
|
||||
import PamguardMVC.PamDataBlock;
|
||||
import PamguardMVC.PamDataUnit;
|
||||
import PamguardMVC.PamProcess;
|
||||
import binaryFileStorage.BinaryStore;
|
||||
import tethys.TethysControl;
|
||||
|
||||
/**
|
||||
* Class for writing XML configuration output to a file.
|
||||
@ -62,6 +65,8 @@ public class PamguardXMLWriter implements PamSettings {
|
||||
private static final Set<Class<?>> WRAPPER_TYPES = getWrapperTypes();
|
||||
|
||||
private XMLWriterSettings writerSettings = new XMLWriterSettings();
|
||||
private boolean excludeDisplaySettings;
|
||||
// private String xmlNameSpace;
|
||||
|
||||
private static PamguardXMLWriter singleInstance;
|
||||
|
||||
@ -84,6 +89,19 @@ public class PamguardXMLWriter implements PamSettings {
|
||||
return singleInstance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively walk the tree and add a namespace to every
|
||||
* single element.
|
||||
* @param doc
|
||||
* @param nameSpace
|
||||
* @return
|
||||
*/
|
||||
public boolean addNameSpaceToElements(Document doc, Element el, String nameSpace) {
|
||||
// el.setAttributeNS(nameSpace, nameSpace, nameSpace);
|
||||
NamedNodeMap attributes = el.getAttributes();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a document with the options specified in writerSettings.
|
||||
* @param time timestamp for document
|
||||
@ -371,6 +389,32 @@ public class PamguardXMLWriter implements PamSettings {
|
||||
* @return xml content as a a string.
|
||||
*/
|
||||
public String getAsString(Document doc) {
|
||||
return getAsString(doc, true);
|
||||
// try {
|
||||
// DOMSource domSource = new DOMSource(doc);
|
||||
// StringWriter writer = new StringWriter();
|
||||
// StreamResult result = new StreamResult(writer);
|
||||
// TransformerFactory tf = TransformerFactory.newInstance();
|
||||
// Transformer transformer = tf.newTransformer();
|
||||
// transformer.setOutputProperty(OutputKeys.METHOD, "xml");
|
||||
// transformer.setOutputProperty(OutputKeys.ENCODING, "ISO-8859-1");
|
||||
//// transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
|
||||
// transformer.setOutputProperty(OutputKeys.INDENT, "yes");
|
||||
// transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
|
||||
// transformer.transform(domSource, result);
|
||||
// return writer.toString();
|
||||
// } catch (TransformerException e) {
|
||||
// e.printStackTrace();
|
||||
// return null;
|
||||
// }
|
||||
}
|
||||
/**
|
||||
* Get the xml document as a String.
|
||||
* @param doc xml document
|
||||
* @param indent Indent / format the document.
|
||||
* @return xml content as a a string.
|
||||
*/
|
||||
public String getAsString(Document doc, boolean indent) {
|
||||
try {
|
||||
DOMSource domSource = new DOMSource(doc);
|
||||
StringWriter writer = new StringWriter();
|
||||
@ -380,7 +424,7 @@ public class PamguardXMLWriter implements PamSettings {
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml");
|
||||
transformer.setOutputProperty(OutputKeys.ENCODING, "ISO-8859-1");
|
||||
// transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, indent ? "yes" : "no");
|
||||
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
|
||||
transformer.transform(domSource, result);
|
||||
return writer.toString();
|
||||
@ -411,8 +455,7 @@ public class PamguardXMLWriter implements PamSettings {
|
||||
* @param pamSettingsUnit
|
||||
* @return xml element
|
||||
*/
|
||||
private Element writeUnitSettings(Document doc, Element parent, PamSettings pamSettingsUnit) {
|
||||
|
||||
public Element writeUnitSettings(Document doc, Element parent, PamSettings pamSettingsUnit) {
|
||||
int[] settingInds = findSettings(null, pamSettingsUnit.getUnitName());
|
||||
PamSettings[] settingsObjects = null;
|
||||
if (settingInds != null) {
|
||||
@ -436,7 +479,7 @@ public class PamguardXMLWriter implements PamSettings {
|
||||
* can be temporary settings objects when writing temporary settings from dialogs.
|
||||
* @return new XML element.
|
||||
*/
|
||||
private Element writeUnitSettings(Document doc, Element parent, PamSettings pamSettingsUnit, PamSettings[] toWrite) {
|
||||
public Element writeUnitSettings(Document doc, Element parent, PamSettings pamSettingsUnit, PamSettings[] toWrite) {
|
||||
Element moduleData = doc.createElement("MODULE");
|
||||
moduleData.setAttribute("Java.class", pamSettingsUnit.getClass().getName());
|
||||
moduleData.setAttribute("UnitType", pamSettingsUnit.getUnitType());
|
||||
@ -457,6 +500,9 @@ public class PamguardXMLWriter implements PamSettings {
|
||||
Element settingEl = doc.createElement("CONFIGURATION");
|
||||
moduleData.appendChild(settingEl);
|
||||
for (int i = 0; i < toWrite.length; i++) {
|
||||
if (wantObject(toWrite[i]) == false) {
|
||||
continue;
|
||||
}
|
||||
Element setEl = writeSettings(doc, toWrite[i], new ArrayList<Object>());
|
||||
if (setEl != null) {
|
||||
settingEl.appendChild(setEl);
|
||||
@ -467,6 +513,32 @@ public class PamguardXMLWriter implements PamSettings {
|
||||
return moduleData;
|
||||
}
|
||||
|
||||
/**
|
||||
* USed by the Tethys writer to avoid writing display settings.
|
||||
* @param pamSettings
|
||||
* @return
|
||||
*/
|
||||
private boolean wantObject(PamSettings pamSettings) {
|
||||
if (excludeDisplaySettings == false) {
|
||||
return true;
|
||||
}
|
||||
Object obj = pamSettings.getSettingsReference();
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (obj instanceof ManagedParameters) {
|
||||
ManagedParameters managedParams = (ManagedParameters) obj;
|
||||
PamParameterSet paramSet = managedParams.getParameterSet();
|
||||
if (paramSet == null) {
|
||||
return false;
|
||||
}
|
||||
if (paramSet.getParameterSetType() == ParameterSetType.DISPLAY && excludeDisplaySettings) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Write settings for a settings object, using the standard retreived object
|
||||
* from the settings.
|
||||
@ -479,6 +551,14 @@ public class PamguardXMLWriter implements PamSettings {
|
||||
return writeSettings(doc, pamSettings, pamSettings.getSettingsReference(), objectHierarchy);
|
||||
}
|
||||
|
||||
public Document writeOneObject(Object data) {
|
||||
Document doc = XMLUtils.createBlankDoc();
|
||||
Element el = doc.createElement("Settings");
|
||||
Element newel = writeObjectData(doc, el, data, new ArrayList<Object>());
|
||||
doc.appendChild(newel);
|
||||
return doc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Write settings using an object of choice instead of the standard one from PamSettings.
|
||||
* <br> can be useful in saving specific parameters.
|
||||
@ -489,6 +569,7 @@ public class PamguardXMLWriter implements PamSettings {
|
||||
* @return
|
||||
*/
|
||||
private Element writeSettings(Document doc, PamSettings pamSettings, Object data, ArrayList<Object> objectHierarchy) {
|
||||
|
||||
Element el = doc.createElement("SETTINGS");
|
||||
el.setAttribute("Type", pamSettings.getUnitType());
|
||||
el.setAttribute("Name", pamSettings.getUnitName());
|
||||
@ -500,10 +581,13 @@ public class PamguardXMLWriter implements PamSettings {
|
||||
return el;
|
||||
}
|
||||
|
||||
private Element writeObjectData(Document doc, Element el, Object data, ArrayList<Object> objectHierarchy) {
|
||||
public Element writeObjectData(Document doc, Element el, Object data, ArrayList<Object> objectHierarchy) {
|
||||
if (data == null) {
|
||||
return null;
|
||||
}
|
||||
if (objectHierarchy == null) {
|
||||
objectHierarchy = new ArrayList<>();
|
||||
}
|
||||
if (objectHierarchy.contains(data)) {
|
||||
// just write the reference, but nothing else or we'll end up in an infinite loop of objects.
|
||||
Element e = doc.createElement("Object");
|
||||
@ -526,7 +610,9 @@ public class PamguardXMLWriter implements PamSettings {
|
||||
return null;
|
||||
}
|
||||
|
||||
objectHierarchy.add(data);
|
||||
if (objectHierarchy != null) {
|
||||
objectHierarchy.add(data);
|
||||
}
|
||||
for (PamParameterData pamParam:parameterSet.getParameterCollection()) {
|
||||
try {
|
||||
Object paramData = pamParam.getData();
|
||||
@ -765,9 +851,10 @@ public class PamguardXMLWriter implements PamSettings {
|
||||
processData.setAttribute("Name", process.getProcessName());
|
||||
PamDataBlock source = process.getParentDataBlock();
|
||||
if (source != null) {
|
||||
Element inputEl = doc.createElement("Input");
|
||||
inputEl.setAttribute("Name", source.getLongDataName());
|
||||
inputEl.setAttribute("Channels", String.format("0x%X", source.getChannelMap()));
|
||||
Element inputEl = source.getDataBlockXML(doc);
|
||||
// Element inputEl = doc.createElement("Input");
|
||||
// inputEl.setAttribute("Name", source.getLongDataName());
|
||||
// inputEl.setAttribute("Channels", String.format("0x%X", source.getChannelMap()));
|
||||
processData.appendChild(inputEl);
|
||||
}
|
||||
int nOut = process.getNumOutputDataBlocks();
|
||||
@ -798,7 +885,16 @@ public class PamguardXMLWriter implements PamSettings {
|
||||
*/
|
||||
private int[] findSettings(String type, String name) {
|
||||
if (settingsSets == null) {
|
||||
return null;
|
||||
makeSettingsList();
|
||||
if (settingsSets == null) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (usedSettingsSets == null) {
|
||||
usedSettingsSets = new boolean[settingsSets.size()];
|
||||
}
|
||||
else if (usedSettingsSets.length < settingsSets.size()) {
|
||||
usedSettingsSets = Arrays.copyOf(usedSettingsSets, settingsSets.size());
|
||||
}
|
||||
int[] found = new int[settingsSets.size()];
|
||||
int nFound = 0;
|
||||
@ -818,7 +914,7 @@ public class PamguardXMLWriter implements PamSettings {
|
||||
return Arrays.copyOf(found, nFound);
|
||||
}
|
||||
|
||||
private ArrayList<PamSettings> makeSettingsList() {
|
||||
public ArrayList<PamSettings> makeSettingsList() {
|
||||
PamSettingManager settingsManager = PamSettingManager.getInstance();
|
||||
settingsSets = settingsManager.getOwners();
|
||||
if (settingsSets == null) {
|
||||
@ -850,6 +946,14 @@ public class PamguardXMLWriter implements PamSettings {
|
||||
return doc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this element a writable type ? Basically, this means
|
||||
* that it's a primitive of some sort. Otherwise it's
|
||||
* probably an object and may even be a list in which case
|
||||
* it will need treating differently.
|
||||
* @param clazz
|
||||
* @return
|
||||
*/
|
||||
public static boolean isWritableType(Class<?> clazz)
|
||||
{
|
||||
if (clazz.isEnum()) return true;
|
||||
@ -940,5 +1044,23 @@ public class PamguardXMLWriter implements PamSettings {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the excludeDisplaySettings
|
||||
*/
|
||||
public boolean isExcludeDisplaySettings() {
|
||||
return excludeDisplaySettings;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param excludeDisplaySettings the excludeDisplaySettings to set
|
||||
*/
|
||||
public void setExcludeDisplaySettings(boolean excludeDisplaySettings) {
|
||||
this.excludeDisplaySettings = excludeDisplaySettings;
|
||||
}
|
||||
|
||||
// public void setStaticNameSpace(String xmlNameSpace) {
|
||||
// this.xmlNameSpace = xmlNameSpace;
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
||||
public class XMLWriterSettings implements Serializable, Cloneable, ManagedParameters {
|
||||
|
||||
@ -34,7 +35,7 @@ public class XMLWriterSettings implements Serializable, Cloneable, ManagedParame
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@ import java.io.Serializable;
|
||||
import PamController.soundMedium.GlobalMedium.SoundMedium;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
||||
/**
|
||||
* Stores parameters for the current medium.
|
||||
@ -41,7 +42,7 @@ public class GlobalMediumParams implements Serializable, Cloneable, ManagedParam
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -44,11 +44,15 @@ import whistlesAndMoans.AbstractWhistleDataUnit;
|
||||
import fftManager.FFTDataUnit;
|
||||
import fftManager.PamFFTControl;
|
||||
import group3dlocaliser.Group3DLocaliserControl;
|
||||
import metadata.MetaDataContol;
|
||||
import meygenturbine.MeygenTurbine;
|
||||
import printscreen.PrintScreenControl;
|
||||
import rockBlock.RockBlockControl;
|
||||
import tethys.TethysControl;
|
||||
import turbineops.TurbineOperationControl;
|
||||
import GPS.GpsDataUnit;
|
||||
import Map.MapController;
|
||||
import Map.gridbaselayer.GridbaseControl;
|
||||
import NMEA.NMEADataUnit;
|
||||
import PamController.PamControlledUnitSettings;
|
||||
import PamController.PamController;
|
||||
@ -62,6 +66,7 @@ import PamguardMVC.PamDataBlock;
|
||||
import analogarraysensor.ArraySensorControl;
|
||||
import backupmanager.BackupManager;
|
||||
import beamformer.continuous.BeamFormerControl;
|
||||
import beamformer.localiser.BeamFormLocaliserControl;
|
||||
import bearinglocaliser.BearingLocaliserControl;
|
||||
import binaryFileStorage.SecondaryBinaryStore;
|
||||
import cepstrum.CepstrumControl;
|
||||
@ -455,6 +460,19 @@ final public class PamModel implements PamSettings {
|
||||
mi.setModulesMenuGroup(utilitiesGroup);
|
||||
mi.setMaxNumber(1);
|
||||
|
||||
|
||||
// mi = PamModuleInfo.registerControlledUnit(MetaDataContol.class.getName(), MetaDataContol.unitType);
|
||||
// mi.setToolTipText("Project Meta Data");
|
||||
// mi.setModulesMenuGroup(utilitiesGroup);
|
||||
// mi.setMaxNumber(1);
|
||||
|
||||
if (isViewer) {
|
||||
mi = PamModuleInfo.registerControlledUnit(TethysControl.class.getName(), TethysControl.defaultName);
|
||||
mi.setToolTipText("Interface to Tethys Database");
|
||||
mi.setModulesMenuGroup(utilitiesGroup);
|
||||
mi.setMaxNumber(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* ************* End Utilities Group *******************
|
||||
*/
|
||||
@ -1077,6 +1095,8 @@ final public class PamModel implements PamSettings {
|
||||
* PamModel !
|
||||
*/
|
||||
|
||||
// pluginList.add(new MorlaisWP1aPlugin());
|
||||
|
||||
// Load up whatever default classloader was used to create this class. Must use the same classloader
|
||||
// for all plugins, or else we will not be able to create proper dependencies between them or be able
|
||||
// to save properties in the psf file. Found this problem because ipiDemo requires the
|
||||
@ -1143,11 +1163,30 @@ final public class PamModel implements PamSettings {
|
||||
// to add that URL to the default classloader path.
|
||||
URL newURL = jarList.get(i).toURI().toURL();
|
||||
|
||||
// original method
|
||||
// Method method = URLClassLoader.class.getDeclaredMethod("addURL", URL.class);
|
||||
// method.setAccessible(true);
|
||||
// method.invoke(cl, newURL);
|
||||
|
||||
// first fix attempt - create a brand new URLClassLoader. As expected, we get a ClassCastException when trying
|
||||
// to load the parameters so we can't save params using this method
|
||||
// URL[] newURLArray = new URL[1];
|
||||
// newURLArray[0] = newURL;
|
||||
// cl = new URLClassLoader(newURLArray);
|
||||
|
||||
// second attempt - custom class loader with the system app loader specified as the parent. Loads controlled unit, but
|
||||
// as before it doesn't load the parameters
|
||||
classLoader.addURL(newURL);
|
||||
|
||||
// third attempt
|
||||
// Class<?> genericClass = cl.getClass();
|
||||
// Method method = genericClass.getSuperclass().getDeclaredMethod("addURL", new Class[] {URL.class});
|
||||
// method.setAccessible(true);
|
||||
// method.invoke(cl, new Object[] {newURL});
|
||||
|
||||
|
||||
|
||||
|
||||
// Save the name of the class to the global pluginBeingLoaded variable, and load the class.
|
||||
this.setPluginBeingLoaded(className);
|
||||
// Class c = cl.loadClass(className);
|
||||
@ -1228,8 +1267,9 @@ final public class PamModel implements PamSettings {
|
||||
"for help.<p>" +
|
||||
"This plug-in will not be available for loading";
|
||||
String help = null;
|
||||
int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.WARNING_MESSAGE, help, e1);
|
||||
int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help, e1);
|
||||
System.err.println("Exception while loading " + className);
|
||||
System.err.println(e1.getMessage());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -1242,7 +1282,7 @@ final public class PamModel implements PamSettings {
|
||||
"for help.<p>" +
|
||||
"This plug-in will not be available for loading";
|
||||
String help = null;
|
||||
int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.WARNING_MESSAGE, help, ex);
|
||||
int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help, ex);
|
||||
System.err.println("Exception while loading " + jarList.get(i).getName());
|
||||
continue;
|
||||
}
|
||||
@ -1267,7 +1307,7 @@ final public class PamModel implements PamSettings {
|
||||
|
||||
// instantiate the plugin control class using the custom class loader
|
||||
try {
|
||||
// File classFile = new File(pf.getJarFile());
|
||||
File classFile = new File(pf.getJarFile());
|
||||
//URLClassLoader cl = new URLClassLoader(new URL[]{classFile.toURI().toURL()});
|
||||
// mi = PamModuleInfo.registerControlledUnit(pf.getClassName(), pf.getDescription(),cl);
|
||||
mi = PamModuleInfo.registerControlledUnit(pf.getClassName(), pf.getDescription(),classLoader);
|
||||
@ -1333,7 +1373,7 @@ final public class PamModel implements PamSettings {
|
||||
"for help.<p>" +
|
||||
"This plug-in will not be available for loading";
|
||||
String help = null;
|
||||
int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.WARNING_MESSAGE, help, e1);
|
||||
int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help, e1);
|
||||
System.err.println("Exception while loading " + pf.getDefaultName());
|
||||
pluginList.remove(pf);
|
||||
continue;
|
||||
|
@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
||||
public class PamModelSettings implements Cloneable, Serializable, ManagedParameters {
|
||||
|
||||
@ -74,7 +75,7 @@ public class PamModelSettings implements Cloneable, Serializable, ManagedParamet
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,11 @@ abstract public class PamParameterData {
|
||||
*/
|
||||
private String postTitle;
|
||||
|
||||
/**
|
||||
* field length for automatic dialogs.
|
||||
*/
|
||||
private int fieldLength;
|
||||
|
||||
|
||||
/**
|
||||
* @param parentObject
|
||||
@ -45,6 +50,21 @@ abstract public class PamParameterData {
|
||||
this.field = field;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param parentObject
|
||||
* @param field
|
||||
* @param shortName
|
||||
* @param toolTip
|
||||
* @param fieldLength length of text in automatic dialogs.
|
||||
*/
|
||||
public PamParameterData(Object parentObject, Field field, String shortName, String toolTip, int fieldLength) {
|
||||
super();
|
||||
this.field = field;
|
||||
this.shortName = shortName;
|
||||
this.toolTip = toolTip;
|
||||
this.fieldLength = fieldLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param parentObject
|
||||
* @param field
|
||||
@ -58,7 +78,6 @@ abstract public class PamParameterData {
|
||||
this.toolTip = toolTip;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param shortName the shortName to set
|
||||
*/
|
||||
@ -66,6 +85,20 @@ abstract public class PamParameterData {
|
||||
this.shortName = shortName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set info about a parameter
|
||||
* @param shortName short name, e.g. to use in a dialog
|
||||
* @param postTitle post title, e.g. text coming after a data entry field in a dialog
|
||||
* @param toolTip tool tip to display over the component in a dialog.
|
||||
* @param fieldLength length of text in automatic dialogs.
|
||||
*/
|
||||
public void setInfo(String shortName, String postTitle, String toolTip, int fieldLength) {
|
||||
this.shortName = shortName;
|
||||
this.postTitle = postTitle;
|
||||
this.toolTip = toolTip;
|
||||
this.fieldLength = fieldLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set info about a parameter
|
||||
* @param shortName short name, e.g. to use in a dialog
|
||||
@ -136,6 +169,9 @@ abstract public class PamParameterData {
|
||||
* @return a short name for the field, suitable for use in dialogs.
|
||||
*/
|
||||
public String getShortName() {
|
||||
if (shortName == null) {
|
||||
return getFieldName();
|
||||
}
|
||||
return shortName;
|
||||
}
|
||||
|
||||
@ -166,5 +202,19 @@ abstract public class PamParameterData {
|
||||
return String.format("Param %s class %s", getFieldName(), getDataClass());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the fieldLength
|
||||
*/
|
||||
public int getFieldLength() {
|
||||
return fieldLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param fieldLength the fieldLength to set
|
||||
*/
|
||||
public void setFieldLength(int fieldLength) {
|
||||
this.fieldLength = fieldLength;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -59,9 +59,12 @@ public class PamParameterDataGetter extends PrivatePamParameterData {
|
||||
if (setter == null) {
|
||||
return false;
|
||||
}
|
||||
// need to convert the type
|
||||
Object convObj = convertStringType(data);
|
||||
try {
|
||||
setter.invoke(getParentObject(), data);
|
||||
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
|
||||
Object parentObj = getParentObject();
|
||||
setter.invoke(parentObj, convObj);
|
||||
} catch (InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
|
@ -29,6 +29,9 @@ public class PamParameterSet {
|
||||
|
||||
private static boolean printDebug = false;
|
||||
|
||||
public enum ParameterSetType {DETECTOR, DISPLAY};
|
||||
|
||||
private ParameterSetType parameterSetType;
|
||||
/**
|
||||
* Standard modifiers to exclude. This is important for many classes which will tend to
|
||||
* do crazy things such as incorporate ALL of their final fields, e.g. when a Color
|
||||
@ -55,8 +58,10 @@ public class PamParameterSet {
|
||||
* in the STANDARD_MODIFIER_EXCLUSIONS list (FINAL or STATIC).
|
||||
* @return Created parameter set.
|
||||
*/
|
||||
public static PamParameterSet autoGenerate(Object parentObject) {
|
||||
return autoGenerate(parentObject, STANDARD_MODIFIER_EXCLUSIONS);
|
||||
public static PamParameterSet autoGenerate(Object parentObject, ParameterSetType parameterSetType) {
|
||||
PamParameterSet paramSet = autoGenerate(parentObject, STANDARD_MODIFIER_EXCLUSIONS);
|
||||
paramSet.setParameterSetType(parameterSetType);
|
||||
return paramSet;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -286,4 +291,19 @@ public class PamParameterSet {
|
||||
public PamParameterData removeParameterData(String paramName) {
|
||||
return parameterDatas.remove(paramName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the parameterSetType
|
||||
*/
|
||||
public ParameterSetType getParameterSetType() {
|
||||
return parameterSetType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param parameterSetType the parameterSetType to set
|
||||
*/
|
||||
public void setParameterSetType(ParameterSetType parameterSetType) {
|
||||
this.parameterSetType = parameterSetType;
|
||||
}
|
||||
|
||||
}
|
||||
|
73
src/PamModel/parametermanager/ParameterSetManager.java
Normal file
73
src/PamModel/parametermanager/ParameterSetManager.java
Normal file
@ -0,0 +1,73 @@
|
||||
package PamModel.parametermanager;
|
||||
|
||||
import java.awt.Window;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
import javax.swing.JMenuItem;
|
||||
|
||||
import PamModel.parametermanager.swing.ManagedParameterDialog;
|
||||
import generalDatabase.parameterstore.ParameterDatabaseStore;
|
||||
|
||||
/**
|
||||
* Just about everything giving overall control of some managed parameters.
|
||||
* May be a bit too specific on first cut and need to be abstracted.
|
||||
* Testing on 'Deployment' data.
|
||||
* @author dg50
|
||||
*
|
||||
* @param <T>
|
||||
*/
|
||||
public class ParameterSetManager<T extends ManagedParameters> {
|
||||
|
||||
private T managedParams;
|
||||
private String name;
|
||||
|
||||
public ParameterSetManager(T defaultParams, String name) {
|
||||
setManagedParams(defaultParams);
|
||||
this.name = name;
|
||||
// if (managedParams == null) {
|
||||
// managedParams = new T();
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the managedParams
|
||||
*/
|
||||
public T getManagedParams() {
|
||||
return managedParams;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param managedParams the managedParams to set
|
||||
*/
|
||||
public void setManagedParams(T managedParams) {
|
||||
this.managedParams = managedParams;
|
||||
}
|
||||
|
||||
public JMenuItem getMenuItem(Window parent) {
|
||||
if (managedParams == null) {
|
||||
return null;
|
||||
}
|
||||
JMenuItem menuItem = new JMenuItem(name + " ...");
|
||||
menuItem.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
showDialog(parent);
|
||||
}
|
||||
});
|
||||
|
||||
return menuItem;
|
||||
}
|
||||
|
||||
protected void showDialog(Window parent) {
|
||||
ManagedParameterDialog<T> dialog = new ManagedParameterDialog<T>(parent, name, managedParams);
|
||||
T newParams = dialog.showDialog(parent, name, managedParams);
|
||||
|
||||
if (newParams != null) {
|
||||
ParameterDatabaseStore paramDatabase = new ParameterDatabaseStore("MetaData");
|
||||
paramDatabase.saveParameterSet(newParams);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package PamModel.parametermanager;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
/**
|
||||
* Abstract instance of PamParameterDataInterface which implements everything
|
||||
@ -36,9 +37,48 @@ public abstract class PrivatePamParameterData extends PamParameterData {
|
||||
* This should really be implemented in every concrete class, but no time to do that now. Aim to delete
|
||||
* this function here, then go through and implement everywhere ...
|
||||
*/
|
||||
return false;
|
||||
// return false;
|
||||
Object convData = convertStringType(data);
|
||||
getField().set(this, convData);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* convert a string type to a different type appropriate for the field in
|
||||
* question.
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
public Object convertStringType(Object value) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
if (value instanceof String == false) {
|
||||
return value;
|
||||
}
|
||||
String str = (String) value;
|
||||
Type type = getField().getGenericType();
|
||||
Class<?> cls = getField().getType();
|
||||
String clsName = cls.getName();
|
||||
switch (clsName) {
|
||||
case "int":
|
||||
case "Integer":
|
||||
return Integer.valueOf(str);
|
||||
case "double":
|
||||
case "Double":
|
||||
return Double.valueOf(str);
|
||||
case "float":
|
||||
case "Float":
|
||||
return Float.valueOf(str);
|
||||
case "short":
|
||||
case "Short":
|
||||
return Short.valueOf(str);
|
||||
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,49 @@
|
||||
package PamModel.parametermanager.swing;
|
||||
|
||||
import java.awt.Window;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamView.dialog.PamDialog;
|
||||
|
||||
public class ManagedParameterDialog<T extends ManagedParameters> extends PamDialog {
|
||||
|
||||
private T params;
|
||||
|
||||
private ManagedParameterPanel<T> parameterPanel;
|
||||
|
||||
public ManagedParameterDialog(Window parentFrame, String title, T params) {
|
||||
super(parentFrame, title, false);
|
||||
parameterPanel = new ManagedParameterPanel<T>(params);
|
||||
setDialogComponent(parameterPanel.getPanel());
|
||||
}
|
||||
|
||||
public T showDialog(Window parentFrame, String title, T parameters) {
|
||||
// ManagedParameterDialog dialog = new ManagedParameterDialog<>(parentFrame, title, parameters);
|
||||
setParams(parameters);
|
||||
setVisible(true);
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
private void setParams(T params) {
|
||||
this.params = params;
|
||||
this.parameterPanel.setParams(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getParams() {
|
||||
return parameterPanel.getParams(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelButtonPressed() {
|
||||
params = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreDefaultSettings() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
149
src/PamModel/parametermanager/swing/ManagedParameterPanel.java
Normal file
149
src/PamModel/parametermanager/swing/ManagedParameterPanel.java
Normal file
@ -0,0 +1,149 @@
|
||||
package PamModel.parametermanager.swing;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.GridBagConstraints;
|
||||
import java.awt.GridBagLayout;
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JTextArea;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.text.JTextComponent;
|
||||
|
||||
import PamModel.parametermanager.FieldNotFoundException;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterData;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamView.dialog.PamDialog;
|
||||
import PamView.dialog.PamGridBagContraints;
|
||||
|
||||
public class ManagedParameterPanel<T extends ManagedParameters> {
|
||||
|
||||
private JPanel mainPanel;
|
||||
private Collection<PamParameterData> parameterSet;
|
||||
|
||||
private static final int DEFAULT_TEXT_LENGTH = 6;
|
||||
private static final int MAX_SINGLE_LINE_LENGTH = 40;
|
||||
|
||||
private JTextComponent[] textComponents;
|
||||
|
||||
public ManagedParameterPanel(T parameterExample) {
|
||||
|
||||
mainPanel = new JPanel(new GridBagLayout());
|
||||
GridBagConstraints c = new PamGridBagContraints();
|
||||
PamParameterSet exampleSet = parameterExample.getParameterSet();
|
||||
parameterSet = exampleSet.getParameterCollection();
|
||||
int n = parameterSet.size();
|
||||
textComponents = new JTextComponent[n];
|
||||
int i = 0;
|
||||
for (PamParameterData paramData : parameterSet) {
|
||||
textComponents[i] = createComponent(paramData);
|
||||
c.gridx = 0;
|
||||
c.fill = GridBagConstraints.NONE;
|
||||
c.anchor = GridBagConstraints.NORTHEAST;
|
||||
mainPanel.add(new JLabel(paramData.getShortName(), JLabel.RIGHT), c);
|
||||
c.gridx++;
|
||||
if (textComponents[i] instanceof JTextArea) {
|
||||
c.fill = GridBagConstraints.HORIZONTAL;
|
||||
}
|
||||
else {
|
||||
c.fill = GridBagConstraints.NONE;
|
||||
}
|
||||
c.anchor = GridBagConstraints.WEST;
|
||||
mainPanel.add(textComponents[i], c);
|
||||
|
||||
textComponents[i].setToolTipText(getTipText(paramData));
|
||||
|
||||
c.gridy++;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
private String getTipText(PamParameterData paramData) {
|
||||
String tip = paramData.getToolTip();
|
||||
if (tip != null) {
|
||||
return tip;
|
||||
}
|
||||
else {
|
||||
return paramData.getFieldName();
|
||||
}
|
||||
}
|
||||
|
||||
private JTextComponent createComponent(PamParameterData paramData) {
|
||||
int textLen = paramData.getFieldLength();
|
||||
if (textLen == 0) {
|
||||
textLen = DEFAULT_TEXT_LENGTH;
|
||||
}
|
||||
if (textLen <= MAX_SINGLE_LINE_LENGTH) {
|
||||
return new JTextField(textLen);
|
||||
}
|
||||
else {
|
||||
JTextField dummyField = new JTextField(2);
|
||||
// dummyField.getBorder().
|
||||
JTextArea textArea = new JTextArea(textLen/MAX_SINGLE_LINE_LENGTH+1, MAX_SINGLE_LINE_LENGTH);
|
||||
textArea.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY));
|
||||
return textArea;
|
||||
}
|
||||
}
|
||||
|
||||
public JComponent getPanel() {
|
||||
return mainPanel;
|
||||
}
|
||||
|
||||
public void setParams(T params) {
|
||||
int i = 0;
|
||||
PamParameterData newParamData = null;
|
||||
Object data = null;
|
||||
for (PamParameterData paramData : this.parameterSet) {
|
||||
// find the parameter in the new parameters (parameterSet is just a formatting placeholder)
|
||||
try {
|
||||
newParamData = params.getParameterSet().findParameterData(paramData.getFieldName());
|
||||
} catch (FieldNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
data = newParamData.getData();
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (data != null) {
|
||||
textComponents[i].setText(data.toString());
|
||||
}
|
||||
else {
|
||||
textComponents[i].setText(null);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getParams(T params) {
|
||||
int i = 0;
|
||||
PamParameterData newParamData = null;
|
||||
Object data = null;
|
||||
for (PamParameterData paramData : this.parameterSet) {
|
||||
// find the parameter in the new parameters (parameterSet is just a formatting placeholder)
|
||||
try {
|
||||
newParamData = params.getParameterSet().findParameterData(paramData.getFieldName());
|
||||
} catch (FieldNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
String txt = textComponents[i].getText();
|
||||
try {
|
||||
newParamData.setData(txt);
|
||||
} catch (IllegalArgumentException | IllegalAccessException e) {
|
||||
String msg = "Invalid parameter. Data type should be " + paramData.getField().getType().getName();
|
||||
return PamDialog.showWarning(null, newParamData.getShortName(), msg);
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
@ -26,6 +26,7 @@ import java.io.Serializable;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
||||
/**
|
||||
* Class definition for a x,y coordinate number type.
|
||||
@ -168,7 +169,7 @@ public class Coordinate3d implements Serializable , Cloneable, PamCoordinate, Ma
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,7 @@ import java.text.NumberFormat;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PrivatePamParameterData;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamguardMVC.PamConstants;
|
||||
import net.sf.geographiclib.Geodesic;
|
||||
import net.sf.geographiclib.PolygonArea;
|
||||
@ -833,7 +834,7 @@ public class LatLong implements Serializable, Cloneable, Transferable, PamCoordi
|
||||
*/
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
try {
|
||||
Field field = this.getClass().getDeclaredField("height");
|
||||
ps.put(new PrivatePamParameterData(this, field) {
|
||||
|
@ -47,10 +47,7 @@ public class PamCalendar {
|
||||
|
||||
public static TimeZone defaultTimeZone = TimeZone.getTimeZone("UTC");
|
||||
|
||||
/*
|
||||
* Not used: all now handled in PamCalendar.
|
||||
*/
|
||||
// private static TimeZone localTimeZone = defaultTimeZone;// TimeZone.getDefault();
|
||||
private static TimeZone localTimeZone = defaultTimeZone;// TimeZone.getDefault();
|
||||
|
||||
public static final long millisPerDay = 1000L*24L*3600L;
|
||||
|
||||
@ -63,7 +60,7 @@ public class PamCalendar {
|
||||
private static boolean soundFile;
|
||||
|
||||
/**
|
||||
* time from the start of the file to the current moment.
|
||||
* time from the start of the file to the currentmoment.
|
||||
* This is updated every time data re read from the file, so is
|
||||
* accurate to about 1/10 second.
|
||||
* For accurate timing within detectors, always try to use sample number
|
||||
@ -180,44 +177,8 @@ public class PamCalendar {
|
||||
|
||||
public static TimeZone getDisplayTimeZone(boolean useLocal) {
|
||||
// return TimeZone.getTimeZone("UTC");
|
||||
return useLocal ? CalendarControl.getInstance().getChosenTimeZone() : defaultTimeZone;
|
||||
// return useLocal ? localTimeZone : defaultTimeZone;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the display time zone offset in milliseconds.
|
||||
* @param useLocal
|
||||
* @return
|
||||
*/
|
||||
public static long getDisplayTimeZoneOffest(boolean useLocal) {
|
||||
TimeZone tz = getDisplayTimeZone(useLocal);
|
||||
return tz.getOffset(getTimeInMillis());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a short string describing the time zone. This should be less than
|
||||
* 10 characters. So if the full name of the TZ is long, then write it
|
||||
* in the format "UTC+..."
|
||||
* @param useLocal
|
||||
* @return
|
||||
*/
|
||||
public static String getShortDisplayTimeZoneString(boolean useLocal) {
|
||||
TimeZone tz = getDisplayTimeZone(useLocal);
|
||||
String str = tz.getDisplayName();
|
||||
str = CalendarControl.getInstance().getTZCode(true);
|
||||
if (str.length() <= 10) {
|
||||
return str;
|
||||
}
|
||||
// otherwise make up a string.
|
||||
long offset = getDisplayTimeZoneOffest(useLocal) / 1000;
|
||||
boolean isInt = offset % 3600 == 0;
|
||||
if (isInt) {
|
||||
str = String.format("UTC%+d", offset/3600);
|
||||
}
|
||||
else {
|
||||
str = String.format("UTC%+3.1f", (double) offset/3600.);
|
||||
}
|
||||
return str;
|
||||
// return useLocal ? CalendarControl.getInstance().getChosenTimeZone() : defaultTimeZone;
|
||||
return useLocal ? localTimeZone : defaultTimeZone;
|
||||
}
|
||||
|
||||
public static String formatDateTime(Date date) {
|
||||
@ -430,13 +391,8 @@ public class PamCalendar {
|
||||
|
||||
public static String formatDBStyleTime(long timeInMillis, boolean showMillis, boolean useLocal) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
TimeZone tz = getDisplayTimeZone(useLocal);
|
||||
// if (tz != null) {
|
||||
// long offs = tz.getOffset(timeInMillis);
|
||||
// timeInMillis += tz.getOffset(timeInMillis);
|
||||
// }
|
||||
c.setTimeInMillis(timeInMillis);
|
||||
c.setTimeZone(tz);
|
||||
c.setTimeZone(getDisplayTimeZone(useLocal));
|
||||
DateFormat df;
|
||||
if (showMillis) {
|
||||
df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
@ -444,7 +400,7 @@ public class PamCalendar {
|
||||
else {
|
||||
df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
df.setTimeZone(tz);
|
||||
df.setTimeZone(getDisplayTimeZone(useLocal));
|
||||
Date d = c.getTime();
|
||||
// return String.format("%tY-%<tm-%<td %<tH:%<tM:%<tS", d);
|
||||
|
||||
@ -776,7 +732,6 @@ public class PamCalendar {
|
||||
public static long msFromDateString(String dateString) {
|
||||
return msFromDateString(dateString, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read a date string and turn it into a millisecond time.
|
||||
* @param dateString
|
||||
|
@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
||||
public class GlobalTimeParameters implements Serializable, Cloneable, ManagedParameters {
|
||||
|
||||
@ -91,7 +92,7 @@ public class GlobalTimeParameters implements Serializable, Cloneable, ManagedPar
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@ import java.util.TimeZone;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
||||
public class TimeDisplayParameters implements Serializable, Cloneable, ManagedParameters {
|
||||
|
||||
@ -34,7 +35,7 @@ public class TimeDisplayParameters implements Serializable, Cloneable, ManagedPa
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
||||
public class NMEATimeParameters implements Serializable, Cloneable, ManagedParameters {
|
||||
|
||||
@ -26,7 +27,7 @@ public class NMEATimeParameters implements Serializable, Cloneable, ManagedParam
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
||||
public class NTPTimeParameters implements Serializable, Cloneable, ManagedParameters {
|
||||
|
||||
@ -32,7 +33,7 @@ public class NTPTimeParameters implements Serializable, Cloneable, ManagedParame
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@ import java.io.Serializable;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
||||
/**
|
||||
* A series of functions for creating arrays of colours
|
||||
@ -410,7 +411,7 @@ public class ColourArray implements Cloneable, Serializable, ManagedParameters {
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -265,6 +265,11 @@ public abstract class GeneralProjector<T extends PamCoordinate> {
|
||||
|
||||
JComponent toolTipComponent;
|
||||
|
||||
/**
|
||||
* Gets an adapter that can provide tooltips automatically based on plotted data units.
|
||||
* @param component
|
||||
* @return
|
||||
*/
|
||||
public MouseHoverAdapter getMouseHoverAdapter(JComponent component) {
|
||||
ToolTipManager tt = ToolTipManager.sharedInstance();
|
||||
tt.registerComponent(component);
|
||||
@ -384,7 +389,9 @@ public abstract class GeneralProjector<T extends PamCoordinate> {
|
||||
}
|
||||
String hintText = dataBlock.getHoverText(this, hoveredDataUnit, hoverData.get(unitIndex).getAmbiguity());
|
||||
|
||||
if (hintText == null) return null;
|
||||
if (hintText == null) {
|
||||
return null;
|
||||
}
|
||||
// System.out.println(hintText);
|
||||
return hintText;
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamUtils.PamUtils;
|
||||
import PamView.dialog.GroupedSourcePanel;
|
||||
|
||||
@ -210,7 +211,7 @@ public class GroupedSourceParameters implements Serializable, Cloneable, Managed
|
||||
*/
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@ import java.util.ArrayList;
|
||||
import PamController.PamControlledUnit;
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamModel.parametermanager.PrivatePamParameterData;
|
||||
|
||||
/**
|
||||
@ -55,7 +56,7 @@ public class GuiFrameSettings implements Serializable, Cloneable, ManagedParamet
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
|
||||
try {
|
||||
Field field = this.getClass().getDeclaredField("unitFrameInfo");
|
||||
ps.put(new PrivatePamParameterData(this, field) {
|
||||
@ -89,7 +90,7 @@ public class GuiFrameSettings implements Serializable, Cloneable, ManagedParamet
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
|
||||
try {
|
||||
Field field = this.getClass().getDeclaredField("guiFrame");
|
||||
ps.put(new PrivatePamParameterData(this, field) {
|
||||
|
@ -61,6 +61,7 @@ import javax.swing.JMenuBar;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JRootPane;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.Timer;
|
||||
@ -73,6 +74,7 @@ import javax.swing.event.MenuListener;
|
||||
|
||||
import Acquisition.DaqSystemInterface;
|
||||
import annotation.tasks.AnnotationManager;
|
||||
import metadata.MetaDataContol;
|
||||
import performanceTests.PerformanceDialog;
|
||||
import tipOfTheDay.TipOfTheDayManager;
|
||||
import Array.ArrayManager;
|
||||
@ -601,6 +603,7 @@ public class PamGui extends PamView implements WindowListener, PamSettings {
|
||||
fileMenu.add(menuItem);
|
||||
}
|
||||
|
||||
// if (SMRUEnable.isEnable()) {
|
||||
menuItem = new JMenuItem("Import PAMGuard Modules");
|
||||
menuItem.setToolTipText("Import module settings from a different PAMGuard configuration (psfx files only");
|
||||
menuItem.addActionListener(new ActionListener() {
|
||||
@ -610,6 +613,7 @@ public class PamGui extends PamView implements WindowListener, PamSettings {
|
||||
}
|
||||
});
|
||||
fileMenu.add(menuItem);
|
||||
// }
|
||||
|
||||
fileMenu.addSeparator();
|
||||
|
||||
@ -759,6 +763,7 @@ public class PamGui extends PamView implements WindowListener, PamSettings {
|
||||
//for changing "hydrophones" to "microphone" and vice versa if medium changes.
|
||||
menu.addMenuListener(new SettingsMenuListener());
|
||||
|
||||
menu.add(MetaDataContol.getMetaDataControl().createMenu(frame));
|
||||
|
||||
menu.addSeparator();
|
||||
|
||||
@ -1664,10 +1669,10 @@ public class PamGui extends PamView implements WindowListener, PamSettings {
|
||||
protected void getGuiParameters() {
|
||||
guiParameters.extendedState = frame.getExtendedState();
|
||||
guiParameters.state = frame.getState();
|
||||
if (guiParameters.state != Frame.MAXIMIZED_BOTH) {
|
||||
// if (guiParameters.state != Frame.MAXIMIZED_BOTH) {
|
||||
guiParameters.size = frame.getSize();
|
||||
guiParameters.bounds = frame.getBounds();
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1983,5 +1988,29 @@ public class PamGui extends PamView implements WindowListener, PamSettings {
|
||||
return this.mainTab;
|
||||
}
|
||||
|
||||
/**
|
||||
* find a parent window for a JComponent. This can be useful in
|
||||
* finding windows to open child dialogs when the object holding
|
||||
* the component may not have a direct reference back to it's dialog.
|
||||
* @param component any Swing component
|
||||
* @return parent Window (or frame) if it can be found
|
||||
*/
|
||||
public static Window findComponentWindow(JComponent component) {
|
||||
if (component == null) {
|
||||
return null;
|
||||
}
|
||||
JRootPane root = component.getRootPane();
|
||||
if (root == null) {
|
||||
return null;
|
||||
}
|
||||
Container rootP = root.getParent();
|
||||
if (rootP instanceof Window) {
|
||||
return (Window) rootP;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -38,6 +38,7 @@ import javax.swing.JPanel;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
import PamView.PamColors.PamColor;
|
||||
import PamView.symbol.SymbolData;
|
||||
|
||||
@ -808,7 +809,7 @@ public class PamSymbol extends PamSymbolBase implements Serializable, Icon, Clon
|
||||
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
@ -48,6 +48,7 @@ public class WarnOnce implements PamSettings {
|
||||
int ans = showWarning(parent, "Warning Messages", "Show all PAMGuard warning messages", WarnOnce.OK_CANCEL_OPTION);
|
||||
if (ans == WarnOnce.CANCEL_OPTION) return;
|
||||
singleInstance.warnOnceList.clearList();
|
||||
singleInstance.showThisSess.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
|
||||
import PamModel.parametermanager.ManagedParameters;
|
||||
import PamModel.parametermanager.PamParameterSet;
|
||||
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
|
||||
|
||||
public class OverlayDataInfo implements Serializable, Cloneable, ManagedParameters {
|
||||
|
||||
@ -31,7 +32,7 @@ public class OverlayDataInfo implements Serializable, Cloneable, ManagedParamete
|
||||
*/
|
||||
@Override
|
||||
public PamParameterSet getParameterSet() {
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this);
|
||||
PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
|
||||
return ps;
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user