From 83f1343b02a77e9cc1a372111ae9b682aaa5a572 Mon Sep 17 00:00:00 2001 From: Douglas Gillespie <50671166+douggillespie@users.noreply.github.com> Date: Thu, 29 Sep 2022 14:54:52 +0100 Subject: [PATCH 1/5] Work on bug fixes in CTD classifier --- src/PamController/PamguardVersionInfo.java | 4 ++-- .../simplechi2classifier/Chi2ThresholdClassifier.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PamController/PamguardVersionInfo.java b/src/PamController/PamguardVersionInfo.java index 7e841d23..2e7b0198 100644 --- a/src/PamController/PamguardVersionInfo.java +++ b/src/PamController/PamguardVersionInfo.java @@ -31,12 +31,12 @@ 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.04ac"; + static public final String version = "2.02.04ae"; /** * Release date */ - static public final String date = "22 September 2022"; + static public final String date = "29 September 2022"; // /** // * Release type - Beta or Core diff --git a/src/clickTrainDetector/classification/simplechi2classifier/Chi2ThresholdClassifier.java b/src/clickTrainDetector/classification/simplechi2classifier/Chi2ThresholdClassifier.java index b46eadb1..4d066c81 100644 --- a/src/clickTrainDetector/classification/simplechi2classifier/Chi2ThresholdClassifier.java +++ b/src/clickTrainDetector/classification/simplechi2classifier/Chi2ThresholdClassifier.java @@ -124,7 +124,7 @@ public class Chi2ThresholdClassifier implements CTClassifier { //System.out.println("Data selector: " + dataSelector); if (source!=null) { - dataSelector=source.getDataSelectCreator().getDataSelector(clickTrainControl.getUnitName() + "_" + clssfrParams.classifierName + dataSelector=source.getDataSelectCreator().getDataSelector(clickTrainControl.getUnitName() + "_" + clssfrParams.uniqueID + "_X2_threshold_classifier", false, null); } else { From 682715018f230a07545c6d332efc15a98f622eb9 Mon Sep 17 00:00:00 2001 From: Douglas Gillespie <50671166+douggillespie@users.noreply.github.com> Date: Fri, 30 Sep 2022 14:49:33 +0100 Subject: [PATCH 2/5] couple of final neatenings up of CTD --- .../classification/CTClassifierParams.java | 19 ++++++++++++++++++- .../Chi2ThresholdClassifier.java | 3 +-- .../dataselector/CTDataSelector.java | 4 ++++ .../SimpleCTClassifierPane.java | 2 +- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/clickTrainDetector/classification/CTClassifierParams.java b/src/clickTrainDetector/classification/CTClassifierParams.java index 9768c61f..91d4e8a7 100644 --- a/src/clickTrainDetector/classification/CTClassifierParams.java +++ b/src/clickTrainDetector/classification/CTClassifierParams.java @@ -36,7 +36,7 @@ public class CTClassifierParams implements Cloneable, Serializable, ManagedParam /** * A unique ID for the classifier that never changes. This is important for accessing data selectors. */ - public String uniqueID = UUID.randomUUID().toString(); + private String uniqueID = UUID.randomUUID().toString(); /** @@ -72,4 +72,21 @@ public class CTClassifierParams implements Cloneable, Serializable, ManagedParam return ps; } + /** + * @return the uniqueID + */ + public String getUniqueID() { + if (uniqueID == null) { + uniqueID = UUID.randomUUID().toString(); + } + return uniqueID; + } + + /** + * @param uniqueID the uniqueID to set + */ + public void setUniqueID(String uniqueID) { + this.uniqueID = uniqueID; + } + } diff --git a/src/clickTrainDetector/classification/simplechi2classifier/Chi2ThresholdClassifier.java b/src/clickTrainDetector/classification/simplechi2classifier/Chi2ThresholdClassifier.java index 8cca8403..e7b78e7d 100644 --- a/src/clickTrainDetector/classification/simplechi2classifier/Chi2ThresholdClassifier.java +++ b/src/clickTrainDetector/classification/simplechi2classifier/Chi2ThresholdClassifier.java @@ -119,14 +119,13 @@ public class Chi2ThresholdClassifier implements CTClassifier { public void createDataSelector(PamDataBlock source) { //System.out.println("Create data selector " +" " + clssfrParams.classifierName + " " + clssfrParams.speciesFlag + " " + clssfrParams.uniqueID ); - if (clssfrParams.uniqueID==null) clssfrParams.newUniqueID(); if (dataSelector==null || dataSelector.getPamDataBlock()!=source) { //create the data selector //System.out.println("Data selector: " + dataSelector); if (source!=null) { - dataSelector=source.getDataSelectCreator().getDataSelector(clickTrainControl.getUnitName() + "_" + clssfrParams.uniqueID + dataSelector=source.getDataSelectCreator().getDataSelector(clickTrainControl.getUnitName() + "_" + clssfrParams.getUniqueID() + "_X2_threshold_classifier", false, null); } else { diff --git a/src/clickTrainDetector/dataselector/CTDataSelector.java b/src/clickTrainDetector/dataselector/CTDataSelector.java index 1c6bdade..8fd9e4d7 100644 --- a/src/clickTrainDetector/dataselector/CTDataSelector.java +++ b/src/clickTrainDetector/dataselector/CTDataSelector.java @@ -131,6 +131,10 @@ public class CTDataSelector extends DataSelector { CTDataUnit clickTrain = (CTDataUnit) ctDataUnit; if (clickTrain.ctClassifications==null) return false; + + if (ctSelectParams.classifier == null) { + return false; + } int nClass = clickTrain.ctClassifications.size(); if (ctSelectParams.allowMultipleChoices == false) { diff --git a/src/clickTrainDetector/layout/classification/simplechi2classifier/SimpleCTClassifierPane.java b/src/clickTrainDetector/layout/classification/simplechi2classifier/SimpleCTClassifierPane.java index 8ee87ba5..fa2d9a84 100644 --- a/src/clickTrainDetector/layout/classification/simplechi2classifier/SimpleCTClassifierPane.java +++ b/src/clickTrainDetector/layout/classification/simplechi2classifier/SimpleCTClassifierPane.java @@ -229,7 +229,7 @@ public class SimpleCTClassifierPane extends SettingsPane { simpleChi2Classifier.getDataSelector().getDialogPaneFX().getParams(true); } if (this.currParams != null) { - currParams.uniqueID = this.currParams.uniqueID; + currParams.setUniqueID(this.currParams.getUniqueID()); } return this.currParams=currParams; From 0029fbb1c1dd86d66a743307e45e2930c0584c72 Mon Sep 17 00:00:00 2001 From: Douglas Gillespie <50671166+douggillespie@users.noreply.github.com> Date: Tue, 18 Oct 2022 17:02:49 +0100 Subject: [PATCH 3/5] DWV Import Fixed DWV importer so that a binary file is still created if a DWV file doesn't exist. this is totally normal in quiet conditions, so the correct thing to do is to generate a binary file with no data so that effort is correctly recorded. --- src/soundtrap/DWVConvertInformation.java | 32 +++++++++-- src/soundtrap/DWVConverter.java | 72 ++++++++++++++++++------ src/soundtrap/ImportBCLDialog.java | 20 ++++--- 3 files changed, 93 insertions(+), 31 deletions(-) diff --git a/src/soundtrap/DWVConvertInformation.java b/src/soundtrap/DWVConvertInformation.java index f18caea7..bb0da67b 100644 --- a/src/soundtrap/DWVConvertInformation.java +++ b/src/soundtrap/DWVConvertInformation.java @@ -9,13 +9,17 @@ public class DWVConvertInformation { private STGroupInfo fileGroup; private int nDWV; - private int nDone; + private int nDWVDone; + private int nFileDone; + private int nFile; - public DWVConvertInformation(STGroupInfo fileGroup, int nDWV, int nDone) { + public DWVConvertInformation(STGroupInfo fileGroup, int nFile, int nFileDone, int nDWV, int nDWVDone) { this.fileGroup = fileGroup; + this.nFile = nFile; + this.nFileDone = nFileDone; this.nDWV = nDWV; - this.nDone = nDone; + this.nDWVDone = nDWVDone; } @@ -36,10 +40,26 @@ public class DWVConvertInformation { /** - * @return the nDone + * @return the nDWVDone */ - public int getnDone() { - return nDone; + public int getnDWVDone() { + return nDWVDone; + } + + + /** + * @return the nFileDone + */ + public int getnFileDone() { + return nFileDone; + } + + + /** + * @return the nFile + */ + public int getnFile() { + return nFile; } } diff --git a/src/soundtrap/DWVConverter.java b/src/soundtrap/DWVConverter.java index 1c9d1bc4..ca4ba9d0 100644 --- a/src/soundtrap/DWVConverter.java +++ b/src/soundtrap/DWVConverter.java @@ -81,8 +81,10 @@ public class DWVConverter { binarySource.setBinaryStorageStream(outputStream); binaryStream = clickBinaryDataSource.getBinaryStorageStream(); + int iFile = 0; + int nFile = fileGroups.size(); for (STGroupInfo fileGroup:fileGroups) { - processFiles(fileGroup); + processFiles(fileGroup, nFile, ++iFile); if (keepRunning == false) { break; } @@ -94,16 +96,30 @@ public class DWVConverter { return null; } - private void processFiles(STGroupInfo fileGroup) { - this.publish(new DWVConvertInformation(fileGroup, 0, 0)); - if (fileGroup.hasDWV() == false) return; + private void processFiles(STGroupInfo fileGroup, int nFile, int iFile) { + this.publish(new DWVConvertInformation(fileGroup, nFile, iFile, 0, 0)); + if (fileGroup.hasDWV() == false) { + /* + * Don't do this. In quiet conditions there will be a BCL file with a start and stop time + * but if there were no detections there will be no dwv file. We should make the pgdf file + * in any case so that there is a full PAMGuard record of effort. + * In other circumstances dwv files don't actually have data, in which case there may still be + * a null file, which is not so good. Will have to think about how to report this - perhaps in + * this case it's better not to make a pgdf file to show a genuine gap in the data. + */ +// return; + } BCLReader bclReader = new BCLReader(fileGroup.getBclFile()); boolean ok = bclReader.open(); if (ok == false) return; - DWVReader dwvReader = new DWVReader(fileGroup.getDwvFile(), fileGroup.getDwvInfo()); - dwvReader.openDWV(); - int nDWV = dwvReader.getNumDWV(); - int repStep = Math.max(1, nDWV/100); + int nDWV = 0; + DWVReader dwvReader = null; + if (fileGroup.hasDWV()) { + dwvReader = new DWVReader(fileGroup.getDwvFile(), fileGroup.getDwvInfo()); + dwvReader.openDWV(); + nDWV = dwvReader.getNumDWV(); + } + int repStep = Math.max(10, nDWV/100); int nRead = 0; while (true) { BCLLine bclLine = bclReader.nextBCLLine(); @@ -127,7 +143,7 @@ public class DWVConverter { dataLine(fileGroup, bclLine, dwvReader); nRead++; if (nRead%repStep == 0) { - this.publish(new DWVConvertInformation(fileGroup, nDWV, nRead)); + this.publish(new DWVConvertInformation(fileGroup, nFile, iFile, nDWV, nRead)); } break; @@ -140,10 +156,14 @@ public class DWVConverter { // e.printStackTrace(); // } } + this.publish(new DWVConvertInformation(fileGroup, nFile, iFile, nDWV, nDWV)); } private void dataLine(STGroupInfo fileGroup, BCLLine bclLine, DWVReader dwvReader) { - double[] dwvData = dwvReader.readNextClick(null); + double[] dwvData = null; + if (dwvReader != null) { + dwvData = dwvReader.readNextClick(null); + } if (dwvData == null) { return; // can happen if file didn't flush correclty and some dwv is missing. } @@ -185,21 +205,37 @@ public class DWVConverter { } if (bclLine.getState() == 1) { - long dwvFileStart = fileGroup.getDwvInfo().getTimeInfo().samplingStartTimeUTC; - long wavFileStart = fileGroup.getWavInfo().getTimeInfo().samplingStartTimeUTC; fileStartMicroseconds = bclLine.getMicroSeconds(); - Debug.out.printf("DWV start %s wav start %s bcl start %s\n", PamCalendar.formatDBDateTime(dwvFileStart), - PamCalendar.formatDBDateTime(wavFileStart), PamCalendar.formatDBDateTime(bclLine.getMilliseconds())); + long wavFileStart = fileGroup.getWavInfo().getTimeInfo().samplingStartTimeUTC; + try { + if (fileGroup.getDwvInfo() != null) { + long dwvFileStart = fileGroup.getDwvInfo().getTimeInfo().samplingStartTimeUTC; + Debug.out.printf("DWV start %s wav start %s bcl start %s\n", PamCalendar.formatDBDateTime(dwvFileStart), + PamCalendar.formatDBDateTime(wavFileStart), PamCalendar.formatDBDateTime(bclLine.getMilliseconds())); + } + else { + Debug.out.printf("No DWV File !!! wav start %s bcl start %s\n", + PamCalendar.formatDBDateTime(wavFileStart), PamCalendar.formatDBDateTime(bclLine.getMilliseconds())); + } + } + catch (Exception e) { + System.out.println(e.getMessage()); + } binaryStream.openOutputFiles(bclLine.getMilliseconds()); binaryStream.writeHeader(bclLine.getMilliseconds(), System.currentTimeMillis()); binaryStream.writeModuleHeader(); onEffort = true; } if (bclLine.getState() == 0) { - long dwvFileStop = fileGroup.getDwvInfo().getTimeInfo().samplingStopTimeUTC; - long wavFileStop = fileGroup.getWavInfo().getTimeInfo().samplingStopTimeUTC; - Debug.out.printf("DWV stop %s wav stop %s E stop %s\n", PamCalendar.formatDBDateTime(dwvFileStop), - PamCalendar.formatDBDateTime(wavFileStop), PamCalendar.formatDBDateTime(bclLine.getMilliseconds())); + try { + long dwvFileStop = fileGroup.getDwvInfo().getTimeInfo().samplingStopTimeUTC; + long wavFileStop = fileGroup.getWavInfo().getTimeInfo().samplingStopTimeUTC; + Debug.out.printf("DWV stop %s wav stop %s E stop %s\n", PamCalendar.formatDBDateTime(dwvFileStop), + PamCalendar.formatDBDateTime(wavFileStop), PamCalendar.formatDBDateTime(bclLine.getMilliseconds())); + } + catch (Exception e) { + System.out.println(e.getMessage()); + } binaryStream.writeModuleFooter(); binaryStream.writeFooter(bclLine.getMilliseconds(), System.currentTimeMillis(), BinaryFooter.END_UNKNOWN); binaryStream.closeFile(); diff --git a/src/soundtrap/ImportBCLDialog.java b/src/soundtrap/ImportBCLDialog.java index bff30c88..3582c646 100644 --- a/src/soundtrap/ImportBCLDialog.java +++ b/src/soundtrap/ImportBCLDialog.java @@ -56,7 +56,7 @@ public class ImportBCLDialog extends PamDialog { private JTextField customDateTimeFormat; private JLabel fileCountInfo; private JLabel thisFileInfo; - private JProgressBar allProgress; + private JProgressBar oneFileProgress, totalProgress; private JComboBox detectorName; private int nSoundTraps; private Hashtable uniqueDevices = new Hashtable<>(); @@ -162,8 +162,10 @@ public class ImportBCLDialog extends PamDialog { thisFileInfo = new JLabel(" - "); progressPanel.add(thisFileInfo); - allProgress = new JProgressBar(); - progressPanel.add(allProgress); + totalProgress = new JProgressBar(); + progressPanel.add(totalProgress); + oneFileProgress = new JProgressBar(); + progressPanel.add(oneFileProgress); startButton = new JButton("Start"); getButtonPanel().add(startButton, 0); @@ -388,10 +390,14 @@ public class ImportBCLDialog extends PamDialog { thisFileInfo.setText("NO DWV records"); return; } - int prog = dwvConvertInformation.getnDone() * 100 / dwvConvertInformation.getnDWV(); - allProgress.setValue(prog); - thisFileInfo.setText(String.format("Repacked %d of %d clicks", dwvConvertInformation.getnDone(), - dwvConvertInformation.getnDWV())); + int prog = dwvConvertInformation.getnDWVDone() * 100 / dwvConvertInformation.getnDWV(); + oneFileProgress.setValue(prog); + thisFileInfo.setText(String.format("Repacked %d of %d clicks in file %d of %d", + dwvConvertInformation.getnDWVDone(), dwvConvertInformation.getnDWV(), + dwvConvertInformation.getnFileDone(), dwvConvertInformation.getnFile())); + + prog = dwvConvertInformation.getnFileDone() * 100 / dwvConvertInformation.getnFile(); + totalProgress.setValue(prog); } @Override From abc33adbfda66c950fc0da6cb9d226e4c8aba298 Mon Sep 17 00:00:00 2001 From: Douglas Gillespie <50671166+douggillespie@users.noreply.github.com> Date: Fri, 21 Oct 2022 11:09:35 +0100 Subject: [PATCH 4/5] Error reporting in -nogui A lot of warnings were being issued and trying to use the default window which caused a null pointer when running -nogui. This is fixed by a) not trying to access frames which are null and b) changing the PAMWarning system to write messages to terminal rather than open a dialog. --- README.html | 374 ++++++++++-------- dependency-reduced-pom.xml | 10 +- src/Acquisition/FileInputSystem.java | 2 +- src/PamController/PSFXReadWriter.java | 2 +- src/PamController/PamController.java | 7 +- src/PamController/PamSettingManager.java | 10 +- src/PamController/PamguardVersionInfo.java | 4 +- src/PamModel/PamModel.java | 6 +- src/PamUtils/PamAudioFileFilter.java | 2 +- src/PamUtils/PamExceptionHandler.java | 2 +- src/PamView/dialog/PamDialog.java | 7 +- src/PamView/dialog/warn/WarnOnce.java | 28 +- src/PamguardMVC/uid/binaryUIDFunctions.java | 4 +- src/alarm/actions/email/SendEmailAction.java | 2 +- .../algorithms/BeamAlgoParamsPane.java | 4 +- .../BasicFreqDomBeamFormer.java | 4 +- .../algorithms/mvdr/MVDRalgorithm.java | 4 +- .../offline/CTClassifierOfflineTask.java | 2 +- .../offline/ClickTrainOfflineTask.java | 2 +- src/depthReadout/MccDialog.java | 2 +- src/generalDatabase/DBControl.java | 2 +- src/generalDatabase/DBProcess.java | 2 +- .../lookupTables/LookUpTables.java | 2 +- .../offline/MTClassifierOfflineTask.java | 2 +- src/radardisplay/RadarParameters.java | 2 +- .../offline/DLOfflineTask.java | 2 +- src/rocca/RoccaProcess.java | 4 +- src/rocca/RoccaSpecPopUp.java | 4 +- src/rocca/RoccaWhistleSelect.java | 2 +- src/soundtrap/ImportBCLDialog.java | 4 +- 30 files changed, 273 insertions(+), 231 deletions(-) diff --git a/README.html b/README.html index e399e1e8..901b0c81 100644 --- a/README.html +++ b/README.html @@ -325,7 +325,8 @@ href="http://www.gnu.org/licenses/gpl-3.0-standalone.html">http://www.gnu.org/li

