diff --git a/README.html b/README.html index fb666f0c..2ad17f31 100644 --- a/README.html +++ b/README.html @@ -450,7 +450,9 @@ Version 2.00.10 June 2017 name="_Latest_Version_2.02.06">Latest Version 2.02.06 November 2022 -

Bug Fix

+

Bug Fixes

+ +

Two memory leaks:

A memory leak has been found which seems to mostly occur in Viewer mode. Some data on background noise measurements are not @@ -458,13 +460,16 @@ being cleared from memory, so memory will eventually run out. This could happen after browsing a lot of data, but was most likely when reprocessing files offline, for example running click classifiers. This is now fixed.

+

Also fixed a memory leak in the ROCCA +whistle classification module.

+

New Features

SoundTrap SUD file reading. If you’re using SoundTrap autonomous recorders from Ocean Instruments, you no longer need to decompress the SoundTrap files prior to processing. This will save time and a lot of disk space. Extraction of clicks from the inbuilt SoundTrap Click -detector an also happen while processing SUD file data with other detectors, +detector can also happen while processing SUD file data with other detectors, thereby streamlining the whole processing chain. Read the online Help for details.   

@@ -483,10 +488,10 @@ system to have nested classifiers which can be enabled or disabled.

Changes to classification GUI to accommodate the new classification system.

-

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.

+

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.

Bug fixes

@@ -586,8 +591,9 @@ 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.

Version 2.02.01 October 2021

@@ -633,9 +639,9 @@ href="http://www.pamguard.org/downloads.php?cat_id=3">here.

lang=EN-US>

This module has been renamed “Detection Grouper”, so -as to avoid confusion with the Group 3D localizer. This is because the Detection -Grouper is more for organizing data into groups to be localized than it is for -doing localization.

+as to avoid confusion with the Group 3D localizer. This is because the +Detection Grouper is more for organizing data into groups to be localized than +it is for doing localization.

Minor Bug Fixes

@@ -695,9 +701,9 @@ Implemented a Backup Manager for backing up multiple types of data to multiple locations]

6.        -Upgrades to how PAMGuard lets the user enter custom date formats in the Sound -Acquisition dialog

+lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>       Upgrades to how PAMGuard lets the user enter custom date +formats in the Sound Acquisition dialog

7.        lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>       An implementation of the Generalized Power Law Detector, developed by Tyler Helble ([Helble et al., ‘A generalized power-law detection algorithm for -humpback whale vocalizations’, The Journal of the Acoustical Society of America, -vol. 131, no. 4, pp. 2682–2699, 2012) is now available. For details, see the -online help

+humpback whale vocalizations’, The Journal of the Acoustical Society of +America, vol. 131, no. 4, pp. 2682–2699, 2012) is now available. For +details, see the online help

18.        @@ -1063,11 +1069,10 @@ placement, etc.

Version 2.01.03 February 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.

+

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.

This version of PAMGuard has been bundled with Java 13 (release 13.0.1). PSFX files generated in previous beta releases (2.xx.xx) @@ -1122,8 +1127,9 @@ lang=EN-US> Bug 442. BT Display does not change click symbol color when Colour By Superdetection is selected.

11.        -Bug 443. NI playback crashing immediately if a device is not present.

+lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>       Bug 443. NI playback crashing immediately if a device is not +present.

12.        @@ -1132,8 +1138,8 @@ files.

13.        -Bug 445. Overlay data in FX spectrogram display gets out of sync with -underlying spectrogram image.

+Bug 445. Overlay data in FX spectrogram display gets out of sync with underlying +spectrogram image.

14.        @@ -1172,19 +1178,19 @@ Added option in Sound Acquisition settings dialog to override filename time stamp and use PC local time instead.

3.        -Add option to Whistle & Moan Detector data selector to only display -whistles that have super-detections.

+lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>       Add option to Whistle & Moan Detector data selector to +only display whistles that have super-detections.

4.        -Functionality to clone hydrophone streamers.

+lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>       Functionality to clone hydrophone streamers.

5.        Added automatic log file - all messages to the console will now be written to a -txt file as well. File is stored in user.home/Pamguard folder - look under the Help -menu item for a shortcut to open the folder.

+txt file as well. File is stored in user.home/Pamguard folder - look under the +Help menu item for a shortcut to open the folder.

