diff --git a/.externalToolBuilders/net.sourceforge.metrics.builder.launch b/.externalToolBuilders/net.sourceforge.metrics.builder.launch
new file mode 100644
index 00000000..8e11c919
--- /dev/null
+++ b/.externalToolBuilders/net.sourceforge.metrics.builder.launch
@@ -0,0 +1,7 @@
+
+
@@ -479,8 +479,8 @@ continually reset them.
Linking clicks to offline clicks table. We had a database -that had become corrupted so added code to relink offline clicks to their corresponding -clicks from binary data.
+that had become corrupted so added code to relink offline clicks to their +corresponding clicks from binary data.Drawing non-acoustic data: Data that were not associated with any hydrophones, e.g. visual sightings in Logger forms were not drawing on @@ -502,9 +502,9 @@ database.
Importing modules from other configurations: New options from file menu allowing import -of specific modules, or module settings from other configurations. E.g. if you -had three similar configurations and had set one of them up with a new +lang=EN-US> from other configurations: New options from file menu allowing +import of specific modules, or module settings from other configurations. E.g. +if you had three similar configurations and had set one of them up with a new detector, or got the click classifier settings set up just right in one of those configurations, you can import the additional modules or the click detector settings easily into the other configurations.
@@ -532,9 +532,9 @@ correctly saving updated bearings to the database. Now fixed.ROCCA Classifier fixes
-Allow Rocca to run without classifiers: Fixed -bug that threw an error if no classifier files were specified in Rocca -Params dialog
+Allow Rocca to run without classifiers: +Fixed bug that threw an error if no classifier files were specified in +Rocca Params dialog
Fix memory issue with RoccaContourDataBlocks not being released for garbage collection
@@ -593,8 +593,8 @@ were reading local time, even when set to use UTC. which mostly occurred when processing large datasets of many offline files, has been fixed. -Data Map: “Scroll To Data” pop-up menu, -which didn’t always scroll to the correct place, is now fixed.
+Data Map: “Scroll To Data” pop-up menu, which +didn’t always scroll to the correct place, is now fixed.
Bearing Localiser offline: If reprocessing bearings, the localizer was not correctly loading required raw or FFT data to @@ -803,9 +803,8 @@ the TF FX display to crash if no data were displayed.
See major release notes for V 2.02.01 below.
-Bug 495: TD FX display throws -NullPointerException if user has removed all data units and then moves mouse -over display area.
+Bug 495: TD FX display throws NullPointerException +if user has removed all data units and then moves mouse over display area.
If you are upgrading from a PAMGuard core release (1.15.xx), PAMGuard Version 2 contains major updates. You should read and -understand the notes listed for Beta -Version 2.00.10 before proceeding with installation and use of this -version.
+understand the notes listed for Beta Version +2.00.10 before proceeding with installation and use of this version.This version of PAMGuard has been bundled with Java 13 (release 13.0.1). PSFX files generated in previous beta releases (2.xx.xx) @@ -1104,11 +1102,11 @@ understand the notes listed for Beta Version 2.00.10 before proceeding with installation and use of this version.
-This version of PAMGuard has been bundled with Java 13 -(release 13.0.1). PSFX files generated in previous beta releases (2.xx.xx) -should be compatible with this version, and vice-versa. PSF files generated in -core releases (1.15.xx) can be loaded in this version, but will be converted to -PSFX files when PAMGuard exits.
+This version of PAMGuard has been bundled with Java 13 (release +13.0.1). PSFX files generated in previous beta releases (2.xx.xx) should be +compatible with this version, and vice-versa. PSF files generated in core +releases (1.15.xx) can be loaded in this version, but will be converted to PSFX +files when PAMGuard exits.
Bug Fixes
@@ -1218,10 +1216,10 @@ lang=EN-US> Add functionality for bluetooth headsets.2. Add user-facing option to adjust the startup delay for the time-correction -(Global Time module). This provides a workaround to speed up analysis of -thousands of wav files (i.e. by setting startup delay to 0 instead of default -value of 2000 ms).
+lang=EN-US> Add user-facing option to adjust the startup delay for the +time-correction (Global Time module). This provides a workaround to speed up +analysis of thousands of wav files (i.e. by setting startup delay to 0 instead +of default value of 2000 ms).3. &nb Add 15 minute data load option to viewer mode.
5. -Add 3D map for target motion module.
+lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'> Add 3D map for target motion module.6.
Bug Fixes 1.
-Bug 433. Custom storage options were being lost when Pamguard restarted.
2.
1. This version of PAMGuard has been upgraded to make it
-compatible with Java 12. psfx files generated in previous beta releases should
-be compatible with this version, and vice-versa.
2. -Java 12 is better at handling Windows scaling issues on high-DPI displays. Beyond -that, users should not notice much of a difference between this version and -previous beta releases.
+Java 12 is better at handling Windows scaling issues on high-DPI displays. +Beyond that, users should not notice much of a difference between this version +and previous beta releases. @@ -1528,9 +1527,9 @@ with installation and use of this version.1. -Bug 413. Binary file crashing during load, after a system failure. -Failure could cause the file to become corrupt, which caused a crash during -subsequent load
+Bug 413. Binary file crashing during load, after a system failure. Failure +could cause the file to become corrupt, which caused a crash during subsequent +load2.
@@ -1688,8 +1687,8 @@ lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'> &nb
Upgrades 1.
-Improvement to Range Rings in Map display.
2. @@ -1743,8 +1742,8 @@ with installation and use of this version.
1. -Bug 338. Problem displaying coastlines and bathymetric contours around -the dateline (+/- 180 longitude) in the map.
+Bug 338. Problem displaying coastlines and bathymetric contours around the +dateline (+/- 180 longitude) in the map.2. @@ -2327,13 +2326,13 @@ lang=EN-US>
1. Bug 317. Rocca Module Data Purging. The ROCCA -module was not performing data purging when using classifiers developed for -Hawaii/Temperate Pacific/North Atlantic datasets. This has been corrected.
+module was not performing data purging when using classifiers developed for Hawaii/Temperate +Pacific/North Atlantic datasets. This has been corrected.2. -Bug 320. Pamguard stopped reading Click Detector Event data from -database when target motion analysis information was encountered. Corrected.
+Bug 320. Pamguard stopped reading Click Detector Event data from database +when target motion analysis information was encountered. Corrected.3. @@ -2438,9 +2437,9 @@ jar file will be required rather than a new bespoke PAMGuard installation.here. Plug-in modules can be downloaded from the -PAMGuard website here, but developers are encouraged to host and maintain their -own modules.
+target="_blank">here. Plug-in modules can be downloaded from the PAMGuard +website here, but developers are encouraged to host and maintain their own +modules.Modules of interest to the general PAM community will remain as part of the core PAMGuard installation. However, @@ -2615,9 +2614,9 @@ main click detector display.
Target Motion Analysis
-A major piece of work has been undertaken to -improve the Target Motion tracking with PAMGuard. Details are available in the -online help. Users of the Click Detector will notice the following changes:
+A major piece of work has been undertaken +to improve the Target Motion tracking with PAMGuard. Details are available in +the online help. Users of the Click Detector will notice the following changes:
1. @@ -2936,9 +2935,9 @@ See the help file for details.
lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'> Feature Request 45. Click classification settings -export / import. Click classification settings can be exported individually to -files and imported into other click detector configurations. See the help file -for details. +export / import. Click classification settings can be exported individually to files +and imported into other click detector configurations. See the help file for +details.3. @@ -3055,8 +3054,8 @@ allocation to allow more memory for the database interface. Hopefully Fixed.
9. -Bug 239. Fixed bug in the DIFAR module that was incorrectly -preventing cross-fixes for some calls. +Bug 239. Fixed bug in the DIFAR module that was +incorrectly preventing cross-fixes for some calls.Details of these bugs can be found at https://sourceforge.net/p/pamguard/bugs
@@ -3152,9 +3151,9 @@ crash when analyzing click event containing unclassified clicks8. -Bug 230. Click Bearing Display. With a two hydrophone -system, clicks calculated to have a bearing of exactly 180 degrees would be -displayed at 0 degrees on the bearing time display.
+Bug 230. Click Bearing Display. With a two hydrophone system, +clicks calculated to have a bearing of exactly 180 degrees would be displayed +at 0 degrees on the bearing time display.@@ -3206,9 +3205,8 @@ total loss of the PAMGuard configuration in viewer mode and has been rectified. 7.0pt;font-family:"Times New Roman",serif'> Bug 218. SAIL Acquisition card would hang the system. This has also been fixed. -
7. Bug -219. Problems displaying Offline Click Events in the Viewer map have been -fixed.
+7. Bug 219. +Problems displaying Offline Click Events in the Viewer map have been fixed.
@@ -3515,9 +3513,9 @@ to these menus to provide additional information to users.
Radar Display
-Functionality has been added to the -radar display so that bearings can be shown relative to either the vessel or to -true North.
+Functionality has been added to +the radar display so that bearings can be shown relative to either the vessel +or to true North.
Better control of data in viewer mode, making is easy to scroll through and view data for short time periods.
@@ -3872,11 +3870,11 @@ Symbol'>'Version 1.8.01 Beta February 2010 @@ -4302,11 +4300,11 @@ Symbol'>'' -New menu functionality by right clicking on any of the tabs of the main tab -control will allow the user to copy the tab contents to the system clipboard -from where it can be copied into other programs (e.g. Word, Powerpoint, -etc.).Some modules, such as the map, have this implemented in other menus -(right click) and also allow printing. +New menu functionality by right clicking on any of the tabs of the main +tab control will allow the user to copy the tab contents to the system +clipboard from where it can be copied into other programs (e.g. Word, +Powerpoint, etc.).Some modules, such as the map, have this implemented in other +menus (right click) and also allow printing.' @@ -4374,8 +4372,8 @@ online help.
PAMGUARD Mixed Mode operation
-Analyses data from wav or AIF file and synchronises it with GPS -data reloaded from a database so that detected sounds may be correctly +
Analyses data from wav or AIF file and synchronises it with +GPS data reloaded from a database so that detected sounds may be correctly localised. Multiple display frames - enables PAMGUARD GUI to be split into multiple display windows, displayed on multiple monitors if desired. Enables the operator to simultaneously view the map and the click detector for example, @@ -4411,9 +4409,9 @@ now been fixed.
Sound Recorder
-Level meters are shown for the correct channels (after -channel numbering has been changed). Occasional crash due to synchronisation -problems when multi-threading now fixed.
+Level meters are shown for the correct channels (after channel +numbering has been changed). Occasional crash due to synchronisation problems +when multi-threading now fixed.
Whistle Detector
@@ -4687,9 +4685,9 @@ Symbol'>'' -Better drawing of held spectrogram when putting mark rectangles on a -spectrogram display. All panels are now correctly frozen. The rectangle is -drawn in red on the marked panel and in green on other panels. +Better drawing of held spectrogram when putting mark rectangles on a spectrogram +display. All panels are now correctly frozen. The rectangle is drawn in red on +the marked panel and in green on other panels.'
@@ -4705,9 +4703,9 @@ coming in through the ASIO card and back out through its headphone socket
'
Operation will depend on the configuration of individual sound cards and
-how they are configured to mix incoming data with data from the PC. This is
-sometimes a physical switch on the card and sometimes a software configuration
-utility specific to that sound card.
'
diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml
index e135ce29..36fc4eea 100644
--- a/dependency-reduced-pom.xml
+++ b/dependency-reduced-pom.xml
@@ -4,7 +4,7 @@
* PamController contains a list of PamControlledUnit's each of which
* has it's own process,
- simpleMapRef.gpsTextPanel.setPixelsPerMetre(getPixelsPerMetre()); input and output data and display (Tab Panel,
- * Menus, etc.)
+ * simpleMapRef.gpsTextPanel.setPixelsPerMetre(getPixelsPerMetre());
+ * input and output data and display (Tab Panel, Menus, etc.)
* @see PamController.PamControlledUnit
* @see PamView.PamTabPanel
*
@@ -129,7 +129,7 @@ public class PamController implements PamControllerInterface, PamSettings {
public static final int PAM_COMPLETE = 6;
public static final int PAM_MAPMAKING = 7;
public static final int PAM_OFFLINETASK = 8;
-
+
public static final int BUTTON_START = 1;
public static final int BUTTON_STOP = 2;
private volatile int lastStartStopButton = 0;
@@ -145,20 +145,21 @@ public class PamController implements PamControllerInterface, PamSettings {
public static final int RUN_NETWORKRECEIVER = 5;
private int runMode = RUN_NORMAL;
-
- // flag used in main() to indicate that processing should start immediately.
+
+ // flag used in main() to indicate that processing should start immediately.
public static final String AUTOSTART = "-autostart";
- // flag used in main() to indicate that pamguard should exit as soon as processing ends.
+ // flag used in main() to indicate that pamguard should exit as soon as
+ // processing ends.
public static final String AUTOEXIT = "-autoexit";
/**
- * Never changed. Needed to identify settings for list of modules in prfx files.
+ * Never changed. Needed to identify settings for list of modules in prfx files.
*/
public static final String unitName = "Pamguard Controller";
public static final String unitType = "PamController";
/**
- * The pam model.
+ * The pam model.
*/
private PamModel pamModelInterface;
@@ -169,14 +170,14 @@ public class PamController implements PamControllerInterface, PamSettings {
private volatile int pamStatus = PAM_IDLE;
/**
- * PamGuard view params.
+ * PamGuard view params.
*/
public PamViewParameters pamViewParameters = new PamViewParameters();
- // ViewerStatusBar viewerStatusBar;
+ // ViewerStatusBar viewerStatusBar;
/*
- * Swing GUI manager
+ * Swing GUI manager
*/
private PAMControllerGUI guiFrameManager;
@@ -186,18 +187,17 @@ public class PamController implements PamControllerInterface, PamSettings {
private boolean initializationComplete = false;
/**
- * The java version being run. e.g. Java 8u111 will be 8.111;
+ * The java version being run. e.g. Java 8u111 will be 8.111;
*/
- public static double JAVA_VERSION = getVersion ();
-
+ public static double JAVA_VERSION = getVersion();
// PAMGUARD CREATION IS LAUNCHED HERE !!!
- // private static PamControllerInterface anyController = new PamController();
+ // private static PamControllerInterface anyController = new PamController();
private static PamController uniqueController;
private Timer diagnosticTimer;
-
- private boolean debugDumpBufferAtRestart = true;
+
+ private boolean debugDumpBufferAtRestart = false;
private NetworkController networkController;
private int nNetPrepared;
@@ -207,67 +207,65 @@ public class PamController implements PamControllerInterface, PamSettings {
private Timer garbageTimer;
/**
- * The UID manager.
+ * The UID manager.
*/
private UIDManager uidManager;
/**
- * A global time manager to manage corrections to the PC clock
- * from various sources.
+ * A global time manager to manage corrections to the PC clock from various
+ * sources.
*/
private GlobalTimeManager globalTimeManager;
/**
- * A global medium manager which handles the type of medium sound is propogating through.
+ * A global medium manager which handles the type of medium sound is propogating
+ * through.
*/
- private GlobalMediumManager globalMediumManager;
+ private GlobalMediumManager globalMediumManager;
/**
- * A reference to the module currently being loaded. Used by the PamExceptionHandler to
- * monitor runtime errors that occur during load
+ * A reference to the module currently being loaded. Used by the
+ * PamExceptionHandler to monitor runtime errors that occur during load
*/
- private static PamControlledUnit unitBeingLoaded=null;
-
+ private static PamControlledUnit unitBeingLoaded = null;
/**
- * Folder where Pamguard is installed and running out of. This string
- * includes the file separator at the end, or is null if there was a
- * problem trying to determine the installation folder
+ * Folder where Pamguard is installed and running out of. This string includes
+ * the file separator at the end, or is null if there was a problem trying to
+ * determine the installation folder
*/
- private String installFolder=null;
+ private String installFolder = null;
private boolean haveGlobalTimeUpdate;
private WatchdogComms watchdogComms;
-
+
private PamWarning statusWarning = new PamWarning("PAMGuard control", "Status", 0);
-
- /**
+
+ /**
* A separate thread that checks all ThreadedObservers to see if they still have
* data in their buffers
*/
private Thread statusCheckThread;
private WaitDetectorThread detectorEndThread;
private boolean firstDataLoadComplete;
- // keep a track of the total number of times PAMGuard is started for debug purposes.
+ // keep a track of the total number of times PAMGuard is started for debug
+ // purposes.
private int nStarts;
private RestartRunnable restartRunnable;
-
private PamController(int runMode, Object object) {
uniqueController = this;
-
+
pamConfiguration = new PamConfiguration();
this.runMode = runMode;
if (runMode == PamController.RUN_PAMVIEW) {
uidManager = new UIDViewerManager(this);
- }
- else {
+ } else {
uidManager = new UIDOnlineManager(this);
}
-
sayMemory();
globalTimeManager = new GlobalTimeManager(this);
@@ -285,11 +283,12 @@ public class PamController implements PamControllerInterface, PamSettings {
}
guiFrameManager = PamGUIManager.createGUI(this, object);
- guiFrameManager.init(); //perform any start up processes for the GUI.
+ guiFrameManager.init(); // perform any start up processes for the GUI.
// figure out the installation folder
try {
- File theURL = new File(this.getClass().getProtectionDomain().getCodeSource().getLocation().toURI().getPath());
+ File theURL = new File(
+ this.getClass().getProtectionDomain().getCodeSource().getLocation().toURI().getPath());
installFolder = theURL.getParentFile().getPath() + File.separator;
} catch (URISyntaxException e) {
System.out.println("Error finding installation folder of jar file: " + e.getMessage());
@@ -300,13 +299,12 @@ public class PamController implements PamControllerInterface, PamSettings {
setupPamguard();
setupGarbageCollector();
-
// if (PamGUIManager.getGUIType() == PamGUIManager.NOGUI) {
// }
-
- // diagnosticTimer = new Timer(1000, new DiagnosticTimer());
- // diagnosticTimer.start();
+
+ // diagnosticTimer = new Timer(1000, new DiagnosticTimer());
+ // diagnosticTimer.start();
}
class DiagnosticTimer implements ActionListener {
@@ -318,51 +316,51 @@ public class PamController implements PamControllerInterface, PamSettings {
private void sayMemory() {
Runtime r = Runtime.getRuntime();
- System.out.println(String.format("System memory at %s Max %d, Free %d",
- PamCalendar.formatDateTime(System.currentTimeMillis()),
- r.maxMemory(), r.freeMemory()));
+ System.out.println(String.format("System memory at %s Max %d, Free %d",
+ PamCalendar.formatDateTime(System.currentTimeMillis()), r.maxMemory(), r.freeMemory()));
}
/**
- * Create an instance of the PAMController.
+ * Create an instance of the PAMController.
+ *
* @param runMode - the run mode
*/
public static void create(int runMode) {
if (uniqueController == null) {
PamController pamcontroller = new PamController(runMode, null);
/*
- * I don't see any reason not have have this running with the GUI.
- * It launches in a new thread, so it should be fine to have
- * additional commands afterwards.
+ * I don't see any reason not have have this running with the GUI. It launches
+ * in a new thread, so it should be fine to have additional commands afterwards.
*/
TerminalController tc = new TerminalController(pamcontroller);
tc.getTerminalCommands();
}
-
+
SwingUtilities.invokeLater(new Runnable() {
-
+
@Override
public void run() {
uniqueController.creationComplete();
}
});
}
-
+
/**
- * Not to sound God like, but this will be called on the AWT dispatch thread shortly
- * after all modules are created, PAMGuard should be fully setup and all modules will
- * have recieved INITIALISATION_COMPLETE and should be good to run
+ * Not to sound God like, but this will be called on the AWT dispatch thread
+ * shortly after all modules are created, PAMGuard should be fully setup and all
+ * modules will have recieved INITIALISATION_COMPLETE and should be good to run
*/
private void creationComplete() {
if (GlobalArguments.getParam(PamController.AUTOSTART) != null) {
startLater(); // may as well give AWT time to loop it's queue once more
}
}
-
+
/**
- * Create an instance of the PAMcController.
+ * Create an instance of the PAMcController.
+ *
* @param runMode - the run mode
- * @param object - extra information. Can be null.
+ * @param object - extra information. Can be null.
*/
public static void create(int runMode, Object object) {
if (uniqueController == null) {
@@ -371,21 +369,20 @@ public class PamController implements PamControllerInterface, PamSettings {
}
/**
- * Setup the PAMController.
+ * Setup the PAMController.
*/
public void setupPamguard() {
/**
- * Set Locale to English so that formated writes to text fields
- * in dialogs use . and not , for the decimal.
+ * Set Locale to English so that formated writes to text fields in dialogs use .
+ * and not , for the decimal.
*/
Locale.setDefault(Locale.ENGLISH);
/*
- * 15/8/07 Changed creation order of model and view.
- * Need to be able to create a database pretty early on
- * (in the Model) in order to read back settings that
- * the GUI may require.
+ * 15/8/07 Changed creation order of model and view. Need to be able to create a
+ * database pretty early on (in the Model) in order to read back settings that
+ * the GUI may require.
*
*/
// create the model
@@ -393,39 +390,42 @@ public class PamController implements PamControllerInterface, PamSettings {
pamModelInterface.createPamModel();
/*
- * 9 February 2009
- * Trying to sort out settings file loading.
- * Was previously done when the first modules registered itself
- * with the settings manager. Gets very confusing. Will be much easier
- * to load up the settings first, depending on the type of module
- * and then have them ready when the modules start asking for them.
+ * 9 February 2009 Trying to sort out settings file loading. Was previously done
+ * when the first modules registered itself with the settings manager. Gets very
+ * confusing. Will be much easier to load up the settings first, depending on
+ * the type of module and then have them ready when the modules start asking for
+ * them.
*/
int loadAns = PamSettingManager.getInstance().loadPAMSettings(runMode);
-
- System.out.println("Pamcontroller: loadPAMSettings: " + loadAns);
+
+ System.out.println("Pamcontroller: loadPAMSettings: " + loadAns);
if (loadAns == PamSettingManager.LOAD_SETTINGS_NEW) {
- // if (runMode == RUN_PAMVIEW) {
- // // no model, no gui, so PAMGAURD will simply exit.
- // String str = String.format("PAMGUARD cannot run in %s mode without a valid database\nPAMGUARD will exit.",
- // getRunModeName());
- // str = "You have opened a database in viewer mode that contains no settings\n" +
- // "Either load settings from the binary store, import a psf settings file or create modules by hand.\n" +
- // "Press OK to continue or Cancel to exit the viewer";
+ // if (runMode == RUN_PAMVIEW) {
+ // // no model, no gui, so PAMGAURD will simply exit.
+ // String str = String.format("PAMGUARD cannot run in %s mode without a valid
+ // database\nPAMGUARD will exit.",
+ // getRunModeName());
+ // str = "You have opened a database in viewer mode that contains no settings\n"
+ // +
+ // "Either load settings from the binary store, import a psf settings file or
+ // create modules by hand.\n" +
+ // "Press OK to continue or Cancel to exit the viewer";
//
- // int ans = JOptionPane.showConfirmDialog(null, str, "PAMGuard viewer", JOptionPane.OK_CANCEL_OPTION);
- // if (ans == JOptionPane.CANCEL_OPTION) {
- // System.exit(0);
- // }
- // }
- // else if (loadAns == ){
- // // normal settings will probably return an error, but it's OK still !
- //// System.exit(0);
- // }
- // return;
- }
- else if (loadAns == PamSettingManager.LOAD_SETTINGS_CANCEL) {
- JOptionPane.showMessageDialog(null, "No settings loaded. PAMGuard will exit", "PAMGuard", JOptionPane.INFORMATION_MESSAGE);
+ // int ans = JOptionPane.showConfirmDialog(null, str, "PAMGuard viewer",
+ // JOptionPane.OK_CANCEL_OPTION);
+ // if (ans == JOptionPane.CANCEL_OPTION) {
+ // System.exit(0);
+ // }
+ // }
+ // else if (loadAns == ){
+ // // normal settings will probably return an error, but it's OK still !
+ //// System.exit(0);
+ // }
+ // return;
+ } else if (loadAns == PamSettingManager.LOAD_SETTINGS_CANCEL) {
+ JOptionPane.showMessageDialog(null, "No settings loaded. PAMGuard will exit", "PAMGuard",
+ JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
}
@@ -434,44 +434,53 @@ public class PamController implements PamControllerInterface, PamSettings {
}
// get the general settings out of the file immediately.
- // PamSettingManager.getInstance().loadSettingsFileData();
+ // PamSettingManager.getInstance().loadSettingsFileData();
/*
- * prepare to add a database to the model.
- * this will then re-read it's settings from the
- * settings file - which we dont' want yet !!!!!
- * But now we have the database, it should be possible to
- * alter the code that reads in all settings from a selected
- * file and alter it so it gets them from the db instead.
- * Then remove this database module immediately
- * and let Pamguard create a new one based on the settings !
+ * prepare to add a database to the model. this will then re-read it's settings
+ * from the settings file - which we dont' want yet !!!!! But now we have the
+ * database, it should be possible to alter the code that reads in all settings
+ * from a selected file and alter it so it gets them from the db instead. Then
+ * remove this database module immediately and let Pamguard create a new one
+ * based on the settings !
*/
- // PamModuleInfo mi = PamModuleInfo.findModuleInfo("generalDatabase.DBControl");
- // PamControlledUnitSettings dbSettings = PamSettingManager.getInstance().findGeneralSettings(DBControl.getDbUnitType());
- // if (mi != null) {
- // addModule(mi, "Temporary Database");
- // }
+ // PamModuleInfo mi = PamModuleInfo.findModuleInfo("generalDatabase.DBControl");
+ // PamControlledUnitSettings dbSettings =
+ // PamSettingManager.getInstance().findGeneralSettings(DBControl.getDbUnitType());
+ // if (mi != null) {
+ // addModule(mi, "Temporary Database");
+ // }
- // Add a note to the output console for the user to ignore the SLF4J warning (see http://www.slf4j.org/codes.html#StaticLoggerBinder
- // for details). I spent a few hours trying to get rid of this warning, but without any luck. If you do a google search
- // there are a lot of forum suggestions on how to fix, but none seemed to work for me. Added both slf4j-nop and
- // slf4j-simple to dependency list, neither made a difference. Changed order of dependencies, ran purges and updates,
- // added slf4j-api explicitly, made sure I don't have duplicate bindings, but nothing helped.
- //
+ // Add a note to the output console for the user to ignore the SLF4J warning
+ // (see http://www.slf4j.org/codes.html#StaticLoggerBinder
+ // for details). I spent a few hours trying to get rid of this warning, but
+ // without any luck. If you do a google search
+ // there are a lot of forum suggestions on how to fix, but none seemed to work
+ // for me. Added both slf4j-nop and
+ // slf4j-simple to dependency list, neither made a difference. Changed order of
+ // dependencies, ran purges and updates,
+ // added slf4j-api explicitly, made sure I don't have duplicate bindings, but
+ // nothing helped.
+ //
// Error occurs when PamDataBlock.sortTypeInformation() calls
- // superDetectionClass = GenericTypeResolver.resolveReturnType(method, unitClass); (currently line 397). I don't want
- // to add the note there because that gets called every time a PamDataBlock is created. So I add the note here, which
+ // superDetectionClass = GenericTypeResolver.resolveReturnType(method,
+ // unitClass); (currently line 397). I don't want
+ // to add the note there because that gets called every time a PamDataBlock is
+ // created. So I add the note here, which
// is just before the error occurs
//
- // Oddly enough, this warning DOES NOT occur when running the non-Maven version (Java12 branch). The dependencies in the
- // classpath are the same as the ones here in Maven, so I don't know what to say.
+ // Oddly enough, this warning DOES NOT occur when running the non-Maven version
+ // (Java12 branch). The dependencies in the
+ // classpath are the same as the ones here in Maven, so I don't know what to
+ // say.
System.out.println("");
- System.out.println("Note - ignore the following SLF4J warn/error messages, they are not applicable to this application");
+ 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.
+ * Check for archived files and unpack automatically.
*/
if (runMode == RUN_PAMVIEW && SMRUEnable.isEnable()) {
ZipUnpacker zipUnpacker = new ZipUnpacker(this);
@@ -499,34 +508,34 @@ public class PamController implements PamControllerInterface, PamSettings {
// }
// }
-
/*
* We are running as a remote application, start process straight away!
*/
if (PamSettingManager.RUN_REMOTE == false) {
- addView(guiFrameManager.initPrimaryView(this, pamModelInterface));
+ addView(guiFrameManager.initPrimaryView(this, pamModelInterface));
}
/**
- * Calling this will cause a callback to this.restoreSettings which
- * includes a list of modules which will then get created, and in turn
- * load all of their own settings from the settings manager.
+ * Calling this will cause a callback to this.restoreSettings which includes a
+ * list of modules which will then get created, and in turn load all of their
+ * own settings from the settings manager.
*/
PamSettingManager.getInstance().registerSettings(this);
-
+
/**
- * For offline batch processing a few funnies happen here. We'll be open
- * in viewer mode, but it's likely a psf will have been passed as an input argument.
- * We will therefore have to extract all the modules from that psfx as well and either
- * add them as new modules, or get their settings and use those to update existing settings
- * That should probably be done here before the final calls to setup processes, etc.
+ * For offline batch processing a few funnies happen here. We'll be open in
+ * viewer mode, but it's likely a psf will have been passed as an input
+ * argument. We will therefore have to extract all the modules from that psfx as
+ * well and either add them as new modules, or get their settings and use those
+ * to update existing settings That should probably be done here before the
+ * final calls to setup processes, etc.
*/
if (getRunMode() == RUN_PAMVIEW && PamSettingManager.remote_psf != null) {
loadOtherSettings(PamSettingManager.remote_psf);
}
/*
- * Get any other required modules for this run mode.
+ * Get any other required modules for this run mode.
*/
pamModelInterface.startModel();
@@ -537,107 +546,110 @@ public class PamController implements PamControllerInterface, PamSettings {
*/
if (getRunMode() == RUN_NOTHING) {
- }else if (PamSettingManager.RUN_REMOTE == true) {
+ } else if (PamSettingManager.RUN_REMOTE == true) {
// Initialisation is complete.
initializationComplete = true;
notifyModelChanged(PamControllerInterface.INITIALIZATION_COMPLETE);
System.out.println("Starting Pamguard in REMOTE execution mode.");
pamStart();
- }else{
+ } else {
- // if (getRunMode() == RUN_PAMVIEW) {
- // createViewerStatusBar();
- // }
+ // if (getRunMode() == RUN_PAMVIEW) {
+ // createViewerStatusBar();
+ // }
- // call before initialisation complete, so that processes can re-do.
+ // call before initialisation complete, so that processes can re-do.
createAnnotations();
organiseGUIFrames();
- //sort the frame titles (Swing convenience)
- if (PamGUIManager.isSwing()) sortFrameTitles();
+ // sort the frame titles (Swing convenience)
+ if (PamGUIManager.isSwing())
+ sortFrameTitles();
initializationComplete = true;
notifyModelChanged(PamControllerInterface.INITIALIZATION_COMPLETE);
/**
- * Trigger loading of relationships between markers and mark observers.
- * No need to do anything more than call the constructor and
- * everything else will happen...
+ * Trigger loading of relationships between markers and mark observers. No need
+ * to do anything more than call the constructor and everything else will
+ * happen...
*/
- MarkRelationships.getInstance();
+ MarkRelationships.getInstance();
}
if (getRunMode() == RUN_PAMVIEW) {
/**
- * Tell any modules implementing OfflineDataSource to check
- * their maps.
+ * Tell any modules implementing OfflineDataSource to check their maps.
*/
AWTScheduler.getInstance().scheduleTask(new DataInitialised());
- // PamControlledUnit pcu;
- // OfflineDataSource offlineDataSource;
- // for (int iU = 0; iU < pamControlledUnits.size(); iU++) {
- // pcu = pamControlledUnits.get(iU);
- // if (OfflineDataSource.class.isAssignableFrom(pcu.getClass())) {
- // offlineDataSource = (OfflineDataSource) pcu;
- // offlineDataSource.createOfflineDataMap(null);
- // }
- // }
+ // PamControlledUnit pcu;
+ // OfflineDataSource offlineDataSource;
+ // for (int iU = 0; iU < pamControlledUnits.size(); iU++) {
+ // pcu = pamControlledUnits.get(iU);
+ // if (OfflineDataSource.class.isAssignableFrom(pcu.getClass())) {
+ // offlineDataSource = (OfflineDataSource) pcu;
+ // offlineDataSource.createOfflineDataMap(null);
+ // }
+ // }
- // PamSettingManager.getInstance().registerSettings(new ViewTimesSettings());
- // getNewViewTimes(null);
+ // PamSettingManager.getInstance().registerSettings(new ViewTimesSettings());
+ // getNewViewTimes(null);
}
uidManager.runStartupChecks();
-
+
clearSelectorsAndSymbols();
-
/**
- * Debug code for starting PG as soon as it's initialised.
+ * Debug code for starting PG as soon as it's initialised.
*/
- // SwingUtilities.invokeLater(new Runnable() {
- // @Override
- // public void run() {
- // pamStart();
- // }
- // });
+ // SwingUtilities.invokeLater(new Runnable() {
+ // @Override
+ // public void run() {
+ // pamStart();
+ // }
+ // });
}
-
/**
- * Clear all data selectors and symbol managers. Required since some of these will have loaded as various modules were created,
- * but may also require additional data selectors and symbol managers from super detections which were not availble.
- * Deleting the lot, will cause them to be recreated as soon as they are next needed.
- * Should probably also call these on any call to addModule as well ?
+ * Clear all data selectors and symbol managers. Required since some of these
+ * will have loaded as various modules were created, but may also require
+ * additional data selectors and symbol managers from super detections which
+ * were not availble. Deleting the lot, will cause them to be recreated as soon
+ * as they are next needed. Should probably also call these on any call to
+ * addModule as well ?
*/
- private void clearSelectorsAndSymbols() {
+ private void clearSelectorsAndSymbols() {
DataSelectorCreator.globalClear();
PamSymbolManager.globalClear();
-
+
}
/**
- * This gets called after other data initialisation tasks (such as data mapping).
+ * This gets called after other data initialisation tasks (such as data
+ * mapping).
+ *
* @author dg50
*
*/
class DataInitialised implements Runnable {
@Override
public void run() {
- notifyModelChanged(PamControllerInterface.INITIALIZE_LOADDATA);
- // tell all scrollers to reload their data.
- // loadViewerData();
+ notifyModelChanged(PamControllerInterface.INITIALIZE_LOADDATA);
+ // tell all scrollers to reload their data.
+ // loadViewerData();
}
}
-
/**
* Called when the number of Networked remote stations changes so that the
- * receiver can make a decision as to what to do in terms of
- * preparing detectors, opening files, etc.
- * @param timeMilliseconds
- * @param nPrepared number of remote stations currently prepared (called just before start)
- * @param nStarted number of remote stations currently started
- * @param nStopped number of remote stations currently stopped
+ * receiver can make a decision as to what to do in terms of preparing
+ * detectors, opening files, etc.
+ *
+ * @param timeMilliseconds
+ * @param nPrepared number of remote stations currently prepared (called
+ * just before start)
+ * @param nStarted number of remote stations currently started
+ * @param nStopped number of remote stations currently stopped
*/
public void netReceiveStatus(long timeMilliseconds, int nPrepared, int nStarted, int nStopped) {
if (this.nNetStarted == 0 && nStarted >= 1) {
@@ -653,9 +665,10 @@ public class PamController implements PamControllerInterface, PamSettings {
this.nNetStarted = nStarted;
this.nNetStopped = nStopped;
}
+
/**
- * Loop through all controllers and processes and datablocks and set up all
- * of their annotations.
+ * Loop through all controllers and processes and datablocks and set up all of
+ * their annotations.
*/
private void createAnnotations() {
PamControlledUnit pcu;
@@ -672,32 +685,31 @@ public class PamController implements PamControllerInterface, PamSettings {
if (pp.getSourceDataBlock() == null) {
pp.createAnnotations(true);
}
- // nPdb = pp.getNumOutputDataBlocks();
- // for (int iPdb = 0; iPdb < nPdb; iPdb++) {
- // pdb = pp.getOutputDataBlock(iPdb);
- // pdb.createAnnotations(pp.getSourceDataBlock(), pp);
- // }
+ // nPdb = pp.getNumOutputDataBlocks();
+ // for (int iPdb = 0; iPdb < nPdb; iPdb++) {
+ // pdb = pp.getOutputDataBlock(iPdb);
+ // pdb.createAnnotations(pp.getSourceDataBlock(), pp);
+ // }
}
}
}
/**
- * Organise the GUI frames on start up or after a module was added
- * or after the frames menus have changed.
+ * Organise the GUI frames on start up or after a module was added or after the
+ * frames menus have changed.
*/
private void organiseGUIFrames() {
}
-
- // private void createViewerStatusBar() {
- //
- // viewerStatusBar = new ViewerStatusBar(this);
- // PamStatusBar.getStatusBar().getToolBar().setLayout(new BorderLayout());
- // PamStatusBar.getStatusBar().getToolBar().add(BorderLayout.CENTER,
- // viewerStatusBar.getStatusBarComponent());
- // }
+ // private void createViewerStatusBar() {
+ //
+ // viewerStatusBar = new ViewerStatusBar(this);
+ // PamStatusBar.getStatusBar().getToolBar().setLayout(new BorderLayout());
+ // PamStatusBar.getStatusBar().getToolBar().add(BorderLayout.CENTER,
+ // viewerStatusBar.getStatusBarComponent());
+ // }
void setupProcesses() {
// for (int i = 0; i < pamControlledUnits.size(); i++) {
@@ -707,28 +719,26 @@ public class PamController implements PamControllerInterface, PamSettings {
}
/**
- * Can PAMGUARD shut down. This question is asked in turn to
- * every module. Each module should attempt to make sure it can
- * answer true, e.g. by closing files, but if any module
- * returns false, then canClose() will return false;
- * @return whether it's possible to close PAMGUARD
- * without corrupting or losing data.
+ * Can PAMGUARD shut down. This question is asked in turn to every module. Each
+ * module should attempt to make sure it can answer true, e.g. by closing files,
+ * but if any module returns false, then canClose() will return false;
+ *
+ * @return whether it's possible to close PAMGUARD without corrupting or losing
+ * data.
*/
public boolean canClose() {
return pamConfiguration.canClose();
}
-
/**
- * Called after canClose has returned true to finally tell
- * all modules that PAMGUARD is definitely closing down.so they
- * can free any resources, etc.
+ * Called after canClose has returned true to finally tell all modules that
+ * PAMGUARD is definitely closing down.so they can free any resources, etc.
*/
@Override
public void pamClose() {
getUidManager().runShutDownOps();
-
+
pamConfiguration.pamClose();
}
@@ -736,24 +746,25 @@ public class PamController implements PamControllerInterface, PamSettings {
* Shut down Pamguard
*/
public void shutDownPamguard() {
- // force close the javaFX thread (because it won't close by itself - see Platform.setImplicitExit(false) in constructor
+ // force close the javaFX thread (because it won't close by itself - see
+ // Platform.setImplicitExit(false) in constructor
Platform.exit();
-
+
// terminate the JVM
System.exit(getPamStatus());
}
/**
- * Go through all data blocks in all modules and tell them to save.
- * This has been built into PamProcess and PamDataBlock since we want
- * it to be easy to override this for specific modules / processes / data blocks.
+ * Go through all data blocks in all modules and tell them to save. This has
+ * been built into PamProcess and PamDataBlock since we want it to be easy to
+ * override this for specific modules / processes / data blocks.
*/
public void saveViewerData() {
ArrayList " +
- "If this is a plug-in, the error may have been caused by an incompatibility between " +
- "it and this version of PAMGuard. Please check the developer's website " +
- "for help. " +
- "If this is a core Pamguard module, please copy the error message text and email to" +
- "support@pamguard.org. " +
- "This module will not be loaded.";
+ String msg = "There is an error with the module " + moduleName + ". "
+ + "If this is a plug-in, the error may have been caused by an incompatibility between "
+ + "it and this version of PAMGuard. Please check the developer's website " + "for help. "
+ + "If this is a core Pamguard module, please copy the error message text and email to"
+ + "support@pamguard.org. " + "This module will not be loaded.";
String help = null;
int ans = WarnOnce.showWarning(title, msg, WarnOnce.WARNING_MESSAGE, help, e);
- System.err.println("Exception while loading " + moduleName);
+ System.err.println("Exception while loading " + moduleName);
this.removeControlledUnt(unitBeingLoaded);
- this.clearLoadedUnit();;
+ this.clearLoadedUnit();
+ ;
}
if (unitBeingLoaded == null) {
return null;
}
- // run the unit's setupProcess method. Again, check if nitBeingLoaded=null afterwards because this would indicate
- // that the PamExceptionHandler caught a runtime error during the class instantiation and therefore
- // removed the module to prevent further errors. This could happen due to incompatibilities between
+ // run the unit's setupProcess method. Again, check if nitBeingLoaded=null
+ // afterwards because this would indicate
+ // that the PamExceptionHandler caught a runtime error during the class
+ // instantiation and therefore
+ // removed the module to prevent further errors. This could happen due to
+ // incompatibilities between
// the current version of Pamguard and older plugin modules.
if (initializationComplete) {
unitBeingLoaded.setupControlledUnit();
@@ -855,33 +875,38 @@ public class PamController implements PamControllerInterface, PamSettings {
// move the controlled unit reference to a temp variable, so that we can
// clear the unitBeingLoaded variable and still pass a reference to the
- // new unit back to the calling function. In this way, we can always use
+ // new unit back to the calling function. In this way, we can always use
// the unitBeingLoaded variable as a de facto flag to know whether or not
// a module is currently being loaded
PamControlledUnit unitNowLoaded = unitBeingLoaded;
clearLoadedUnit();
- // guiFrameManager.notifyModelChanged(ADD_CONTROLLEDUNIT); //this should be handled above in addControlledUnit
+ // guiFrameManager.notifyModelChanged(ADD_CONTROLLEDUNIT); //this should be
+ // handled above in addControlledUnit
return unitNowLoaded;
}
- /* (non-Javadoc)
- * @see PamguardMVC.PamControllerInterface#RemoveControlledUnt(PamguardMVC.PamControlledUnit)
+ /*
+ * (non-Javadoc)
+ *
+ * @see PamguardMVC.PamControllerInterface#RemoveControlledUnt(PamguardMVC.
+ * PamControlledUnit)
*/
@Override
public void removeControlledUnt(PamControlledUnit controlledUnit) {
// The PamExceptionHandler will call this to remove a controlled unit that fails
- // during load. Depending when it failed, it may or may not have been instantiated
- // yet. So if the controlledUnit is still null, just exit
- //
- if (controlledUnit==null) {
+ // during load. Depending when it failed, it may or may not have been
+ // instantiated
+ // yet. So if the controlledUnit is still null, just exit
+ //
+ if (controlledUnit == null) {
return;
}
/**
- * NEVER delete the array manager.
+ * NEVER delete the array manager.
*/
if (controlledUnit.getClass() == ArrayManager.class) {
return;
@@ -893,17 +918,19 @@ public class PamController implements PamControllerInterface, PamSettings {
if (removed) {
notifyModelChanged(PamControllerInterface.REMOVE_CONTROLLEDUNIT);
}
- // getMainFrame().revalidate(); //handled inside the GUIFrameManager by notify model changed. The controller should have
- //as few direct GUI calls as possible.
+ // getMainFrame().revalidate(); //handled inside the GUIFrameManager by notify
+ // model changed. The controller should have
+ // as few direct GUI calls as possible.
}
-
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see PamController.PamControllerInterface#orderModules()
*/
@Override
public boolean orderModules(Frame parentFrame) {
- int[] newOrder = ModuleOrderDialog.showDialog(this, parentFrame);
+ int[] newOrder = ModuleOrderDialog.showDialog(this, parentFrame);
if (newOrder != null) {
// re-order the modules according the new list.
pamConfiguration.reOrderModules(newOrder);
@@ -934,8 +961,9 @@ public class PamController implements PamControllerInterface, PamSettings {
// }
/**
- * Swaps the positions of two modules in the main list of modules and
- * also swaps their tabs (if they have them).
+ * Swaps the positions of two modules in the main list of modules and also swaps
+ * their tabs (if they have them).
+ *
* @param m1 First PamControlledUnit to swap
* @param m2 Second PamControlledUnit to swap.
*/
@@ -944,8 +972,9 @@ public class PamController implements PamControllerInterface, PamSettings {
}
/**
- * Sets the position of a particular PamControlledUnit in the list.
- * Also sets the right tab position, to match that order.
+ * Sets the position of a particular PamControlledUnit in the list. Also sets
+ * the right tab position, to match that order.
+ *
* @param pcu
* @param position
* @return
@@ -967,17 +996,21 @@ public class PamController implements PamControllerInterface, PamSettings {
/**
* Get a list of PamControlledUnit units of a given type
+ *
* @param unitType Controlled unit type
- * @return list of units.
+ * @return list of units.
*/
public ArrayList Name can be null in which case the first module with the correct class
- * will be returned
+ *
+ * Name can be null in which case the first module with the correct class will
+ * be returned
+ *
* @param unitClass Module class (sub class of PamControlledUnit)
- * @param unitName Module Name
- * @return Existing module with that class and name.
+ * @param unitName Module Name
+ * @return Existing module with that class and name.
*/
public PamControlledUnit findControlledUnit(Class unitClass, String unitName) {
return pamConfiguration.findControlledUnit(unitClass, unitName);
}
/**
- * Get an Array list of PamControlledUnits of a particular class (exact matches only).
+ * Get an Array list of PamControlledUnits of a particular class (exact matches
+ * only).
+ *
* @param unitClass PamControlledUnit class
- * @return List of current instances of this class.
+ * @return List of current instances of this class.
*/
public ArrayList As well as actually starting PAMGUARD it will write
- * settings to the database and to the binary data store.
+ * Start PAMGUARD. This function also gets called from the GUI menu start button
+ * and from the Network control system.
+ *
+ * As well as actually starting PAMGUARD it will write settings to the database
+ * and to the binary data store.
+ *
* @return true if all modules start successfully
*/
@Override
public boolean pamStart() {
- // Debug.println("PAMController: pamStart");
+ // Debug.println("PAMController: pamStart");
setManualStop(false);
return pamStart(true);
}
/**
- * Start PAMGuard with an option on saving settings.
+ * Start PAMGuard with an option on saving settings.
+ *
* @param saveSettings flag to save settings to database and binary store
* @return true if all modules start successfully
*/
public boolean pamStart(boolean saveSettings) {
- // Debug.println("PAMController: pamStart2");
+ // Debug.println("PAMController: pamStart2");
return pamStart(saveSettings, PamCalendar.getTimeInMillis());
}
/**
- * Starts PAMGuard, but with the option to save settings (to binary and to database)
- * and also to give a specific start time for the session. When data are being received over
- * the network, this may be in the past !
- * @param saveSettings flag to say whether or not settings should be saved.
- * @param startTime start time in millis
+ * Starts PAMGuard, but with the option to save settings (to binary and to
+ * database) and also to give a specific start time for the session. When data
+ * are being received over the network, this may be in the past !
+ *
+ * @param saveSettings flag to say whether or not settings should be saved.
+ * @param startTime start time in millis
* @return true if all modules start successfully
*/
public boolean pamStart(boolean saveSettings, long startTime) {
- // Debug.println("PAMController: pamStart3");
+ // Debug.println("PAMController: pamStart3");
- globalTimeManager.waitForGlobalTime(getMainFrame(),
+ globalTimeManager.waitForGlobalTime(getMainFrame(),
globalTimeManager.getGlobalTimeParameters().getStartupDelay());
manualStop = false;
-
+
ArrayList This is necessary when running in a multi-thread mode
- * since some processes may still be receiving data and may still
- * pass if on to other downstream processes, storage, etc.
+ * Stopping PAMGUARD. Harder than you might think ! First a pamStop() is sent to
+ * all processes, then once that's done, a pamHasStopped is sent to all
+ * Controllers.
+ *
+ * This is necessary when running in a multi-thread mode since some processes
+ * may still be receiving data and may still pass if on to other downstream
+ * processes, storage, etc.
*
*/
@Override
public void pamStop() {
setPamStatus(PAM_STOPPING);
-
+
// start the status check timer, so that we know when all the threads have
// actually stopped
// statusCheckThread = new Thread(new StatusTimer());
@@ -1330,28 +1381,28 @@ public class PamController implements PamControllerInterface, PamSettings {
// tell all controlled units to stop
for (int iU = 0; iU < pamControlledUnits.size(); iU++) {
- for (int iP = 0; iP < pamControlledUnits.get(iU)
- .getNumPamProcesses(); iP++) {
+ for (int iP = 0; iP < pamControlledUnits.get(iU).getNumPamProcesses(); iP++) {
pamControlledUnits.get(iU).getPamProcess(iP).pamStop();
}
}
-
+
dumpBufferStatus("In stopping", false);
/*
- * now launch another thread to wait for everything to have stopped, but
- * leave this function so that AWT is released and graphics can update, the
- * wait thread will make a fresh call into AWT which will continue the stopping
- * of everything.
+ * now launch another thread to wait for everything to have stopped, but leave
+ * this function so that AWT is released and graphics can update, the wait
+ * thread will make a fresh call into AWT which will continue the stopping of
+ * everything.
*/
detectorEndThread = new WaitDetectorThread();
Thread t = new Thread(detectorEndThread);
t.start();
}
-
+
/**
- * Non AWT thread that sits and waits for detectors to actually finish their
- * processing, leaving AWT unblocked. Then calls a function back into AWT to
- * finish stopping, which will do stuff like closing binary files.
+ * Non AWT thread that sits and waits for detectors to actually finish their
+ * processing, leaving AWT unblocked. Then calls a function back into AWT to
+ * finish stopping, which will do stuff like closing binary files.
+ *
* @author dg50
*
*/
@@ -1363,7 +1414,8 @@ public class PamController implements PamControllerInterface, PamSettings {
while (checkRunStatus()) {
long t2 = System.currentTimeMillis();
if (t2 - t1 > 5000) {
- System.out.printf("Stopping, but stuck in loop for CheckRunStatus for %3.1fs\n", (double) (t2-t1)/1000.);
+ System.out.printf("Stopping, but stuck in loop for CheckRunStatus for %3.1fs\n",
+ (double) (t2 - t1) / 1000.);
dumpBufferStatus("Stopping stuck in loop", false);
break; // crap out anyway.
}
@@ -1373,66 +1425,67 @@ public class PamController implements PamControllerInterface, PamSettings {
e.printStackTrace();
}
}
- // arrive here when all detectors have ended.
+ // arrive here when all detectors have ended.
finishStopping();
}
-
+
}
-
+
/**
- * Look in every data block, particularly threaded ones, and dump
- * the buffer status. This will have to go via PamProcess so that
- * additional information can be added from any processes that
- * hold additional data in other internal buffers.
- * @param message Message to print prior to dumping buffers for debug.
- * @param sayEmpties dump info even if a buffer is empty (otherwise, only ones that have stuff still)
+ * Look in every data block, particularly threaded ones, and dump the buffer
+ * status. This will have to go via PamProcess so that additional information
+ * can be added from any processes that hold additional data in other internal
+ * buffers.
+ *
+ * @param message Message to print prior to dumping buffers for debug.
+ * @param sayEmpties dump info even if a buffer is empty (otherwise, only ones
+ * that have stuff still)
*/
public void dumpBufferStatus(String message, boolean sayEmpties) {
- if (debugDumpBufferAtRestart == false) return;
-
+ if (debugDumpBufferAtRestart == false)
+ return;
+
System.out.println("**** Dumping process buffer status: " + message);
ArrayList
- * Many of the processes loading data are run in the background in SwingWorker threads
- * scheduled with the AWTScheduler so that they are able to update progress on teh screen
- * @param enable enable or disable the GUI.
+ * Many of the processes loading data are run in the background in SwingWorker
+ * threads scheduled with the AWTScheduler so that they are able to update
+ * progress on teh screen
+ *
+ * @param enable enable or disable the GUI.
*/
public void enableGUIControl(boolean enable) {
- // System.out.println("Enable GUI Control = " + enable);
+ // System.out.println("Enable GUI Control = " + enable);
guiFrameManager.enableGUIControl(enable);
}
- // /**
- // * Load viewer data into all the scrollers.
- // */
- // public void loadViewerData() {
- // // TODO Auto-generated method stub
- // AbstractScrollManager scrollManager = AbstractScrollManager.getScrollManager();
- // scrollManager.reLoad();
- //
- // }
+ // /**
+ // * Load viewer data into all the scrollers.
+ // */
+ // public void loadViewerData() {
+ // // TODO Auto-generated method stub
+ // AbstractScrollManager scrollManager =
+ // AbstractScrollManager.getScrollManager();
+ // scrollManager.reLoad();
+ //
+ // }
boolean loadingOldSettings = false;
/**
- * Flagged true if the manual stop button has been pressed.
- * Used to override the watchdog status.
+ * Flagged true if the manual stop button has been pressed. Used to override the
+ * watchdog status.
*/
private boolean manualStop;
-
/**
* Used when in viewer mode and planning batch processing with a modified
* configuration, i.e. the command line has been supplied a normal viewer mode
- * database and also a psfx file. The settings from the database will already have
- * been loaded, this will load any modules that weren't there and will override all the
- * settings in other modules with these ones (except some specials such as data storage locations)
- * @param psfxFile Name of additional psfx file.
+ * database and also a psfx file. The settings from the database will already
+ * have been loaded, this will load any modules that weren't there and will
+ * override all the settings in other modules with these ones (except some
+ * specials such as data storage locations)
+ *
+ * @param psfxFile Name of additional psfx file.
*/
private boolean loadOtherSettings(String psfxName) {
-
+
File psfxFile = new File(psfxName);
if (psfxFile.exists() == false) {
return false;
@@ -2446,43 +2508,43 @@ public class PamController implements PamControllerInterface, PamSettings {
if (settingsGroup == null) {
return false;
}
-
+
BatchViewSettingsImport importer = new BatchViewSettingsImport(this, settingsGroup);
importer.importSettings();
return true;
}
-
+
/**
- * Called to load a specific set of PAMGUARD settings in
- * viewer mode, which were previously loaded in from a
- * database or binary store.
+ * Called to load a specific set of PAMGUARD settings in viewer mode, which were
+ * previously loaded in from a database or binary store.
+ *
* @param settingsGroup settings information
- * @param initialiseNow Immediately data are loaded, initialise which will load data from storages.
+ * @param initialiseNow Immediately data are loaded, initialise which will load
+ * data from storages.
*/
public void loadOldSettings(PamSettingsGroup settingsGroup) {
loadOldSettings(settingsGroup, true);
}
-
+
/**
- * Called to load a specific set of PAMGUARD settings in
- * viewer mode, which were previously loaded in from a
- * database or binary store.
+ * Called to load a specific set of PAMGUARD settings in viewer mode, which were
+ * previously loaded in from a database or binary store.
+ *
* @param settingsGroup settings information
- * @param initialiseNow Immediately data are loaded, initialise which will load data from storages.
+ * @param initialiseNow Immediately data are loaded, initialise which will load
+ * data from storages.
*/
public void loadOldSettings(PamSettingsGroup settingsGroup, boolean initialiseNow) {
/**
- * Three things to do:
- * 1. consider removing modules which exist but are no longer needed
- * 2. Add modules which aren't present but are needed
- * 3. re-order modules
- * 4. Load settings into modules
- * 5. Ping round an initialisation complete message.
+ * Three things to do: 1. consider removing modules which exist but are no
+ * longer needed 2. Add modules which aren't present but are needed 3. re-order
+ * modules 4. Load settings into modules 5. Ping round an initialisation
+ * complete message.
*/
- // 1. get a list of current modules no longer needed.
+ // 1. get a list of current modules no longer needed.
PamControlledUnit pcu;
ArrayList The first time you use the module and/or load a different type
+ of model e.g. a tensorflow or pytorch model, you must be connected to
+ the internet. You must install the correct version of CUDA for hardware
+ acceleration using an Nvidea GPU. See the currently supported CUDA
+ versions on the Pytorch and Tensorflow websites. You should always have deep learning models in their own folder.
Do not have any additional jar files or other programming related
things (like .dll files) in the same or sub folders. This has been
diff --git a/src/help/classifiers/rawDeepLearningHelp/docs/rawDeepLearning_CreateAndConfig.html b/src/help/classifiers/rawDeepLearningHelp/docs/rawDeepLearning_CreateAndConfig.html
index d9394ad4..47d78312 100644
--- a/src/help/classifiers/rawDeepLearningHelp/docs/rawDeepLearning_CreateAndConfig.html
+++ b/src/help/classifiers/rawDeepLearningHelp/docs/rawDeepLearning_CreateAndConfig.html
@@ -7,20 +7,18 @@
The module can be added from the File> Add modules >
Classifier > Raw deep learning classifier menu or by right
clicking in the data model. More than one instance of the module can
be added if multiple deep learning models are required.
The module settings are opened by selecting the Settings >
Raw deep learning classifier menu. The main settings pane is shown
@@ -28,18 +26,18 @@
and Deep Learning Model
-
+
The main settings pane for the deep learning module with
descriptions
The deep learning module accepts any raw data source i.e., any
- data source that contains raw waveform data. If the data is continuous, e.g. from the Sound Acquisition
module then deep learning detections are saved to PAMGuard's data
management system if they pass a user defined prediction threshold.
@@ -57,7 +55,6 @@
processes. So, for example if channels 0 and 2 are in a group, then
the raw waveform data from both channel 0 and 2 will be saved and can
be used in downstream processes, e.g., for localisation.
The segmentation section defines how the raw data is segmented. Some
@@ -72,7 +69,6 @@
re-merge is the maximum number of segments that can form a single
data unit before a new data unit is automatically created.
The deep learning model section is used to select the deep
learning model. The drop down menu is used to select the framework the
@@ -92,14 +88,12 @@
Once the model has loaded there some unique options depending on
the currently selected framework.
A generic model must be set up via the Advanced menu button.
-
+
@@ -124,8 +118,7 @@
including the shape of the input data e.g. a 100x50 image.
-
+
@@ -146,16 +139,15 @@
transforms and input and output data whenever settings up a new
PAMGuard data model and allow easier sharing of classifiers amongst
researchers.
- If using an AnimalSpot or Ketos model then all transforms are
- automatically set up. The transforms can be viewed and altered via the
- Advanced menu button but in the majority of cases these settings
- should not be used. It is advisable to select "Use default
- segment length" to change the Window length to the
- default for the selected model. Note that this is often necessary for
- Ketos models but usually not a requirement for AnimalSpot models.
+ If using a deep learning model from a supported framework then all
+ transforms are automatically set up. The transforms can be viewed and
+ altered via the Advanced menu button but in the majority of cases
+ these settings should not be used. For some models, it is advisable to
+ select "Use default segment length" to change the Window
+ length to the default for the selected model.
- An AnimalSpot or Ketos model will automatically create a list
- of transforms with the appropriate settings. These is no need to use
- the advanced pane but it is there in case users wish to change
- transform settings for some reason
+ An AnimalSpot, Ketos or other supported deep learning model
+ will automatically create a list of transforms with the appropriate
+ settings. These is no need to use the advanced pane but it is there
+ in case users wish to change transform settings for some reason
Default models are selectable from the menu button in the Deep
+ Learning Pane. Default models are deep learning classifiers which are
+ open source, known to be effective and have have been published in
+ open access academic litrature; they are downloaded directly from a
+ GitHub repository and then all associated settings are automtically
+ applied. The default model selection pane also contains hyperlinks to
+ the papers descirbing each model which will take users directly to the
+ relvent website.
+
+
+ Default models can be downloaded. Default models are models
+ which are published, open and have been known to work well amongst
+ the bioacoustics community. More will be added to PAMGaurd over time.
+ If you you would like your model to become a defualt model then drop
+ PAMGuard support an email.
+ Next:
- Running the Deep Learning module
+ Next: Running the Deep
+ Learning module
+ Output from the deep learning module can be viewed in PAMGuard
viewer mode, or extracted from binary files using MATLAB or R. Detections form continuous raw data are shown in the datagram in
the same way as all data streams in PAMGuard.
@@ -50,7 +50,6 @@
deep learning prediction values. The spectrogram will also show deep
learning detections as translucent blue boxes (these must be selected
in the right click menu). The easiest way to export to MATLAB is to select the desired
units in the time base display, right click and select the MATLAB
@@ -96,7 +95,7 @@ predicitons = dldetections(1).annotations.dlcla
waveform data in each structure; In the same way as MATLAB export, the PAMGuard time base display
and export selected data units directly to an R struct which can be
@@ -165,13 +163,17 @@ tiledlayout(5,5here.
Previous:
- Running the Deep Learning module Next:
- Common Bugs and Mistakes
+ Previous: Running the Deep
+ Learning module
+
+ Next: Common Bugs and Mistakes
+ In real time, the deep learning model runs automatically when
processing starts. A warning will appear if there are issues with the
model and/or it cannot cope with real time speeds.
The deep learning module can be re-run on detector data (e.g.
@@ -26,13 +24,18 @@
Detections without a deep learning annotation will have one added and
detections with an existing annotation will have it overwritten.
Previous:
- Creating and Configuring the Deep Learning module Next:
- Viewing and Exporting Results
+ Previous: Creating
+ and Configuring the Deep Learning module
+
+ Next: Viewing and Exporting
+ Results
+ Note: this module requires an internet connection upon first use
+ to download correct libraries. PAMGuard's deep learning module allows users to deploy a
large variety of deep learning models natively in PAMGuard. It is core
module, fully integrated into PAMGuard's display and data
@@ -19,9 +20,7 @@
signal and can integrate into multiple types of acoustic analysis
workflows, for example post analysis of recorder data or used as part
of real time localisation workflow. The deep learning module accepts raw data from different types
of data sources, e.g. from the Sound Acquisition module, clicks and
clips. It segments data into equal sized chunks with a specified
@@ -32,8 +31,7 @@
learning model, then can be automatically set up by PAMGuard.
Currently there are three implemented frameworks
-
+
@@ -44,7 +42,6 @@
the model are saved and can be viewed in real time (e.g. mitigation)
or in post processing (e.g. data from SoundTraps).
A generic model allows a user to load any model compatible with the
-
ANIMAL-SPOT
is a deep learning based framework which was initially designed for killer
+ href="(https://github.com/ChristianBergler/ORCA-SPOT">killer
whale sound detection) in noise heavy underwater recordings (see Bergler
et al. (2019)). It has now been expanded to a be species independent
@@ -68,21 +64,43 @@
AnimalSpot models will automatically set up their own data transforms
and output classes.
Ketos is an
acoustic deep learning framework based on Tensorflow and developed by
MERIDIAN. It has excellent
resources and tutorials and Python libraries can be installed easily
- via pip. Imported Ketos model will automatically set up their own data
+ via pip. Imported Ketos (.ktpb) models will automatically set up their
+ own data transforms and output classes.
+
+ Koogu is
+ a Python package which allows users to train a deep learning model.
+ Koogu helps users by integrating with some frequency used annotation
+ programs and provides tools to train and test classifiers. Imported
+ Koogu models (.kgu) will automatically set up their own data
transforms and output classes.
+ PAMGuard zip models consist of a deep learning model (either a
+ Tensorflow saved_model.pb or PyTorch *.py model) alongside a
+ PAMGuard metdata file (.pdtf*) within a zip archive. The metadata
+ file contains all the information needed for PAMGaurd to set up the
+ model. PAMGuard will import the zip file, decompress it and search for
+ the relevent deep learning model and metadata file then set up all
+ settings accordingly. This framework allows users to easily share
+ pre-tested PAMGuard compatible models.
+ Next:
- Creating and Configuring the Deep Learning module
+ Next: Creating and
+ Configuring the Deep Learning module
+ PAMGuard's Deep
Learning Module
- Common Bugs and Mistakes
-
+
+ Common bugs and mistakes
+ PAMGuard Deep
- Learning Module
- Creation and Configuration
-
- Creating an instance
- of the module
+ PAMGuard Deep Learning
+ Module
+
+ Creating an instance
+ of the module
- Module settings
+ Module settings
Raw Sound Data
Segmentation
Deep Learning Model
Generic Model
- AnimalSpot and Ketos models
+ Koogu,
+ Ketos, AnimalSpot, PAMGuard zip and delphinID models
Default Models
+
-
-
diff --git a/src/help/classifiers/rawDeepLearningHelp/docs/rawDeepLearning_Results.html b/src/help/classifiers/rawDeepLearningHelp/docs/rawDeepLearning_Results.html
index c02e5cd2..a84d6eb7 100644
--- a/src/help/classifiers/rawDeepLearningHelp/docs/rawDeepLearning_Results.html
+++ b/src/help/classifiers/rawDeepLearningHelp/docs/rawDeepLearning_Results.html
@@ -9,12 +9,12 @@
PAMGuard's Deep
Learning Module
+
+
Viewing and exporting
results
-
PAMGuard viewer mode
MATLAB
-% plot all the spectrograms.
+ % plot all the spectrograms.
clf
tiledlayout(5,5)
for i=5,5Right whale detections from a deep learning model imported
and then plotted in MATLAB
R
-
diff --git a/src/help/classifiers/rawDeepLearningHelp/docs/rawDeepLearning_Running.html b/src/help/classifiers/rawDeepLearningHelp/docs/rawDeepLearning_Running.html
index 5181a525..9d9d2cfe 100644
--- a/src/help/classifiers/rawDeepLearningHelp/docs/rawDeepLearning_Running.html
+++ b/src/help/classifiers/rawDeepLearningHelp/docs/rawDeepLearning_Running.html
@@ -10,12 +10,10 @@
PAMGuard's Deep
Learning Module
Running
-
Real time
Viewer Mode
-
diff --git a/src/help/classifiers/rawDeepLearningHelp/docs/rawDeepLearning_overview.html b/src/help/classifiers/rawDeepLearningHelp/docs/rawDeepLearning_overview.html
index d1b350d9..668b1a52 100644
--- a/src/help/classifiers/rawDeepLearningHelp/docs/rawDeepLearning_overview.html
+++ b/src/help/classifiers/rawDeepLearningHelp/docs/rawDeepLearning_overview.html
@@ -7,10 +7,11 @@
- PAMGuard Deep
- Learning Module
+ PAMGuard's deep
+ learning module
+ Overview
-
- How it works
+ How it works
Generic Model
AnimalSpot
Ketos
Koogu
+ PAMGuardZip
+
-
diff --git a/src/loggerForms/controls/CounterControl.java b/src/loggerForms/controls/CounterControl.java
index 120256ee..b6edf687 100644
--- a/src/loggerForms/controls/CounterControl.java
+++ b/src/loggerForms/controls/CounterControl.java
@@ -21,6 +21,7 @@ public class CounterControl extends SimpleControl {
Character suffix;
+ public enum CounterSuffix {NOSUFFIX, CHARSUFFIX};
public CounterControl(ControlDescription controlDescription,
LoggerForm loggerForm) {
@@ -36,25 +37,19 @@ public class CounterControl extends SimpleControl {
}
-
-
-
-
-
-
private String calculateCounter() {
int num = FormCounterManagement.getInstance().getCounterNumber(this,controlDescription.getFormDescription().getDBTABLENAME());
- String numSt = Integer.toString(num);
- int nZeros = 3-numSt.length();
-
- String tSt = "";
- for (int i=0;i