The latest version of PAMGuard has been tested on 64 bit Windows 10. We expect it to work without problems on 64 bit versions of Windows -8 and probably 7.

+8 and probably 7. Some testing has been undertaken on Windows 11 and nothing +unexpected has been noted.

On Windows, download and run the Windows installer.

@@ -364,11 +365,11 @@ you should be able to launch PAMGUARD via an appropriate command line which should be something like:

java --Xms384m -Xmx1024m -Djava.library.path=lib64 -jar PamguardBeta_xxxxxx.jar

+-Xms384m -Xmx4096m -Djava.library.path=lib64 -jar Pamguard_xxxxxx.jar

-

The -Xms384m -Xmx1024m specify the initial and maximum heap -size for the JVM being used to run Pamguard i.e. how much memory it gets to -use. The default max size usually being too low.

+

The -Xms384m -Xmx4096m specify the initial and maximum heap +size for the JVM being used to run Pamguard i.e. how much memory it gets to use. +The default max size usually being too low.

The -Djava.library.path=lib64 tells the JVM that it should look in the folder called "lib64" for the required shared libraries @@ -381,13 +382,16 @@ just run the appropriately named executable (e.g. PamguardBeta_MixedMode.exe or PamguardBeta_ViewerMode.exe):

java --Xms384m -Xmx1024m -Djava.library.path=lib64 -jar PamguardBeta_xxxxxx.jar -v