6.        @@ -1222,9 +1228,9 @@ Detector display.

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.

+lang=EN-US> 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.        @@ -1282,8 +1288,9 @@ lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'> &nb lang=EN-US> Difar enhancements based on recent field testing.

3.        -Click Train Detector upgrades, including localisation capabilities.

+lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>       Click Train Detector upgrades, including localisation +capabilities.

4.        Added adaptive noise filter to Ishmael Detectors.

5.        Many upgrades to the Sound Playback module, including a -high-pass filter, gain control, and the ability to mix wavefrom and envelope -data together to listen to high-frequency clicks and dolphin whistles at the -same time.

+high-pass filter, gain control, and the ability to mix wavefrom and envelope data +together to listen to high-frequency clicks and dolphin whistles at the same +time.

6.        @@ -1584,8 +1591,8 @@ first time the spectrogram dialog is opened.

4.        -Bug 385. Bug in offline toolbar which will crash if the classifier dialog -is opened and then closed with no classifiers specified.

+Bug 385. Bug in offline toolbar which will crash if the classifier +dialog is opened and then closed with no classifiers specified.

5.        @@ -1866,9 +1873,9 @@ window.

2.       -Bug 336. Files were being corrupted if the limit file size option was set -to a lower value in viewer than it has been when data were collected - would -truncate files being rewritten after change.

+Bug 336. Files were being corrupted if the limit file size option was +set to a lower value in viewer than it has been when data were collected - +would truncate files being rewritten after change.

3.       @@ -1972,8 +1979,8 @@ lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'> &nb Added sound playback and other useful information to bar on FX display

2.        -Updates/bug fixes to the landmark module.

+lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>       Updates/bug fixes to the landmark module.

3.       

Beta Version 2.00.10 June 2017

-

PAMGuard Version 2 contains major updates. You -should read and understand these notes before proceeding with installation and -use of this version. These changes have been funded under contract to NOAA +

PAMGuard Version 2 contains major updates. +You should read and understand these notes before proceeding with installation +and use of this version. These changes have been funded under contract to NOAA Fisheries, contract no. WE-133F-16-SE-1126.

Binary File Structural Changes

@@ -2046,9 +2053,9 @@ in both data stores.

added to PAMGuard which can display multiple types of data on the same time axis. It can for instance be used to display bearings to whistles on a bearing-time type display similar to that commonly used in the click detector. -Composite display graphs containing data from more than one detector are also possible. -For details, see the PAMGuard help file (Displays / Time Display FX). Note that -this display is only available if you are running Java 8 or later.

+Composite display graphs containing data from more than one detector are also +possible. For details, see the PAMGuard help file (Displays / Time Display FX). +Note that this display is only available if you are running Java 8 or later.

Event Marking and the Detection Group Localiser

@@ -2101,8 +2108,8 @@ lang=EN-US> 

1.       -Bug 317. Rocca Module Data Purging. The ROCCA -module was not performing data purging when using classifiers developed for +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.

2. &nb

1.       -Added Copy-to-Clipboard button to Warning dialogs, to store error messages -and stack trace information on the Windows clipboard. This information can then -be easily pasted into emails, text documents, etc when contacting Pamguard -support.

+Added Copy-to-Clipboard button to Warning dialogs, to store error +messages and stack trace information on the Windows clipboard. This information +can then be easily pasted into emails, text documents, etc when contacting +Pamguard support.

2.       @@ -2149,8 +2156,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.       @@ -2197,9 +2204,9 @@ January 2017

1.        Bug 306. Certain methods have been querying -AcousticDataUnit.getDuration and expecting to receive a response in milliseconds. -However, getDuration actually returns the number of samples.  This has -been corrected.

+AcousticDataUnit.getDuration and expecting to receive a response in +milliseconds. However, getDuration actually returns the number of samples. + This has been corrected.

Plug-Ins

@@ -2242,9 +2249,9 @@ dependencies)

Other Changes

-

The installer has been updated to handle both -64 bit and 32 bit installations. PAMGuard psf files are now registered in the -Windows Registry, so double-clicking on a psf file should run PAMGuard in +