+-Xms384m -Xmx4096m -Djava.library.path=lib64 -jar PamguardBeta_xxxxxx.jar -v

 

LATEST VERSION 2.02.03 February 2022

+href="#_Latest_Version_2.02.05">LATEST VERSION 2.02.05 October 2022 + +

Version 2.02.03 February 2022

Version 2.02.02 October 2021

@@ -437,64 +441,78 @@ Version 2.00.11 October 2017

Beta Version 2.00.10 June 2017

-

Version -1.15.11 MAY 2017

+

Older Versions

-

Version 1.15.10 -March 2017

+

Latest Version 2.02.05 October 2022

-

Version -1.15.09 January 2017

+

Click Train Detector Features and Bug Fixes

-

Version -1.15.08 November 2016

+

Features

-

Version -1.15.07 November 2016

+

Changes to GUI to make dialog shorter for +low DPI screens.

-

Version -1.15.06 November 2016

+

Complete rewrite of the classification +system to have nested classifiers which can be enabled or disabled.

-

Version 1.15.05 -September 2016

+

Changes to classification GUI to +accommodate the new classification system.

-

Version -1.15.04 July 2016

+

Addition of data selectors to the minimum +number of clicks accepted by the classifier. This allows the click-by-click +classifier and the click train detector to be used to together to improve +classification accuracy.

-

Version -1.15.03 April 2016

+

Bug fixes

-

Version -1.15.02 March 2016

+

Click detection bug fix in kernel which +improved click fragmentation.

-

Version -1.15.00 February 2016

+

Bug fix to database were JSON data from +classifier was being trimmed.

-

Version 1.14.00 -Beta, September 2015

+

Documentation

-

Version 1.13.05 -Beta, July 2015

+

Comprehensive help file including +description of the algorithm, screen grabs and examples.

-

Version 1.13.04 -Beta, June 2015

+

Bug fixes

-

Version 1.13.03 -Beta, March 2015

+

Other Features

-

Version 1.13.02 -Beta, January 2015

+

Help documentation for Backup Manager

-

Version 1.13.01 -Beta, January 2015

+

Help documentation for Matched Click +Classifier

-

Version 1.13.00 -Beta December 2014

+

Database logging of offline tasks (such as +click re-classification, bearing calculation, etc.)

-

Older Versions

+

Data selector for Whistle Classifier module

-

Latest Version -2.02.03 February 2022

+

Variable sound output level when using +National Instruments devices for sound playback.

+ +

Speed improvement when processing flac +audio files.

+ +

Bug Fixes

+ +

Soundtrap DWV import. Will now generate binary +files even if DWV file doesn’t exist (which is correct behavior in quiet +conditions when no clicks were detected).

+ +

Spectrogram. Changes to stop occasional +crashing when restarting processing of wav files.

+ +

Sizing of dialogs on ultra high definition +monitors so that data fields are sized correctly.

+ +

Fixed a memory leak in ROCCA

+ +

Version 2.02.03 +February 2022

Some minor bug fixes following our migration to GitHub. Note that the older Bug numbers only refer to bugs reported on the SVN site. New @@ -640,8 +658,9 @@ lang=EN-US> Improvements to datamap display, to ensure even small images will be shown

4.        -Allow Clip Generator to create both a binary record and a wav file

+lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>       Allow Clip Generator to create both a binary record and a +wav file

5.        @@ -732,10 +751,10 @@ 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.

+(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

@@ -833,8 +852,9 @@ August 2020

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) @@ -985,8 +1005,9 @@ lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'> &nb Added global hotkeys to Logger module.

10.        -Added channel display to noise one band measurement display.

+lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>       Added channel display to noise one band measurement display. +

11.        @@ -1098,17 +1119,18 @@ Bug 447. Viewer mode throws exception when trying to load beamformer localisations

16.        -Bug 448. Detection Group Localiser data units not being loaded in Viewer mode.

+lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>       Bug 448. Detection Group Localiser data units not being +loaded in Viewer mode.

17.        Bug 449. Rocca Encounter Stats output file calculating incorrect values.

18.        -Bug 450. Ishmael Detectors subscribing to FFTDataBlock twice, meaning they -process each data unit 2x doubling the output.

+lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>       Bug 450. Ishmael Detectors subscribing to FFTDataBlock +twice, meaning they process each data unit 2x doubling the output.

Upgrades

@@ -1213,9 +1235,9 @@ lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'> &nb Bug 430. Rocca calculates inflection point parameters incorrectly

5.        -Bug 431. Error when trying to mark section of spectrogram to send to Bearing -Calculator module

+lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>       Bug 431. Error when trying to mark section of spectrogram to +send to Bearing Calculator module

6.        @@ -1326,8 +1348,8 @@ Click Train Detector upgrades, including ability to import time chunks from csv file for batch processing.

3.        -Better display of microseconds in dialogs.

+lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>       Better display of microseconds in dialogs.

4.        @@ -1431,9 +1453,9 @@ lang=EN-US> Matched template classifier extended to handle multiple templates.

5.        -New methods for handling and logging time offsets from the PC clock based -either on GPS NMEA data or on pings of an NTP time server.

+lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>       New methods for handling and logging time offsets from the +PC clock based either on GPS NMEA data or on pings of an NTP time server.

6.        @@ -1489,8 +1511,8 @@ lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'> &nb

Upgrades

1.        -Added decimal degrees option to latitude/longitude dialog.

+lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>       Added decimal degrees option to latitude/longitude dialog.

2.        @@ -1680,8 +1702,8 @@ lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'> &nb

10.        -Bug 376. Error when using a serialised data map which spans a period of -time in which Pamguard modules have changed.

+Bug 376. Error when using a serialised data map which spans a period of time +in which Pamguard modules have changed.

11.        @@ -1799,8 +1821,8 @@ and encouraged to manually fix the database.

-

Beta Version 2.00.12 -January 2018

+

Beta Version +2.00.12 January 2018

PAMGuard Version 2 contains major updates. You should read and understand the notes listed for

+

 

+ +

Older Versions

+

Version 1.15.11 May 2017

@@ -2093,8 +2120,8 @@ list grew to a ridiculous size. Code has been put in place to a) stop it happening again and b) to repair any configuration files which are corrupted. Corrupted files will be slow to load, slow to save and will be > several megabytes in size. It may be necessary to delete the PamguardSettings table in -any databases since these too may have become oversized which will slow down -viewer mode PAMGuard start-up.

+any databases since these too may have become oversized which will slow down viewer +mode PAMGuard start-up.

2.       @@ -2103,8 +2130,8 @@ after the contour was recalculated. This has been corrected.

3.       -Bug 310. When exiting Viewer mode, PAMGuard queries the user whether they -are sure they want to exit without saving even though they selected Bug 310. When exiting Viewer mode, PAMGuard queries the user whether +they are sure they want to exit without saving even though they selected Save and Exit. Corrected, and added an Exit without Save option.

@@ -2227,8 +2254,8 @@ sample rate.

font-stretch: normal'>       Bug 305. Date and Time not being correctly extracted from wav files created using SoundTrap recorders. Fixed by correctly -finding and unpacking information in the accompanying xml log files that come -with SoundTrap files.

+finding and unpacking information in the accompanying xml log files that come with +SoundTrap files.

Version 1.15.06 November 2016

@@ -2267,11 +2294,11 @@ was used. This is fixed.

5.          -Bug 295. If a click has a total length of a single sample, the code attempting -to estimate the time delay between channels would crash. This is now fixed. -This could only occur if both pre sample and post sample were set to 0 in the -click detector, which is generally not a good idea, so this bug may have been -there for some time, it's just that no one noticed before. Fixed

+Bug 295. If a click has a total length of a single sample, the code +attempting to estimate the time delay between channels would crash. This is now +fixed. This could only occur if both pre sample and post sample were set to 0 +in the click detector, which is generally not a good idea, so this bug may have +been there for some time, it's just that no one noticed before. Fixed

6.          @@ -2365,9 +2392,9 @@ automatic click train identification and tracking.

5.       -The automatic click train identification is now using -the same internal structures as the manual tracking, so it's possible to -combine automatic and manual tracking.

+The automatic click train identification is now using the +same internal structures as the manual tracking, so it's possible to combine +automatic and manual tracking.

6.       @@ -2384,9 +2411,9 @@ the future.

Logger Form Design

-

A GUI driven system for designing Logger forms has been released. -Currently, this feature has no online help, but is reasonably intuitive -compared to the old method of typing directly into the database.

+

A GUI driven system for designing Logger forms has been +released. Currently, this feature has no online help, but is reasonably +intuitive compared to the old method of typing directly into the database.

Improved Number handling

@@ -2447,9 +2474,8 @@ today. 

5.        -Bug 277. Text fields in classifier dialog were not large enough to -display times greater than 10ms. We have increased length of text fields in the -dialog.

+Bug 277. Text fields in classifier dialog were not large enough to display +times greater than 10ms. We have increased length of text fields in the dialog.

6.        @@ -2458,17 +2484,17 @@ changes in future releases. New PAMGuard releases will always be able to open older binary files, however, with previous PAMGuard releases if a newer file format was opened, then PAMGuard was unable to check that the file format was newer and would attempt to read the files and might even corrupt them. Now it -will recognise that it cannot open the files, display appropriate error messages -and not attempt to read the files. NOTE that at this time there are no planned -file format changes and that this is purely a future proofing exercise.

+will recognise that it cannot open the files, display appropriate error +messages and not attempt to read the files. NOTE that at this time there are no +planned file format changes and that this is purely a future proofing exercise.

7.        Bug 279. GUI Resizing: The whole PAMGuard GUI would suddenly resize to something very small when a dialog is opened. This has been traced to improper use of a common dialog component SourcePanel which tries to repack its parent -Window. Some programmers had inadvertently set it to repack the main PAMGuard -GUI instead. This has been Fixed.

+Window. Some programmers had inadvertently set it to repack the main PAMGuard GUI +instead. This has been Fixed.

8.        @@ -2542,16 +2568,16 @@ and datagram creation.

Version 1.15.00 February 2016

-

Beta Version 1.15.00 64 bit and Core -version 1.15.00 32 bit. Both using identical Java core software but linking to +

Beta Version 1.15.00 64 bit and Core version +1.15.00 32 bit. Both using identical Java core software but linking to different libraries for control of sound input devices.

This is the first release of a 64 bit -version of PAMGuard. As with the 32 bit version a number of C language libraries -are required to interface to external sound cards and other data acquisition -devices. These have been extensively tested on several different computers, but -may not be as stable as the 32 bit versions. Please report any problems -immediately to the PAMGuard team.

+version of PAMGuard. As with the 32 bit version a number of C language +libraries are required to interface to external sound cards and other data +acquisition devices. These have been extensively tested on several different +computers, but may not be as stable as the 32 bit versions. Please report any +problems immediately to the PAMGuard team.

Other Changes

@@ -2625,8 +2651,8 @@ name="_Toc312065299">Version 1.14.00 Beta, September 2015

The format of configuration files has changed for version -1.14.00. Older configurations will load with this new version, but configurations -saved with 1.14.00 may not open correctly with earlier versions.

+1.14.00. Older configurations will load with this new version, but +configurations saved with 1.14.00 may not open correctly with earlier versions.

PAMGuard Versions 1.14.00 and above will work with Java 8. PAMGuard will continue to work with Java 7, but support for Java 7 will be @@ -2693,9 +2719,9 @@ displaying in the viewer. This is now fixed.

3.        Bug 248. Crash in hydrophone array manager. Bug in -array manager would crash PAMGuard when the click detector was configured with more -channels than the sound acquisition system (almost impossible to achieve, but -someone managed it).

+array manager would crash PAMGuard when the click detector was configured with +more channels than the sound acquisition system (almost impossible to achieve, +but someone managed it).

4.        @@ -2789,9 +2815,9 @@ lang=EN-US>1. +tab of the spectrogram configuration dialog, and also right click on the +spectrogram and select to display the annotations. Annotations are saved to the +database so you will also need a database module in your configuration.  