The installer has been updated to handle +both 64 bit and 32 bit installations. PAMGuard psf files are now registered in +the Windows Registry, so double-clicking on a psf file should run PAMGuard in normal mode (as opposed to Viewer or Mixed modes). Note that the Windows Registry can only hold a single executable reference for psf files; therefore, for users with multiple installations of PAMGuard, double-clicking on a psf @@ -2307,8 +2314,8 @@ until now. It's fixed.

2.          -Bug 292. Incorrect labels on Target Motion panel in viewer - 3D algorithm -was labelled as 2D.Fixed

+Bug 292. Incorrect labels on Target Motion panel in viewer - 3D +algorithm was labelled as 2D.Fixed

3.          @@ -2337,8 +2344,8 @@ appear when you right click on the display.

7.          -Bug 297. Airgun display was not correctly showing itself at fixed locations, -but always following the vessel track. This is now fixed.

+Bug 297. Airgun display was not correctly showing itself at fixed +locations, but always following the vessel track. This is now fixed.

8.          @@ -2404,8 +2411,8 @@ the database.

2.       The number of data streams associated with the click -detector has been tidied up so that there are a) All Click, b) Tracked Clicks (those -which are part of an event) and c) Events.

+detector has been tidied up so that there are a) All Click, b) Tracked Clicks +(those which are part of an event) and c) Events.

3.       @@ -2427,9 +2434,9 @@ combine automatic and manual tracking.

6.       -Improved options are available to the user, via the click -detector bearing time display, to correct and relabel clicks / entire click -trains.

+Improved options are available to the user, via the +click detector bearing time display, to correct and relabel clicks / entire +click trains.

Developers will hopefully find that the target motion code has been improved in a way which will make it much easier to @@ -2448,21 +2455,22 @@ intuitive compared to the old method of typing directly into the database.

Users have often found that PAMGuard can be 'jumpy', i.e. the spectrogram does not scroll smoothly, but pauses for a second -every few seconds. This is caused by the Java garbage collector cleaning up unused -objects in memory. With 64 bit versions, which allow for more memory, some of -these pauses were becoming quite long (due to the increased amount of memory -that needed to be cleaned up). In some circumstances, these pauses were making -data acquisition systems unstable. We have therefore entirely rewritten the way -in which PAMGuard handles arrays of spectrogram data (complex numbers) so that -instead of large numbers of small Java objects there are now fewer, larger, -simpler java objects. These reduce processing delays for garbage collection and -give an overall speed improvement, but will otherwise not be noticed by users.

+every few seconds. This is caused by the Java garbage collector cleaning up +unused objects in memory. With 64 bit versions, which allow for more memory, +some of these pauses were becoming quite long (due to the increased amount of +memory that needed to be cleaned up). In some circumstances, these pauses were +making data acquisition systems unstable. We have therefore entirely rewritten +the way in which PAMGuard handles arrays of spectrogram data (complex numbers) +so that instead of large numbers of small Java objects there are now fewer, +larger, simpler java objects. These reduce processing delays for garbage collection +and give an overall speed improvement, but will otherwise not be noticed by +users.

Click Detector RainbowClick file output

This feature has been removed since it has -been obsolete for several years. Users should use the PAMGuard binary storage -system for Click Detector data.

+been obsolete for several years. Users should use the PAMGuard binary storage system +for Click Detector data.

Version 1.15.04 July 2016

@@ -2597,16 +2605,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.

+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

@@ -2646,9 +2654,9 @@ contains queries. Fixed.

2.       -Bug 254. Lookup lists failing in imported SQLite databases. -This was caused by the system 'padding' topic's with blank spaces and is -now fixed.

+Bug 254. Lookup lists failing in imported SQLite +databases. This was caused by the system 'padding' topic's with blank +spaces and is now fixed.

3.       @@ -2748,9 +2756,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.        @@ -2759,8 +2767,8 @@ events.

5.        -Bug 250. DIFAR module was crashing if it attempted to -triangulate between more than two simultaneous bearings. Fixed.

+Bug 250. DIFAR module was crashing if it attempted to triangulate +between more than two simultaneous bearings. Fixed.

6.        @@ -2769,8 +2777,8 @@ lang=EN-US>6.7.        Bug 252. Bug which plotted bearings to whistle and moan -detections from the front hydrophone rather than the central position between hydrophones -now fixed.

+detections from the front hydrophone rather than the central position between +hydrophones now fixed.

 

@@ -2980,9 +2988,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.

 

@@ -3072,17 +3079,17 @@ PAMGuard should be started and stopped using the red and black buttons.

DIFAR (Localisation Group)

This module, funded by the Australian Antarctic Division -allows the de-multiplexing and calculation of angles from military style DIFAR sonobuoys. -See online help for details. 

+allows the de-multiplexing and calculation of angles from military style DIFAR +sonobuoys. See online help for details. 

MEAL Localiser (Localisation Group)

This module, developed by Jamie Macaulay of St Andrews University estimates the 3D localisation of clicks using a variety of algorithms. It's primarily been developed to track harbour porpoise in three -dimensions over scales of 10's of metres. While currently only working with -output from the click detector, we hope eventually to extend its use to -whistles as well.

+dimensions over scales of 10's of metres. While currently only working with output +from the click detector, we hope eventually to extend its use to whistles as +well.

Accelerometer Readout (Sensors group)

@@ -3152,11 +3159,10 @@ different. Details are available in the online help.

FLAC File Support

Can now read raw audio data direct from FLAC files. FLAC is a lossless compression -algorithm for audio data. Files, or folders of files are accessed in the same -way as WAV and AIFF files in the Sound Acquisition module. In a future release -we also hope to provide support for writing FLAC files from the sound recorder -module.

+href="http://en.wikipedia.org/wiki/FLAC">FLAC is a lossless compression algorithm +for audio data. Files, or folders of files are accessed in the same way as WAV +and AIFF files in the Sound Acquisition module. In a future release we also +hope to provide support for writing FLAC files from the sound recorder module.

Sound Recorder Module

@@ -3169,14 +3175,14 @@ Millisecond time is also now included in the output file names.