2.              @@ -2814,9 +2840,9 @@ option with caution !

5.              -The Open Office Database system has been removed from the list of available -options since it is not reliable. If you require a free database solution we -recommend you use the MySql Community Server The Open Office Database system has been removed from the list of +available options since it is not reliable. If you require a free database +solution we recommend you use the MySql Community Server http://dev.mysql.com/downloads/mysql/

4.              -Bug 226. Spectrogram Mark Observer list doesn't refresh when modules -added or removed.

+Bug 226. Spectrogram Mark Observer list doesn't refresh when modules added +or removed.

5.              @@ -2896,9 +2922,9 @@ be specified by the user in the Rocca Parameters dialog Notes tab.

1.     Bug -209. Map zoom level. This was zoomed right into a range of about 1m when new maps -were created. This is now fixed and it starts with a default range of 10km on -the display.

+209. Map zoom level. This was zoomed right into a range of about 1m when new +maps were created. This is now fixed and it starts with a default range of 10km +on the display.

2.     Bug @@ -3187,8 +3213,8 @@ whistle.

. Did not affect band level calculations.
  • Bug in noise band monitor. Crashed when sample rate was exactly 2kHz. Fixed
  • -
  • Memory leak in click detector. Severe - memory leak when processing clicks in viewer mode now fixed.
  • +
  • Memory leak in click detector. + Severe memory leak when processing clicks in viewer mode now fixed.
  • Flickering of click display (http://sourceforge.net/p/pamguard/bugs/191/) now fixed.
  • @@ -3206,8 +3232,6 @@ whistle.

     

    -

    Older Versions

    -

    Version 1.12.00 Beta February 2013

    New Modules

    @@ -3245,14 +3269,14 @@ mode, making is easy to scroll through and view data for short time periods.

    GPS

    -

    Function to import GPS data from other -data sources for the PAMGuard viewer.

    +

    Function to import GPS data from +other data sources for the PAMGuard viewer.

    Database

    -

    Can now copy data from binary -storage to the database offline for any module having both binary and database -storage.

    +

    Can now copy data from binary storage +to the database offline for any module having both binary and database storage. +

    Can create a blank MS Access database (2007 and later *.accdb formats only).

    @@ -3351,12 +3375,12 @@ elements has been fixed.

    '         -Database Speed: A substantial rewriting of some of the indexing methods -in the database module has led to a significant increase in the speed at which data -are written to the database (orders of magnitude for large databases). This is -having a significant impact on the overall reliability of the software. Other -changes have increased the speed (again by orders of magnitude) at which data -are read back into PAMGuard when using the viewer.

    +Database Speed: A substantial rewriting of some of the indexing methods in +the database module has led to a significant increase in the speed at which +data are written to the database (orders of magnitude for large databases). +This is having a significant impact on the overall reliability of the software. +Other changes have increased the speed (again by orders of magnitude) at which +data are read back into PAMGuard when using the viewer.

    '         @@ -3444,9 +3468,9 @@ Symbol'>''         Offline event marking. Offline event marking similar to functionality in -RainbowClick is now available in the PAMGUARD viewer. Event summary data is -stored in the database and can also be exported to text files (e.g. for -importing into the Distance software). 

    +RainbowClick is now available in the PAMGUARD viewer. Event summary data is stored +in the database and can also be exported to text files (e.g. for importing into +the Distance software). 

    '         @@ -3459,8 +3483,8 @@ Symbol'>''         -Bearings can be calculated using the envelope of the waveform rather than -the full waveform. The waveform or envelope can also be filtered prior to +Bearings can be calculated using the envelope of the waveform rather +than the full waveform. The waveform or envelope can also be filtered prior to bearing calculation.

    ''         -Bearing ambiguity resolution for planar and volumetric arrays. New -features in array dialog for estimations of errors on array location. These -feed into to a maximum likelihood estimate of angles from small 2D or 3D sub -arrays to give two polar angle coordinates. this can be used to resolve left -right ambiguity and is implemented for both the click and the whistle/moan -detectors. As a result, the click detector bearing time display can now be set -to go from -180 to 180 degrees rather than 0 - 180 degrees. In this case, -clicks in the upper half of the bearing display will be to port and clicks in -the right half will be to starboard. As you pass a whale which is to port, the -clicks will move UP the display. In the long term, I hope to turn this display -around so that time is up the screen rather than across. 

    +Bearing ambiguity resolution for planar and volumetric arrays. New features +in array dialog for estimations of errors on array location. These feed into to +a maximum likelihood estimate of angles from small 2D or 3D sub arrays to give +two polar angle coordinates. this can be used to resolve left right ambiguity +and is implemented for both the click and the whistle/moan detectors. As a +result, the click detector bearing time display can now be set to go from -180 +to 180 degrees rather than 0 - 180 degrees. In this case, clicks in the upper +half of the bearing display will be to port and clicks in the right half will +be to starboard. As you pass a whale which is to port, the clicks will move UP +the display. In the long term, I hope to turn this display around so that time +is up the screen rather than across. 

    Small features and bug fixes

    @@ -4110,10 +4134,10 @@ help pages

    Bug Fixes

    -

    Memory leak caused by Night / Day colour manager now fixed. -This would cause memory leaks when multiple files were being analysed off-line -and would eventually crash PAMGUARD. The way that colours are managed in -PAMGUARD has been rewritten. 

    +

    Memory leak caused by Night / Day colour manager now fixed. This +would cause memory leaks when multiple files were being analysed off-line and +would eventually crash PAMGUARD. The way that colours are managed in PAMGUARD +has been rewritten. 

    Some issues with Swing fixed that might have been causing hang ups on startup especially on Macs/Linux machines

    @@ -4184,8 +4208,8 @@ file)

    Changes

    -

    The User Input module (for text entry of information by the -user) has been moved from the Displays sub menu of the Add Modules menu, to +

    The User Input module (for text entry of information by the user) +has been moved from the Displays sub menu of the Add Modules menu, to Utilities. This will not affect how existing settings files are loaded.

    Multi-screen environments.

    @@ -4356,8 +4380,8 @@ channels or textual content change.

    '         -Model viewer. Have stopped it from jumping on top of the main PAMGUARD - display when dialogs are closed.

    +Model viewer. Have stopped it from jumping on top of the main PAMGUARD  display +when dialogs are closed.

    '         @@ -4688,12 +4712,12 @@ and Ishmael-type detectors and localisers.

    Information from above modules can be displayed on configurable user displays which support real time scrolling spectrograms and radar displays. Detection and localisation information can be optionally -displayed on the map display.Map enhancements include improved scrolling -whereby the user can click and drag to pan the area. PamGuard can now interface -with MySQL database servers and users can easily select which information is -logged. (This replaces the previous 'flat-file' logging feature). A simulation -module allows virtual vocalising animals to be placed on the map to assist in -training and development. Extensive online user help has been added to PamGuard +displayed on the map display.Map enhancements include improved scrolling whereby +the user can click and drag to pan the area. PamGuard can now interface with +MySQL database servers and users can easily select which information is logged. +(This replaces the previous 'flat-file' logging feature). A simulation module +allows virtual vocalising animals to be placed on the map to assist in training +and development. Extensive online user help has been added to PamGuard Application

    0.03b - first version used in a real 'at sea' environment.18/08/06

    diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml index 5c0901f5..ab94c57a 100644 --- a/dependency-reduced-pom.xml +++ b/dependency-reduced-pom.xml @@ -4,7 +4,7 @@ org.pamguard Pamguard Pamguard Java12+ - 2.02.04a + 2.02.04ae Pamguard for Java 12+, using Maven to control dependcies www.pamguard.org @@ -163,14 +163,6 @@ Unidata netCDF https://artifacts.unidata.ucar.edu/repository/unidata-all/ - - - false - - geomajas - geomajas - http://maven.geomajas.org/ - false diff --git a/src/Acquisition/FileInputSystem.java b/src/Acquisition/FileInputSystem.java index fc12d573..7ee5fb35 100644 --- a/src/Acquisition/FileInputSystem.java +++ b/src/Acquisition/FileInputSystem.java @@ -622,7 +622,7 @@ public class FileInputSystem extends DaqSystem implements ActionListener, PamSe "

    Please check to ensure that the file exists, and that the path entered in PAMGuard is correct.

    " + "

    Note this error may also indicate that the file is corrupt and unreadable by PAMGuard.

    "; String help = null; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.WARNING_MESSAGE, help); + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help); return false; } diff --git a/src/PamController/PSFXReadWriter.java b/src/PamController/PSFXReadWriter.java index 50fbaac8..b3c07cd0 100644 --- a/src/PamController/PSFXReadWriter.java +++ b/src/PamController/PSFXReadWriter.java @@ -178,7 +178,7 @@ public class PSFXReadWriter { * occurr when running under PAMDog control. */ if (pamBuoyGlobals.getNetworkControlPort() == null) { - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.WARNING_MESSAGE, help); + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help); } else { /* diff --git a/src/PamController/PamController.java b/src/PamController/PamController.java index b15d0ee1..af85a10d 100644 --- a/src/PamController/PamController.java +++ b/src/PamController/PamController.java @@ -2731,7 +2731,12 @@ public class PamController implements PamControllerInterface, PamSettings { @Override public GuiFrameManager getGuiFrameManager() { - return (GuiFrameManager) guiFrameManager; + if (guiFrameManager instanceof GuiFrameManager) { + return (GuiFrameManager) guiFrameManager; + } + else { + return null; + } } public void sortFrameTitles(){ diff --git a/src/PamController/PamSettingManager.java b/src/PamController/PamSettingManager.java index e0abc8e8..782c1a05 100644 --- a/src/PamController/PamSettingManager.java +++ b/src/PamController/PamSettingManager.java @@ -536,7 +536,7 @@ public class PamSettingManager { "This could occur if the psf file location is in a read-only folder, or the filename is " + "invalid. Please check and try again."; String help = null; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.WARNING_MESSAGE, help); + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help); } } /** @@ -1292,7 +1292,7 @@ public class PamSettingManager { "loads it may have lost it's settings. Please check before performing any analysis.

    "; String help = null; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.WARNING_MESSAGE, help); + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help); break; } @@ -1312,7 +1312,7 @@ public class PamSettingManager { "It is likely that an older version of Java is trying to load a class which is from a newer version. " + "This module will not be loaded, and will be removed from the psf file to prevent instabilities."; String help = null; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.WARNING_MESSAGE, help); + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help); System.err.println("Exception while loading " + Ex.getMessage()); } catch (ClassNotFoundException Ex){ @@ -1327,7 +1327,7 @@ public class PamSettingManager { "depending on which modules are being used and if they've changed between versions. It is recommended that you " + "check all module configuration parameters to verify the information is still accurate, prior to running. "; 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); } // print and continue - there may be other things we can deal with. @@ -1341,7 +1341,7 @@ public class PamSettingManager { "support@pamguard.org.

    " + "This module will not be loaded, and will be removed from the psf file to prevent instabilities."; 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 " + Ex.getMessage()); } } diff --git a/src/PamController/PamguardVersionInfo.java b/src/PamController/PamguardVersionInfo.java index 3dba8808..01258c63 100644 --- a/src/PamController/PamguardVersionInfo.java +++ b/src/PamController/PamguardVersionInfo.java @@ -31,12 +31,12 @@ 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.04ae"; + static public final String version = "2.02.05"; /** * Release date */ - static public final String date = "3 October 2022"; + static public final String date = "21 October 2022"; // /** // * Release type - Beta or Core diff --git a/src/PamModel/PamModel.java b/src/PamModel/PamModel.java index e26b59df..4a70c05e 100644 --- a/src/PamModel/PamModel.java +++ b/src/PamModel/PamModel.java @@ -1255,7 +1255,7 @@ final public class PamModel implements PamModelInterface, PamSettings { "for help.

    " + "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); continue; } @@ -1269,7 +1269,7 @@ final public class PamModel implements PamModelInterface, PamSettings { "for help.

    " + "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; } @@ -1360,7 +1360,7 @@ final public class PamModel implements PamModelInterface, PamSettings { "for help.

    " + "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; diff --git a/src/PamUtils/PamAudioFileFilter.java b/src/PamUtils/PamAudioFileFilter.java index 138689b7..1ed40470 100644 --- a/src/PamUtils/PamAudioFileFilter.java +++ b/src/PamUtils/PamAudioFileFilter.java @@ -15,7 +15,7 @@ public class PamAudioFileFilter extends PamFileFilter { // addFileType(".AIFF"); // addFileType(".FLAC"); addFileType(".flac"); - addFileType(".sud"); +// addFileType(".sud"); } } diff --git a/src/PamUtils/PamExceptionHandler.java b/src/PamUtils/PamExceptionHandler.java index 44722dac..28b91103 100644 --- a/src/PamUtils/PamExceptionHandler.java +++ b/src/PamUtils/PamExceptionHandler.java @@ -35,7 +35,7 @@ public class PamExceptionHandler implements Thread.UncaughtExceptionHandler { "for help.

    " + "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, exception); + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help, exception); System.err.println("Exception while loading " + pluginInterface); exception.printStackTrace(); } else { diff --git a/src/PamView/dialog/PamDialog.java b/src/PamView/dialog/PamDialog.java index 80d7a459..e3c94234 100644 --- a/src/PamView/dialog/PamDialog.java +++ b/src/PamView/dialog/PamDialog.java @@ -63,6 +63,7 @@ abstract public class PamDialog extends JDialog { private String warningTitle; private boolean warnDefaultSetting = true; private CancelObserver cancelObserver; + private boolean firstShowing = true; public JPanel getButtonPanel() { return buttonPanel; @@ -146,7 +147,7 @@ abstract public class PamDialog extends JDialog { return parentFrame; } try { - return PamController.getInstance().getGuiFrameManager().getFrame(0); + return PamController.getMainFrame(); } catch (Exception e) { return null; @@ -283,6 +284,10 @@ abstract public class PamDialog extends JDialog { if (getOwner() == null) { moveToMouseLocation(); } + if (firstShowing) { + firstShowing = false; + super.pack(); + } } try{ super.setVisible(visible); diff --git a/src/PamView/dialog/warn/WarnOnce.java b/src/PamView/dialog/warn/WarnOnce.java index 6efc5b79..bee48997 100644 --- a/src/PamView/dialog/warn/WarnOnce.java +++ b/src/PamView/dialog/warn/WarnOnce.java @@ -88,7 +88,7 @@ public class WarnOnce implements PamSettings { public static int showWarning(String title, String message, int messageType, String helpPoint, Throwable error, String okButtonText, String cancelButtonText) { if (PamGUIManager.isSwing()) { - return singleInstance.showWarningDialog(PamController.getInstance().getGuiFrameManager().getFrame(0), + return singleInstance.showWarningDialog(PamController.getMainFrame(), title, message, messageType, helpPoint, error, okButtonText, cancelButtonText); } else if (PamGUIManager.isFX()) { @@ -220,7 +220,7 @@ public class WarnOnce implements PamSettings { * otherwise OK_OPTION will always be returned. */ public static int showWarning(Window parent, String title, String message, int messageType, String helpPoint, Throwable error) { - if (! PamController.checkIfNetworkControlled()) { + if (canShowDialog()) { return singleInstance.showWarningDialog(parent, title, message, messageType, helpPoint, error, null, null); } else { System.out.println(" "); @@ -231,6 +231,16 @@ public class WarnOnce implements PamSettings { } } + private static boolean canShowDialog() { + if (PamController.checkIfNetworkControlled()) { + return false; + } + if (PamGUIManager.getGUIType() == PamGUIManager.NOGUI) { + return false; + } + return true; + } + /** * Show a warning message. * @param parent parent frame @@ -361,10 +371,16 @@ public class WarnOnce implements PamSettings { } // show the warning - WarnOnceDialog wo = new WarnOnceDialog(parent, title, message, messageType, helpPoint, error, okButtonText, cancelButtonText); - warnOnceList.setShowWarning(messageName, wo.isShowAgain()); - showThisSess.put(messageName, wo.isShowThisSess()); - return wo.getAnswer(); + if (canShowDialog()) { + WarnOnceDialog wo = new WarnOnceDialog(parent, title, message, messageType, helpPoint, error, okButtonText, cancelButtonText); + warnOnceList.setShowWarning(messageName, wo.isShowAgain()); + showThisSess.put(messageName, wo.isShowThisSess()); + return wo.getAnswer(); + } + else { + System.out.println(message); + return OK_OPTION; + } } diff --git a/src/PamguardMVC/uid/binaryUIDFunctions.java b/src/PamguardMVC/uid/binaryUIDFunctions.java index 274e5bee..d5d89d30 100644 --- a/src/PamguardMVC/uid/binaryUIDFunctions.java +++ b/src/PamguardMVC/uid/binaryUIDFunctions.java @@ -320,7 +320,7 @@ public class binaryUIDFunctions { + footer.getHighestUID() + ". It is not possible to know whether all of the original data objects have been recovered.

    "; String help = null; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help); } } @@ -429,7 +429,7 @@ public class binaryUIDFunctions { + " data objects. The last object UID recovered is " + footer.getHighestUID() + ". It is not possible to know whether all of the original data objects have been recovered.

    "; String help = null; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help); } } diff --git a/src/alarm/actions/email/SendEmailAction.java b/src/alarm/actions/email/SendEmailAction.java index affefc79..d422193e 100644 --- a/src/alarm/actions/email/SendEmailAction.java +++ b/src/alarm/actions/email/SendEmailAction.java @@ -263,7 +263,7 @@ public class SendEmailAction extends AlarmAction implements PamSettings { ". The alarm will not be able to send emails until " + "this is fixed. Please check the Alarm Email Settings to ensure they are correct."; String help = null; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.WARNING_MESSAGE, help, e); + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help, e); e.printStackTrace(); emailReady=AlarmAction.ALARM_CANT_DO; } diff --git a/src/beamformer/algorithms/BeamAlgoParamsPane.java b/src/beamformer/algorithms/BeamAlgoParamsPane.java index 78d6e230..5810d848 100644 --- a/src/beamformer/algorithms/BeamAlgoParamsPane.java +++ b/src/beamformer/algorithms/BeamAlgoParamsPane.java @@ -1346,7 +1346,7 @@ public class BeamAlgoParamsPane extends SettingsPane { "The beamformer needs this information in order to run. There will be no output until " + "a valid Acquisition module is added and the Pamguard run is restarted."; String help = null; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.WARNING_MESSAGE, help, e); + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help, e); sourceProcess=null; e.printStackTrace(); return; @@ -1357,7 +1357,7 @@ public class BeamAlgoParamsPane extends SettingsPane { "The beamformer needs this information in order to run. There will be no output until " + "a valid Acquisition module is added and the Pamguard run is restarted."; String help = null; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.WARNING_MESSAGE, help, null); + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help, null); return; } diff --git a/src/beamformer/algorithms/basicFreqDomain/BasicFreqDomBeamFormer.java b/src/beamformer/algorithms/basicFreqDomain/BasicFreqDomBeamFormer.java index 15502545..6e20c08f 100644 --- a/src/beamformer/algorithms/basicFreqDomain/BasicFreqDomBeamFormer.java +++ b/src/beamformer/algorithms/basicFreqDomain/BasicFreqDomBeamFormer.java @@ -226,7 +226,7 @@ public class BasicFreqDomBeamFormer implements BeamFormerAlgorithm { "The beamformer needs this information in order to run. There will be no output until " + "a valid Acquisition module is added and the Pamguard run is restarted."; String help = null; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.WARNING_MESSAGE, help, e); + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help, e); sourceProcess=null; e.printStackTrace(); return; @@ -237,7 +237,7 @@ public class BasicFreqDomBeamFormer implements BeamFormerAlgorithm { "The beamformer needs this information in order to run. There will be no output until " + "a valid Acquisition module is added and the Pamguard run is restarted."; String help = null; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.WARNING_MESSAGE, help, null); + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help, null); return; } diff --git a/src/beamformer/algorithms/mvdr/MVDRalgorithm.java b/src/beamformer/algorithms/mvdr/MVDRalgorithm.java index 6c5c47e1..050566f6 100644 --- a/src/beamformer/algorithms/mvdr/MVDRalgorithm.java +++ b/src/beamformer/algorithms/mvdr/MVDRalgorithm.java @@ -257,7 +257,7 @@ public class MVDRalgorithm implements BeamFormerAlgorithm { "The beamformer needs this information in order to run. There will be no output until " + "a valid Acquisition module is added and the Pamguard run is restarted."; String help = null; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.WARNING_MESSAGE, help, e); + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help, e); sourceProcess=null; e.printStackTrace(); return; @@ -268,7 +268,7 @@ public class MVDRalgorithm implements BeamFormerAlgorithm { "The beamformer needs this information in order to run. There will be no output until " + "a valid Acquisition module is added and the Pamguard run is restarted."; String help = null; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.WARNING_MESSAGE, help, null); + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help, null); return; } diff --git a/src/clickTrainDetector/offline/CTClassifierOfflineTask.java b/src/clickTrainDetector/offline/CTClassifierOfflineTask.java index 4dd9b084..1daf99c8 100644 --- a/src/clickTrainDetector/offline/CTClassifierOfflineTask.java +++ b/src/clickTrainDetector/offline/CTClassifierOfflineTask.java @@ -52,7 +52,7 @@ public class CTClassifierOfflineTask extends OfflineTask { // Debug.out.println("Hello: CTDataUnit: UID " + ctDataUnit.getUID() + " " + ctDataUnit.getSubDetectionsCount()); // } - clickTrainControl.getSwingGUI().showSettingsDialog(PamController.getInstance().getGuiFrameManager().getFrame(0), true); + clickTrainControl.getSwingGUI().showSettingsDialog(PamController.getMainFrame(), true); return true; } diff --git a/src/clickTrainDetector/offline/ClickTrainOfflineTask.java b/src/clickTrainDetector/offline/ClickTrainOfflineTask.java index b858badb..6d583a2d 100644 --- a/src/clickTrainDetector/offline/ClickTrainOfflineTask.java +++ b/src/clickTrainDetector/offline/ClickTrainOfflineTask.java @@ -156,7 +156,7 @@ public class ClickTrainOfflineTask extends OfflineTask> { @Override public boolean callSettings() { - clickTrainControl.getSwingGUI().showSettingsDialog(PamController.getInstance().getGuiFrameManager().getFrame(0), false); + clickTrainControl.getSwingGUI().showSettingsDialog(PamController.getMainFrame(), false); return true; } diff --git a/src/depthReadout/MccDialog.java b/src/depthReadout/MccDialog.java index cd3de156..6134c588 100644 --- a/src/depthReadout/MccDialog.java +++ b/src/depthReadout/MccDialog.java @@ -386,7 +386,7 @@ public class MccDialog extends PamDialog { String msg = "

    PAMGuard cannot find an analog input device. Please ensure that you have a " + "device plugged into your computer, and you have the correct drivers installed.

    "; String help = null; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.WARNING_MESSAGE, help); + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help); return; } if (mccDepthParameters.iBoard >= 0 && diff --git a/src/generalDatabase/DBControl.java b/src/generalDatabase/DBControl.java index 031d8232..96adf97f 100644 --- a/src/generalDatabase/DBControl.java +++ b/src/generalDatabase/DBControl.java @@ -229,7 +229,7 @@ PamSettingsSource { "be configured to be looking in a different folder. Please check the expected folder location, as well " + "as the PAMGuard settings."; String help = null; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.WARNING_MESSAGE, help); + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help); return false; } if (forcedName == null) { diff --git a/src/generalDatabase/DBProcess.java b/src/generalDatabase/DBProcess.java index 805f33b0..75b9b027 100644 --- a/src/generalDatabase/DBProcess.java +++ b/src/generalDatabase/DBProcess.java @@ -290,7 +290,7 @@ public class DBProcess extends PamProcess { + theForm.getUdfTableDefinition().getTableName() + " with the " + theForm.getFormName() + " form format currently in memory. If this is correct, press Ok. If you do not want to " + "change the format stored in the database, press Cancel.

    "; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.OK_CANCEL_OPTION); if (ans == WarnOnce.CANCEL_OPTION) { continue; diff --git a/src/generalDatabase/lookupTables/LookUpTables.java b/src/generalDatabase/lookupTables/LookUpTables.java index 16ca640c..daea762f 100644 --- a/src/generalDatabase/lookupTables/LookUpTables.java +++ b/src/generalDatabase/lookupTables/LookUpTables.java @@ -152,7 +152,7 @@ public class LookUpTables { String msg = "PAMGuard is about to modify the Lookup table in the database. It will be adding new rows to the end of the table, possibly " + "duplicating existing topics if you are switching from a database that already had Lookup information.

    " + "If this is correct, press Ok. If you do not want to change the database table, press Cancel.

    "; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.OK_CANCEL_OPTION); + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.OK_CANCEL_OPTION); if (ans==WarnOnce.CANCEL_OPTION) { return false; } diff --git a/src/matchedTemplateClassifer/offline/MTClassifierOfflineTask.java b/src/matchedTemplateClassifer/offline/MTClassifierOfflineTask.java index 04483690..99b9ca68 100644 --- a/src/matchedTemplateClassifer/offline/MTClassifierOfflineTask.java +++ b/src/matchedTemplateClassifer/offline/MTClassifierOfflineTask.java @@ -110,7 +110,7 @@ public class MTClassifierOfflineTask extends OfflineTask> { @Override public boolean callSettings() { - mtClassifierControl.showSettingsDialog(PamController.getInstance().getGuiFrameManager().getFrame(0)); + mtClassifierControl.showSettingsDialog(PamController.getMainFrame()); return true; } diff --git a/src/radardisplay/RadarParameters.java b/src/radardisplay/RadarParameters.java index ddf936e7..9f7f61a3 100644 --- a/src/radardisplay/RadarParameters.java +++ b/src/radardisplay/RadarParameters.java @@ -172,7 +172,7 @@ public class RadarParameters extends UserFrameParameters implements Serializable String msg = "

    The Radar Display parameters have been upgraded. Please open the " + "Radar Display dialog panel to ensure that the correct datablocks are being displayed

    "; String help = null; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.WARNING_MESSAGE, help); + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help); } @Override diff --git a/src/rawDeepLearningClassifier/offline/DLOfflineTask.java b/src/rawDeepLearningClassifier/offline/DLOfflineTask.java index 0e2aa265..5d9f8d97 100644 --- a/src/rawDeepLearningClassifier/offline/DLOfflineTask.java +++ b/src/rawDeepLearningClassifier/offline/DLOfflineTask.java @@ -121,7 +121,7 @@ public class DLOfflineTask extends OfflineTask>{ @Override public boolean callSettings() { - dlControl.showSettingsDialog(PamController.getInstance().getGuiFrameManager().getFrame(0)); + dlControl.showSettingsDialog(PamController.getMainFrame()); return true; } diff --git a/src/rocca/RoccaProcess.java b/src/rocca/RoccaProcess.java index f49ff04d..b21709df 100644 --- a/src/rocca/RoccaProcess.java +++ b/src/rocca/RoccaProcess.java @@ -940,7 +940,7 @@ public class RoccaProcess extends PamProcess { "This will happen when re-analyzing data that has already been analyzed, but it may " + "also indicate that your filename template is inadequate and returning duplicate filenames.

    "; String help = null; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.WARNING_MESSAGE, help); + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help); } @@ -1088,7 +1088,7 @@ public class RoccaProcess extends PamProcess { "This will happen when re-analyzing data that has already been analyzed, but it may " + "also indicate that your filename template is inadequate and returning duplicate filenames.

    "; String help = null; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.WARNING_MESSAGE, help); + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help); } diff --git a/src/rocca/RoccaSpecPopUp.java b/src/rocca/RoccaSpecPopUp.java index 7cc42fe8..ffd39d34 100644 --- a/src/rocca/RoccaSpecPopUp.java +++ b/src/rocca/RoccaSpecPopUp.java @@ -2025,7 +2025,7 @@ public class RoccaSpecPopUp extends javax.swing.JPanel { "This will happen when re-analyzing data that has already been analyzed, but it may " + "also indicate that your filename template is inadequate and returning duplicate filenames.

    "; String help = null; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.WARNING_MESSAGE, help); + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help); } @@ -2361,7 +2361,7 @@ public class RoccaSpecPopUp extends javax.swing.JPanel { "This will happen when re-analyzing data that has already been analyzed, but it may " + "also indicate that your filename template is inadequate and returning duplicate filenames.

    "; String help = null; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.WARNING_MESSAGE, help); + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help); } diff --git a/src/rocca/RoccaWhistleSelect.java b/src/rocca/RoccaWhistleSelect.java index 72f1f59e..100d4289 100644 --- a/src/rocca/RoccaWhistleSelect.java +++ b/src/rocca/RoccaWhistleSelect.java @@ -187,7 +187,7 @@ public class RoccaWhistleSelect extends PamProcess implements SpectrogramMarkObs "underlying detection information necessary to recalculate ancillary variables (e.g. time between detections, detection density, " + "detections/second, etc). You will need to start a new Encounter to ensure all variables are calculated correctly.

    "; String help = null; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.WARNING_MESSAGE, help); + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.WARNING_MESSAGE, help); String dummy = roccaControl.roccaSidePanel.sidePanel.addASighting(false); } diff --git a/src/soundtrap/ImportBCLDialog.java b/src/soundtrap/ImportBCLDialog.java index 3582c646..a0396d8c 100644 --- a/src/soundtrap/ImportBCLDialog.java +++ b/src/soundtrap/ImportBCLDialog.java @@ -466,7 +466,7 @@ public class ImportBCLDialog extends PamDialog { ". The file may be corrupt, or missing information needed. Import is suspended; " + "Please fix the file manually or remove it from the folder, and try to import again."; String help = null; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.OK_OPTION, null, null, "Cancel Import", null); + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.OK_OPTION, null, null, "Cancel Import", null); break; } @@ -479,7 +479,7 @@ public class ImportBCLDialog extends PamDialog { ". PAMGuard is trying to use the format " + customDateTimeFormat.getText() + " but without " + "success. Please change the format in this dialog to match the one used for SamplingStartTimeUTC in your *.log.xml files"; String help = null; - int ans = WarnOnce.showWarning(PamController.getInstance().getGuiFrameManager().getFrame(0), title, msg, WarnOnce.OK_OPTION, null, null, "Cancel Import", null); + int ans = WarnOnce.showWarning(PamController.getMainFrame(), title, msg, WarnOnce.OK_OPTION, null, null, "Cancel Import", null); // if (ans == WarnOnce.OK_OPTION) { break; // } From aa7f18eaa2ad85b248e52f06ff7d2fbe6a773f11 Mon Sep 17 00:00:00 2001 From: Douglas Gillespie <50671166+douggillespie@users.noreply.github.com> Date: Wed, 2 Nov 2022 10:09:30 +0000 Subject: [PATCH 5/5] SAIL CArd warnings Don't display in dialog when in nogui mode. Write to terminal --- src/hfDaqCard/SmruDaqSystem.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/hfDaqCard/SmruDaqSystem.java b/src/hfDaqCard/SmruDaqSystem.java index 1d78e824..c6af0d72 100644 --- a/src/hfDaqCard/SmruDaqSystem.java +++ b/src/hfDaqCard/SmruDaqSystem.java @@ -17,6 +17,7 @@ import Acquisition.DaqSystem; import Acquisition.AudioDataQueue; import PamController.PamControlledUnitSettings; import PamController.PamController; +import PamController.PamGUIManager; import PamController.PamSettingManager; import PamController.PamSettings; import PamDetection.RawDataUnit; @@ -192,7 +193,12 @@ public class SmruDaqSystem extends DaqSystem implements PamSettings { + " in another instance of PAMGuard. \n" + "Check that no other instances of PAMGuard are open and try again. \nIf no other instances of PAMGuard are open " + "then you should cycle the power on the card(s) and restart PAMGuard"); - JOptionPane.showMessageDialog(daqControl.getGuiFrame(), msg, daqControl.getUnitName() + " Error", JOptionPane.ERROR_MESSAGE); + if (PamGUIManager.getGUIType() == PamGUIManager.NOGUI) { + System.out.println(msg); + } + else { + JOptionPane.showMessageDialog(daqControl.getGuiFrame(), msg, daqControl.getUnitName() + " Error", JOptionPane.ERROR_MESSAGE); + } PamController.getInstance().stopLater(); return false; }