Datagram options in Viewer have been improved so that the user has to verify the time binning for datagrams the first time the viewer is -run and can also change the time bins from the File menu (See the -File/BinaryStore/Datagram options menu.

+run and can also change the time bins from the File menu (See the File/BinaryStore/Datagram +options menu.

Viewer Configuration

-

The Viewer configuration is now saved into a separate database -table from 'normal' settings so that Viewer can run at same time as normal -operation, but with slightly different display settings.

+

The Viewer configuration is now saved into a separate +database table from 'normal' settings so that Viewer can run at same time as +normal operation, but with slightly different display settings.

Spectrogram Display

@@ -3222,8 +3228,8 @@ whistle.

longer possible to change configurations once PAMGuard has been launched and pressing 'Cancel' on the select dialog causes PAMGuard to exit.
  • Airgun display. If this was - included in the PAMGuard model before the GPS module it would hang - PAMGuard. This has been rectified.
  • + included in the PAMGuard model before the GPS module it would hang PAMGuard. + This has been rectified.
  • Fixed occasional exceptions in the sound output modules when playing back from files.
  • Fixed exceptions in spectrogram @@ -3252,10 +3258,11 @@ whistle.

  • Storage options (https://sourceforge.net/p/pamguard/bugs/175/) whereby clicks were stored to database is now fixed.
  • -
  • Sound Recorder output folder is now - defaulting to the User folder (Generally C:\Users\username\PAMRecordings) - instead of C:\Program Files (x86)\PamguardBeta which didn't work since the - software doesn't have write access to that folder.
  • +
  • Sound Recorder output folder is + now defaulting to the User folder (Generally + C:\Users\username\PAMRecordings) instead of C:\Program Files + (x86)\PamguardBeta which didn't work since the software doesn't have write + access to that folder.
  •  

    @@ -3342,9 +3349,9 @@ information correctly in the binary files.

    Logger Forms

    -

    A substantial amount of work has been -carried out on Logger forms, funded by the South West fisheries Science Center. -

    +

    A substantial amount of work has +been carried out on Logger forms, funded by the South West fisheries Science +Center.

    Click Detector

    @@ -3403,8 +3410,8 @@ 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 +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 @@ -3626,10 +3633,10 @@ source, even if that data source is loaded after the FFT module is created.

    1. Binary storage module.

    -

    Performs a parallel role to the PAMGAURD database but uses -binary files in a proprietary format which is considerably more efficient for -data of unknown length such as whistle contours or small clips of click -waveform. This feature is currently implemented in the following modules:

    +

    Performs a parallel role to the PAMGAURD database but uses binary +files in a proprietary format which is considerably more efficient for data of +unknown length such as whistle contours or small clips of click waveform. This +feature is currently implemented in the following modules:

    '         @@ -3645,11 +3652,11 @@ Symbol'>''         -Note that this does not (yet) permit simultaneous acquisition and -playback through

    +Note that this does not (yet) permit simultaneous acquisition and playback +through

    '         @@ -4076,10 +4083,10 @@ 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. 

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

    '         diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml index cb5efca5..28b56066 100644 --- a/dependency-reduced-pom.xml +++ b/dependency-reduced-pom.xml @@ -4,7 +4,7 @@ org.pamguard Pamguard Pamguard Java12+ - 2.02.05a + 2.02.06 Pamguard for Java 12+, using Maven to control dependcies www.pamguard.org diff --git a/src/Acquisition/AcquisitionControl.java b/src/Acquisition/AcquisitionControl.java index e1f1025c..150fc411 100644 --- a/src/Acquisition/AcquisitionControl.java +++ b/src/Acquisition/AcquisitionControl.java @@ -210,14 +210,8 @@ public class AcquisitionControl extends PamControlledUnit implements PamSettings else { PamStatusBar statusBar = PamStatusBar.getStatusBar(); - if (statusBar != null) { - // statusBar.getToolBar().add(statusBarText = new JLabel()); - // fillStatusBarText(); - // statusBar.getToolBar().add(levelBar = new JProgressBar(-60, 0)); - // levelBar.setValue(-60); - // levelBar.setOrientation(JProgressBar.HORIZONTAL); + if (statusBar != null && statusBarComponent != null) { statusBar.add(statusBarComponent); -// statusBar.getToolBar().addSeparator(); setupStatusBar(); } } @@ -248,6 +242,7 @@ public class AcquisitionControl extends PamControlledUnit implements PamSettings private PamPanel systemPanel; + protected Component getStatusBarComponent() { PamPanel p = new PamPanel(); p.add(statusBarText = new PamLabel()); diff --git a/src/generalDatabase/DatabaseFetchSpeed.java b/src/generalDatabase/DatabaseFetchSpeed.java new file mode 100644 index 00000000..e9748300 --- /dev/null +++ b/src/generalDatabase/DatabaseFetchSpeed.java @@ -0,0 +1,33 @@ +package generalDatabase; + +/** + * Run some tests to try to work out why it's so much slower to load + * data when the query is based on a non indexed column compared + * to an index one, even though the actual query execution time + * is a small fraction of the total time. + * @author dg50 + * + */ +public class DatabaseFetchSpeed { + + String dbName = "C:\\ProjectData\\meyGenMayData\\Database\\MeygenTritechDetectHDD_03_24.06.2022.sqlite3"; + long[] idRange = {9906111, 9906977}; + long[] uidRange = {8030630, 8031496}; + String[] utcRange = {"2022-05-24 09:27:34", "2022-05-24 09:27:52"}; + + public static void main(String[] args) { + // TODO Auto-generated method stub + + } + + public DatabaseFetchSpeed() { +// +// qStr{1} = sprintf('SELECT Id FROM Gemini_Threshold_Detector_Targets WHERE Id BETWEEN %d and %d', ... +// idRange(1), idRange(2)); +// qStr{2} = sprintf('SELECT Id FROM Gemini_Threshold_Detector_Targets WHERE UID BETWEEN %d and %d', ... +// uidRange(1), uidRange(2)); +// qStr{3} = sprintf('SELECT Id FROM Gemini_Threshold_Detector_Targets WHERE UTC BETWEEN ''%s'' and ''%s''', ... +// utcRange{1}, utcRange{2}); + + } +} diff --git a/src/soundtrap/STAcquisitionControl.java b/src/soundtrap/STAcquisitionControl.java index b99a2623..09eebc77 100644 --- a/src/soundtrap/STAcquisitionControl.java +++ b/src/soundtrap/STAcquisitionControl.java @@ -24,7 +24,10 @@ package soundtrap; +import java.awt.Component; + import Acquisition.AcquisitionControl; +import Acquisition.DaqSystem; /** * @author SCANS @@ -34,6 +37,14 @@ public class STAcquisitionControl extends AcquisitionControl { public static final String STUNITTYPE = "SoundTrap Data Acquisition"; private STAcquisitionProcess stAcquisitionProcess; + private STDaqSystem stDaqSystem; + + /* + * Standard voltage for soundtrap data. note that ST calibration is only + * provided as end to end peak input, so the correct thing to do is set the peak to peak as 2 + * (0-peak = 1) and then put the hydrophone sensitivity as - the end to end and all will be well. + */ + public static final double SOUNDTRAPVP2P = 2.0; /** * @param name @@ -41,46 +52,12 @@ public class STAcquisitionControl extends AcquisitionControl { public STAcquisitionControl(String name) { super(name); -// super(STUNITTYPE, name); -// -// acquisitionControl = this; -// -// fileDate = new StandardFileDate(this); -// -// pamController = PamController.getInstance(); -// -// registerDaqSystem(new FileInputSystem(this)); -// registerDaqSystem(folderSystem = new FolderInputSystem(this)); -// -// daqChannelListManager = new DAQChannelListManager(this); -// -// PamSettingManager.getInstance().registerSettings(this); -// -// addPamProcess(acquisitionProcess = new STAcquisitionProcess(this)); -// -// daqMenuEnabler = new MenuItemEnabler(); -// -// statusBarComponent = getStatusBarComponent(); -// -// if (isViewer) { -// offlineFileServer = new OfflineFileServer(this, fileDate); -// } -// else { -// PamStatusBar statusBar = PamStatusBar.getStatusBar(); -// -// if (statusBar != null) { -// statusBar.getToolBar().add(statusBarComponent); -// statusBar.getToolBar().addSeparator(); -// setupStatusBar(); -// } -// } -// setSelectedSystem(); -// -// TDDataProviderRegisterFX.getInstance().registerDataInfo(new RawSoundProviderFX(this)); - // add a second PAM process, for the click data + registerDaqSystem(stDaqSystem = new STDaqSystem()); addPamProcess(stAcquisitionProcess = new STAcquisitionProcess(this)); + acquisitionParameters.voltsPeak2Peak = SOUNDTRAPVP2P; + } @Override @@ -101,6 +78,30 @@ public class STAcquisitionControl extends AcquisitionControl { return stAcquisitionProcess; } +// @Override +// protected Component getStatusBarComponent() { +// // call it to create the fields, just incase, then return null; +// super.getStatusBarComponent(); +// return null; +// } + +// @Override +// protected void setupStatusBar() { +//// if (systemPanel == null) return; +//// systemPanel.removeAll(); +//// DaqSystem daqSys = findDaqSystem(null); +//// if (daqSys == null) return; +//// Component specialComponent = daqSys.getStatusBarComponent(); +//// if (specialComponent != null) { +//// systemPanel.add(specialComponent); +//// } +// } + + @Override + public DaqSystem findDaqSystem(String systemType) { + return stDaqSystem; + } + } diff --git a/src/soundtrap/STClickControl.java b/src/soundtrap/STClickControl.java index 0ef6a8d2..0f251106 100644 --- a/src/soundtrap/STClickControl.java +++ b/src/soundtrap/STClickControl.java @@ -63,7 +63,7 @@ public class STClickControl extends ClickControl { super(name); // create a private acquisition control that only this module can see - rawSource = new AcquisitionControl("Private Sound Acq for Soundtrap Click Detector"); + rawSource = new STAcquisitionControl("Private Sound Acq for Soundtrap Click Detector"); sudFileDWVHandler = new SudFileDWVHandler(this); sudFileDWVHandler.subscribeSUD(); diff --git a/src/soundtrap/STDaqSystem.java b/src/soundtrap/STDaqSystem.java new file mode 100644 index 00000000..d65f2417 --- /dev/null +++ b/src/soundtrap/STDaqSystem.java @@ -0,0 +1,107 @@ +package soundtrap; + +import javax.swing.JComponent; + +import Acquisition.AcquisitionControl; +import Acquisition.AcquisitionDialog; +import Acquisition.DaqSystem; + +public class STDaqSystem extends DaqSystem { + + public STDaqSystem() { + // TODO Auto-generated constructor stub + } + + @Override + public String getSystemType() { + return "SoundTrap clicks"; + } + + @Override + public String getSystemName() { + return "SoundTrap clicks"; + } + + @Override + public JComponent getDaqSpecificDialogComponent(AcquisitionDialog acquisitionDialog) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void dialogSetParams() { + // TODO Auto-generated method stub + + } + + @Override + public boolean dialogGetParams() { + // TODO Auto-generated method stub + return false; + } + + @Override + public int getMaxSampleRate() { + return PARAMETER_UNKNOWN; + } + + @Override + public int getMaxChannels() { + return 1; + } + + @Override + public double getPeak2PeakVoltage(int swChannel) { + // TODO Auto-generated method stub + return 2; + } + + @Override + public boolean prepareSystem(AcquisitionControl daqControl) { + // TODO Auto-generated method stub + return true; + } + + @Override + public boolean startSystem(AcquisitionControl daqControl) { + // TODO Auto-generated method stub + return true; + } + + @Override + public void stopSystem(AcquisitionControl daqControl) { + // TODO Auto-generated method stub + + } + + @Override + public boolean isRealTime() { + // TODO Auto-generated method stub + return true; + } + + @Override + public boolean canPlayBack(float sampleRate) { + // TODO Auto-generated method stub + return false; + } + + @Override + public int getDataUnitSamples() { + // TODO Auto-generated method stub + return 100; + } + + @Override + public void daqHasEnded() { + // TODO Auto-generated method stub + + } + + @Override + public String getDeviceName() { + // TODO Auto-generated method stub + return "Sound Trap detector"; + } + +} diff --git a/src/soundtrap/STToolsControl.java b/src/soundtrap/STToolsControl.java index 861f196f..136ac0ec 100644 --- a/src/soundtrap/STToolsControl.java +++ b/src/soundtrap/STToolsControl.java @@ -12,6 +12,7 @@ import PamController.PamControlledUnit; import PamController.PamControlledUnitSettings; import PamController.PamSettingManager; import PamController.PamSettings; +import PamView.dialog.warn.WarnOnce; public class STToolsControl extends PamControlledUnit implements PamSettings { @@ -21,9 +22,17 @@ public class STToolsControl extends PamControlledUnit implements PamSettings { public static final String dwvFileEnd = ".dwv"; public static final String bclFileEnd = ".bcl"; + private String warn = "Versions 2.02.06 of PAMGuard and later can read SoundTrap SUD files directly, removing the need " + + " to decompress them and then use this module to import the SoundTrap click detector data into PAMGuard.


    " + + "Instead you should process the SUD files in 'normal mode' and include a SoundTrap Click Detector in " + + "your configuration. Click data will then be automatically unpacked into the correct binary files" + + " as you process the SUD file audio data.


    " + + "You can remove this module which is now obsolete. See the online help for details."; + public STToolsControl(String unitName) { super("Sound Trap Tools", unitName); PamSettingManager.getInstance().registerSettings(this); + WarnOnce.showWarning("Importing SoundTrap data", warn, WarnOnce.WARNING_MESSAGE); } /* (non-Javadoc) diff --git a/src/soundtrap/sud/SudFileDWVHandler.java b/src/soundtrap/sud/SudFileDWVHandler.java index 0cd1e5d5..11abd304 100644 --- a/src/soundtrap/sud/SudFileDWVHandler.java +++ b/src/soundtrap/sud/SudFileDWVHandler.java @@ -19,6 +19,7 @@ import PamUtils.PamCalendar; import clickDetector.ClickDetection; import clickDetector.ClickDetector; import clickDetector.ClickDetector.ChannelGroupDetector; +import soundtrap.STAcquisitionControl; import soundtrap.STClickControl; import wavFiles.ByteConverter; @@ -77,6 +78,8 @@ public class SudFileDWVHandler implements SUDNotificationHandler { stClickControl.findRawDataBlock().setChannelMap(1); stClickControl.findRawDataBlock().setSampleRate((float) sampleRate, true); stClickControl.getSTAcquisition().acquisitionParameters.sampleRate = (float) sampleRate; + stClickControl.getSTAcquisition().acquisitionParameters.voltsPeak2Peak = STAcquisitionControl.SOUNDTRAPVP2P; + stClickControl.getSTAcquisition().getAcquisitionProcess().setSampleRate((float) sampleRate, true); // System.out.printf("Open input stream fs = %3.1f\n", sampleRate); }