From b7d37e9a814878e6fcf43dbd61ab8965730ec0d6 Mon Sep 17 00:00:00 2001 From: Douglas Gillespie <50671166+douggillespie@users.noreply.github.com> Date: Tue, 27 Jun 2023 13:43:27 +0100 Subject: [PATCH 1/4] Calendar sort out A few problems with local time displays. hopefully now sorted. --- src/PamUtils/PamCalendar.java | 57 +++++++++++++++++--- src/PamUtils/time/CalendarControl.java | 2 +- src/PamUtils/time/TimeDisplayParameters.java | 4 ++ 3 files changed, 56 insertions(+), 7 deletions(-) diff --git a/src/PamUtils/PamCalendar.java b/src/PamUtils/PamCalendar.java index d41aa018..452e06e5 100644 --- a/src/PamUtils/PamCalendar.java +++ b/src/PamUtils/PamCalendar.java @@ -47,7 +47,10 @@ public class PamCalendar { public static TimeZone defaultTimeZone = TimeZone.getTimeZone("UTC"); - private static TimeZone localTimeZone = TimeZone.getDefault(); + /* + * Not used: all now handled in PamCalendar. + */ +// private static TimeZone localTimeZone = defaultTimeZone;// TimeZone.getDefault(); public static final long millisPerDay = 1000L*24L*3600L; @@ -60,7 +63,7 @@ public class PamCalendar { private static boolean soundFile; /** - * time from the start of the file to the currentmoment. + * time from the start of the file to the current moment. * This is updated every time data re read from the file, so is * accurate to about 1/10 second. * For accurate timing within detectors, always try to use sample number @@ -177,8 +180,44 @@ public class PamCalendar { public static TimeZone getDisplayTimeZone(boolean useLocal) { // return TimeZone.getTimeZone("UTC"); -// return useLocal ? CalendarControl.getInstance().getChosenTimeZone() : defaultTimeZone; - return useLocal ? localTimeZone : defaultTimeZone; + return useLocal ? CalendarControl.getInstance().getChosenTimeZone() : defaultTimeZone; +// return useLocal ? localTimeZone : defaultTimeZone; + } + + /** + * Get the display time zone offset in milliseconds. + * @param useLocal + * @return + */ + public static long getDisplayTimeZoneOffest(boolean useLocal) { + TimeZone tz = getDisplayTimeZone(useLocal); + return tz.getOffset(getTimeInMillis()); + } + + /** + * Get a short string describing the time zone. This should be less than + * 10 characters. So if the full name of the TZ is long, then write it + * in the format "UTC+..." + * @param useLocal + * @return + */ + public static String getShortDisplayTimeZoneString(boolean useLocal) { + TimeZone tz = getDisplayTimeZone(useLocal); + String str = tz.getDisplayName(); + str = CalendarControl.getInstance().getTZCode(true); + if (str.length() <= 10) { + return str; + } + // otherwise make up a string. + long offset = getDisplayTimeZoneOffest(useLocal) / 1000; + boolean isInt = offset % 3600 == 0; + if (isInt) { + str = String.format("UTC%+d", offset/3600); + } + else { + str = String.format("UTC%+3.1f", (double) offset/3600.); + } + return str; } public static String formatDateTime(Date date) { @@ -391,8 +430,13 @@ public class PamCalendar { public static String formatDBStyleTime(long timeInMillis, boolean showMillis, boolean useLocal) { Calendar c = Calendar.getInstance(); + TimeZone tz = getDisplayTimeZone(useLocal); +// if (tz != null) { +// long offs = tz.getOffset(timeInMillis); +// timeInMillis += tz.getOffset(timeInMillis); +// } c.setTimeInMillis(timeInMillis); - c.setTimeZone(getDisplayTimeZone(useLocal)); + c.setTimeZone(tz); DateFormat df; if (showMillis) { df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); @@ -400,7 +444,7 @@ public class PamCalendar { else { df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); } - df.setTimeZone(getDisplayTimeZone(useLocal)); + df.setTimeZone(tz); Date d = c.getTime(); // return String.format("%tY-% Date: Thu, 29 Jun 2023 11:44:00 +0100 Subject: [PATCH 2/4] V2.02.09 Fix to display time zone problem. --- README.html | 319 ++++++++++--------- dependency-reduced-pom.xml | 2 +- pom.xml | 2 +- src/PamController/PamguardVersionInfo.java | 4 +- src/PamUtils/time/TimeDisplayParameters.java | 2 +- src/PamUtils/time/TimeZoneDisplayDialog.java | 15 +- 6 files changed, 181 insertions(+), 163 deletions(-) diff --git a/README.html b/README.html index 601738b5..f39f4964 100644 --- a/README.html +++ b/README.html @@ -388,7 +388,10 @@ PamguardBeta_ViewerMode.exe):

LATEST VERSION 2.02.08 May 2023

+href="#_Version_2.02.09_June">Latest Version 2.02.09 June 2023 + +

Version 2.02.08 May 2023

Version 2.02.07 January 2023

@@ -454,7 +457,17 @@ Version 2.00.10 June 2017

Latest Version 2.02.08 May +name="_Latest_Version_2.02.08">Version 2.02.09 June 2023

+ +

Bug Fixes

+ +

Time zone displays: Fixed some bugs +associated with options to have PAMGuard display times in local time, rather +than UTC. This was affecting times typed into the scroll bars of displays which +were reading local time, even when set to use UTC.

+ +

Version 2.02.08 May 2023

Bug Fixes

@@ -495,8 +508,8 @@ the first two characters of the string name may be.

Bug Fixes

-

Use of localization sensor and orientation -data for static hydrophones had a bug whereby it would continually ‘forget’ angle +

Use of localization sensor and orientation data +for static hydrophones had a bug whereby it would continually ‘forget’ angle offsets applied to static hydrophones in viewer mode. This is now fixed.

Click tool bar: Correctly shows event @@ -525,10 +538,10 @@ generates random chirps between around 200 and 800Hz, roughly the frequency you’d expect sound from higher frequency baleen whales, such as humpbacks, to vocalise at.   

-

Hiding tool tips. A menu item to permanently -turn off all tool tips, or tap the ‘Esc’ key to turn them off for 6 seconds if -they are getting in the way, particularly when trying to interact with displays -using the mouse.

+

Hiding tool tips. A menu item to +permanently turn off all tool tips, or tap the ‘Esc’ key to turn them off for 6 +seconds if they are getting in the way, particularly when trying to interact +with displays using the mouse.

Version 2.02.06 November 2022

@@ -550,8 +563,8 @@ whistle classification module.

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 can also happen while processing SUD file data with other detectors, thereby +lot of disk space. Extraction of clicks from the inbuilt SoundTrap Click detector +can also happen while processing SUD file data with other detectors, thereby streamlining the whole processing chain. Read the online Help for details.   

@@ -656,9 +669,9 @@ selections from drop down lists within any form.

 

-

Note that updates have also been made to the Matlab -interface to PAMGuard binary files, which has now also been migrated to GitHub -at https://github.com/PAMGuard/PAMGuardMatlab. +

Note that updates have also been made to the Matlab interface +to PAMGuard binary files, which has now also been migrated to GitHub at https://github.com/PAMGuard/PAMGuardMatlab.

 

@@ -686,12 +699,12 @@ 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 16 (OpenJDK -release), so you will not need to install a java runtime engine separately. -PSFX files generated in previous beta releases (2.xx.xx) should be compatible -with this version, and vice-versa. PSF files generated in core releases -(1.15.xx) can be loaded in this version, but will be converted to PSFX files -when PAMGuard exits.

+

This version of PAMGuard has been bundled with Java 16 +(OpenJDK release), so you will not need to install a java runtime engine +separately. 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.

 

@@ -739,8 +752,8 @@ params

3.       Bug -  492. Data Model does not update button//tooltip text when underlying data -changes

+  492. Data Model does not update button//tooltip text when underlying +data changes

4.       Bug @@ -835,17 +848,17 @@ Noise Level Outputs - as an aid to performance diagnosis, some detectors (currently the GPL, Click Detector and Whistle and Moan Detector) are outputting additional noise metrics to their binary output files. These can be read with the PAMGuard -Matlab library and used to diagnose system performance in varying noise -conditions. Improved displays within PAMGuard for these noise metrics will be -included in a future release.

+Matlab library and used to diagnose system performance in varying noise conditions. +Improved displays within PAMGuard for these noise metrics will be included in a +future release.

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

+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

18.        @@ -866,11 +879,11 @@ understand the notes listed for Beta Version 2.00.10 before proceeding with installation and use of this version.

-

This version of PAMGuard has been bundled with Java 13 (release -13.0.1). PSFX files generated in previous beta releases (2.xx.xx) should be -compatible with this version, and vice-versa. PSF files generated in core -releases (1.15.xx) can be loaded in this version, but will be converted to PSFX -files when PAMGuard exits.

+

This version of PAMGuard has been bundled with Java 13 +(release 13.0.1). PSFX files generated in previous beta releases (2.xx.xx) +should be compatible with this version, and vice-versa. PSF files generated in +core releases (1.15.xx) can be loaded in this version, but will be converted to +PSFX files when PAMGuard exits.

Bug Fixes

@@ -958,8 +971,9 @@ lang=EN-US> Better auto-scaling in Ishmael Detector graphics window.

7.        Change to Windows temporary folder location, to get around Windows -Security settings that were preventing some modules from working properly.

+lang=EN-US> Change to Windows temporary folder location, to get around +Windows Security settings that were preventing some modules from working +properly.

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

8.       Bug -  460. Click Detector BT Display vertical axis shows all zeroes when zooming -out

+  460. Click Detector BT Display vertical axis shows all zeroes when +zooming out

9.       Bug @@ -1299,8 +1313,8 @@ Added a few new options to the Click Detector Sweep Classifier.

10.        Add option to the Map module's Plot Overlay Options dialog, to -show events occuring in the future (look +lang=EN-US> Add option to the Map module's Plot Overlay Options dialog, +to show events occuring in the future (look ahead) instead of the default display of events which have already occurred. Can make it easier to match up the map with clicks seen in the Click Detector display.

@@ -1465,8 +1479,8 @@ Upgrades to the Group Localiser, including better error estimation.

2.        Click Train Detector upgrades, including ability to import -time chunks from csv file for batch processing.

+lang=EN-US> Click Train Detector upgrades, including ability to import time +chunks from csv file for batch processing.

3.       

3.        -Bugs 398 and 399. Click Detector, FFT Engine and Filter modules were losing -source during startup, if the source selected was not the first raw data source -in the list.

+Bugs 398 and 399. Click Detector, FFT Engine and Filter modules were +losing source during startup, if the source selected was not the first raw data +source in the list.

4.        @@ -1738,9 +1752,9 @@ see new options in main menu.

2.        Added Matched Template Click Classifier. Classifies clicks based -on an ideal template to match and a template to reject. An example of this is -to classify beaked whale clicks in an environment with dolphin clicks.

+lang=EN-US> Added Matched Template Click Classifier. Classifies clicks +based on an ideal template to match and a template to reject. An example of +this is to classify beaked whale clicks in an environment with dolphin clicks.

3.        @@ -1856,11 +1870,11 @@ to work with whistles.

3.        -Added option to export all settings and parameters as an XML-formatted file. -Note that this required changes to the structure of the Array Manager, and as -such any settings (psf) files created with this version of Pamguard cannot be -used in older versions. Older psf files can be loaded with this version, but -will be converted.

+Added option to export all settings and parameters as an XML-formatted file. Note +that this required changes to the structure of the Array Manager, and as such +any settings (psf) files created with this version of Pamguard cannot be used +in older versions. Older psf files can be loaded with this version, but will be +converted.

4.       

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

@@ -2112,11 +2126,11 @@ the PAMGuard Viewer the older data will be converted to the new format (see below for details).

The most significant change in the binary -file format is the addition of a Unique Data Identifier (UID) to each unit of -data. This is intended to aid in offline analysis by making it easier for the -user to link what they are seeing on different PAMGuard displays and also to -link with any data post processed in Matlab or other custom analysis software. -UID’s are also added to PAMGuard database tables.

+file format is the addition of a Unique Data Identifier (UID) to each unit of data. +This is intended to aid in offline analysis by making it easier for the user to +link what they are seeing on different PAMGuard displays and also to link with +any data post processed in Matlab or other custom analysis software. UID’s +are also added to PAMGuard database tables.

Converting Old Data

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

3.       -Rocca Module: added StartHr, ProportionWhists and ProportionClicks -parameters to Event classifier

+Rocca Module: added StartHr, ProportionWhists and ProportionClicks parameters +to Event classifier

4.       @@ -2236,14 +2250,14 @@ switches/parameters to be included in *.ini files.

1.       -Bug 308. Map Overlay Control. Storage of data saying -what get's plotted on each map and for how long became corrupted and the 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.

+Bug 308. Map Overlay Control. Storage of data +saying what get's plotted on each map and for how long became corrupted and the +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.

2.       @@ -2374,10 +2388,10 @@ high sample rate.

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

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

Version 1.15.06 November 2016

@@ -2533,9 +2547,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

@@ -2841,10 +2855,10 @@ 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).

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

4.        @@ -2913,8 +2927,8 @@ writing results files. Fixed.

7.        -Bug 237. Logger forms not saving data to database after sound acquisition -starts. Fixed.

+Bug 237. Logger forms not saving data to database after sound +acquisition starts. Fixed.

8.        @@ -2957,15 +2971,15 @@ which is useful when using PAMGuard for demonstration purposes.

lang=EN-US>4.              The sound File and Folder audio input systems now have an optional time zone setting. Note that PAMGuard analysis should still all be taking place in -UTC and that this option is intended to allow the conversion of file times which -were not recorded as UTC into UTC and not the other way around. Use the option -with caution !

+UTC and that this option is intended to allow the conversion of file times +which were not recorded as UTC into UTC and not the other way around. Use the +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/

Menu Layout

-

The PAMGuard menus have been rearranged into a more intuitive -grouping which we believe will help users find functionality more easily.

+

The PAMGuard menus have been rearranged into a more +intuitive grouping which we believe will help users find functionality more +easily.

'Detection' menu has been renamed to 'Settings' since many menu items within this menu were not directly to do with 'Detection'.

@@ -3182,8 +3197,8 @@ whistles as well.

This module, funded by NOAA for the South West Fisheries Science Centre (SWFSC), measures pitch and roll from analogue accelerometer sensors in a hydrophone. Data are fed real time into the updated hydrophone -array manager in order that bearings from a tetrahedral tracking array are -correctly calculated in real world coordinates.

+array manager in order that bearings from a tetrahedral tracking array are correctly +calculated in real world coordinates.

Wild ArcGIS Interface (Maps and Mapping group)

@@ -3193,12 +3208,12 @@ marine mammal survey package. See online help for details.

Alarms (Utilities Group)

-

This is a general system of visual and audio alarms -developed by Doug Gillespie for use on a variety of projects. The alarms can be -coupled to any module or detector in PAMGuard. Where appropriate, modules can -control which of their data will cause an alarm action (e.g. in the Click -detector you can set which types of classified click will fire the alarm). See -online help for details.  

+

This is a general system of visual and audio alarms developed +by Doug Gillespie for use on a variety of projects. The alarms can be coupled +to any module or detector in PAMGuard. Where appropriate, modules can control +which of their data will cause an alarm action (e.g. in the Click detector you +can set which types of classified click will fire the alarm). See online help +for details.  

Noise Band Monitor (Sound Processing Group)

@@ -3246,9 +3261,9 @@ different. Details are available in the online help.

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

@@ -3292,9 +3307,8 @@ shaped Finite Impulse Response filters (see online help for details).

Radar Display

-

Can now show bearings relative to true North OR the vessel -heading. Also has the option of only showing certain types of click and -whistle.

+

Can now show bearings relative to true North OR the vessel heading. +Also has the option of only showing certain types of click and whistle.

Bug Fixes

@@ -3373,8 +3387,8 @@ survey software package.

Core Functionality

-

New storage options have been -implemented which give the user greater control of where data are stored.

+

New storage options have been implemented +which give the user greater control of where data are stored.

Modules have been arranged into different groups in the configuration menus and tool tip texts have been added @@ -3396,9 +3410,9 @@ 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).

@@ -3461,8 +3475,8 @@ inter-detection interval.

margin-left:36.0pt'> 

Target Motion Analysis: Updated target motion analysis -module so that it works in three (as opposed to two) dimensions.

+margin-left:36.0pt'>Target Motion Analysis: Updated target motion analysis module +so that it works in three (as opposed to two) dimensions.

 

@@ -3549,8 +3563,8 @@ start-up.

'         Bug in Noise Monitor. Version 1.11.01 would crash if only a subset of -channels were selected, e.g. if you only measured noise on channel 0 of a two channel -configuration. This bug is now fixed

+channels were selected, e.g. if you only measured noise on channel 0 of a two +channel configuration. This bug is now fixed

Version 1.11.01 Beta April 2012

@@ -3605,8 +3619,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.

'         Whistle classifier has some new features in the classifier training -panel. It is also now possible to export training data files directly from -binary data files.

+panel. It is also now possible to export training data files directly from binary +data files.

'         @@ -3825,8 +3839,8 @@ of channel numbering was only implemented several years into the PAMGUARD project, it was never fully implemented or well supported by the different modules which resulted in a number of bugs which could cause confusion as to which hydrophones were being used during localisation or during calibrated -measurement. The situation tended to only arise with a small number of ASIO sound -cards such as the RME Fireface 400 on which the most useful inputs, the +measurement. The situation tended to only arise with a small number of ASIO +sound cards such as the RME Fireface 400 on which the most useful inputs, the balanced line inputs, are hardware channels 4,5,6 and 7 on the back of the instrument. (On the Fireface 800, the balanced line inputs are channels 0 to 7). When using the National Instruments system, data were always sent into the @@ -3849,13 +3863,14 @@ out a better system for handling channel numbering in PAMGUARD and have decided that the only practical thing to do is to force all software channel numbering back to a zero indexed system. i.e. even if you read out hardware channels 3,4,5 and 6, within PAMGUARD, everywhere apart from the Sound acquisition -dialog, you will see them listed as channels 0,1,2 and 3.  The consequences -of doing this are mainly very good. Most users will not notice any changes. For -those who need for some reason to read channel numbers not starting at zero -things will be more stable. However, when you go to a new version with this new -feature, it will be necessary to reconfigure all the modules in any existing -configurations. To do this, open the configuration dialog for each module in -turn and select the correct, zero indexed, channel number.

+dialog, you will see them listed as channels 0,1,2 and 3.  The +consequences of doing this are mainly very good. Most users will not notice any +changes. For those who need for some reason to read channel numbers not +starting at zero things will be more stable. However, when you go to a new +version with this new feature, it will be necessary to reconfigure all the +modules in any existing configurations. To do this, open the configuration +dialog for each module in turn and select the correct, zero indexed, channel +number.

Other Changes / new features

@@ -3912,8 +3927,8 @@ existing configurations.

Sound acquisition

-

Changes made for a previous Mac build now incorporated into main -Beta branch. This should allow for basic 2 channel sound acquisition using +

Changes made for a previous Mac build now incorporated into +main Beta branch. This should allow for basic 2 channel sound acquisition using Macs.

Bug Fixes

@@ -3950,12 +3965,12 @@ port is closed. Might prevent a few problems when using a GPS.

Bug Fixes

Crashes caused in real time or Mixed Mode if the number of -software channels exceeds the number of hydrophones configured in the array -manager. It is of course illogical to have software channels which are not -assigned to a hydrophone, so rather than entirely prevent PAMGUARD from -crashing I have inserted additional checks into the hydrophone array dialog -which will prevent the user from closing that dialog unless all software -channels are assigned to a hydrophone.

+software channels exceeds the number of hydrophones configured in the array manager. +It is of course illogical to have software channels which are not assigned to a +hydrophone, so rather than entirely prevent PAMGUARD from crashing I have +inserted additional checks into the hydrophone array dialog which will prevent +the user from closing that dialog unless all software channels are assigned to +a hydrophone.

Version 1.8.01 Beta February 2010

@@ -4005,9 +4020,9 @@ Symbol'>''         -False buffer overflows at low sample rates stopped (size of data in -individual data blocks had been increased at low sample rates, but when this -exceeded 3s a false buffer overflow would occur).

+
False buffer overflows at low sample rates stopped (size of data in individual +data blocks had been increased at low sample rates, but when this exceeded 3s a +false buffer overflow would occur).

 

@@ -4057,8 +4072,8 @@ 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 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. 

@@ -4106,8 +4121,9 @@ methods used in PAMGUARD

New Modules

-

Two new modules are packaged. These are still in the final stages -of development. Feedback is most welcome. See online help for further details.

+

Two new modules are packaged. These are still in the final +stages of development. Feedback is most welcome. See online help for further +details.

Whistle and Moan Detector

@@ -4715,7 +4731,8 @@ Symbol'>''1.0Beta 22 Jan 2008 - Pamguard -starts two releases, core and beta release,

+class=Heading2Char>1.0Beta 22 Jan 2008 - +Pamguard starts two releases, core and beta release,

this is the beta release

@@ -4831,12 +4848,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 a0157ae4..b5d893d2 100644 --- a/dependency-reduced-pom.xml +++ b/dependency-reduced-pom.xml @@ -4,7 +4,7 @@ org.pamguard Pamguard Pamguard Java12+ - 2.02.08 + 2.02.09 Pamguard for Java 12+, using Maven to control dependcies www.pamguard.org diff --git a/pom.xml b/pom.xml index 41f6aa34..dd6bd1f8 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 org.pamguard Pamguard - 2.02.08 + 2.02.09 Pamguard Java12+ Pamguard for Java 12+, using Maven to control dependcies www.pamguard.org diff --git a/src/PamController/PamguardVersionInfo.java b/src/PamController/PamguardVersionInfo.java index cc7a70bd..9b661b4c 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.08a"; + static public final String version = "2.02.09"; /** * Release date */ - static public final String date = "30 May 2023"; + static public final String date = "29 June 2023"; // /** // * Release type - Beta or Core diff --git a/src/PamUtils/time/TimeDisplayParameters.java b/src/PamUtils/time/TimeDisplayParameters.java index 9ec93821..9f039f54 100644 --- a/src/PamUtils/time/TimeDisplayParameters.java +++ b/src/PamUtils/time/TimeDisplayParameters.java @@ -11,8 +11,8 @@ public class TimeDisplayParameters implements Serializable, Cloneable, ManagedPa public static final long serialVersionUID = 1L; public static final int TIME_ZONE_UTC = 0; - public static final int TIME_ZONE_PC = 1; public static final int TIME_ZONE_OTHER = 1; + public static final int TIME_ZONE_PC = 2; public int zoneType = TIME_ZONE_UTC; diff --git a/src/PamUtils/time/TimeZoneDisplayDialog.java b/src/PamUtils/time/TimeZoneDisplayDialog.java index 5b089a54..dfca1247 100644 --- a/src/PamUtils/time/TimeZoneDisplayDialog.java +++ b/src/PamUtils/time/TimeZoneDisplayDialog.java @@ -29,7 +29,7 @@ public class TimeZoneDisplayDialog extends PamDialog { private JLabel pcTimeZone; private String[] timeZoneIds; private TimeDisplayParameters timeDisplayParameters; - private TimeZone thisTimeZone; +// private TimeZone thisTimeZone; private int utcTZIndex, pcTZIndex; private static TimeZoneDisplayDialog singleInstance; @@ -57,8 +57,8 @@ public class TimeZoneDisplayDialog extends PamDialog { c.gridy++; c.gridx = 0; JLabel ta = new JLabel(); - ta.setText("Note that all processing and data storage will continue to

use UTC, the selection " + - "you make here \nwill only affect what is displayed on the screen"); + ta.setText("Note that all processing and data storage will continue to use UTC.

The selection " + + "you make here will only affect what is displayed on the screen."); tzPanel.add(ta, c); ButtonGroup bg = new ButtonGroup(); @@ -66,7 +66,7 @@ public class TimeZoneDisplayDialog extends PamDialog { bg.add(usePC); bg.add(useOther); - thisTimeZone = Calendar.getInstance().getTimeZone(); + TimeZone pcTimeZone = TimeZone.getDefault(); timeZoneIds = TimeZone.getAvailableIDs(); Arrays.sort(timeZoneIds, new TimeZoneComparator()); TimeZone tz; @@ -76,7 +76,7 @@ public class TimeZoneDisplayDialog extends PamDialog { if (timeZoneIds[i].equals(PamCalendar.defaultTimeZone.getID())) { utcTZIndex = i; } - if (timeZoneIds[i].equals(thisTimeZone.getID())) { + if (timeZoneIds[i].equals(pcTimeZone.getID())) { pcTZIndex = i; } if (tz.getRawOffset() < 0) { @@ -118,7 +118,8 @@ public class TimeZoneDisplayDialog extends PamDialog { useUTC.setSelected(timeDisplayParameters.zoneType == TimeDisplayParameters.TIME_ZONE_UTC); usePC.setSelected(timeDisplayParameters.zoneType == TimeDisplayParameters.TIME_ZONE_PC); useOther.setSelected(timeDisplayParameters.zoneType == TimeDisplayParameters.TIME_ZONE_OTHER); - pcTimeZone.setText(String.format("(%s / %s)", thisTimeZone.getID(), thisTimeZone.getDisplayName())); + TimeZone defaultTimeZone = TimeZone.getDefault(); + pcTimeZone.setText(String.format("(%s / %s)", defaultTimeZone.getID(), defaultTimeZone.getDisplayName())); enableControls(); showSelection(); } @@ -165,7 +166,7 @@ public class TimeZoneDisplayDialog extends PamDialog { } else if (usePC.isSelected()) { timeDisplayParameters.zoneType = TimeDisplayParameters.TIME_ZONE_PC; - timeDisplayParameters.timeZone = thisTimeZone; + timeDisplayParameters.timeZone = TimeZone.getDefault(); } else if (useOther.isSelected()) { timeDisplayParameters.zoneType = TimeDisplayParameters.TIME_ZONE_OTHER; From 42bbf86f5a1f5a4e9b038109115369c973c27f04 Mon Sep 17 00:00:00 2001 From: Douglas Gillespie <50671166+douggillespie@users.noreply.github.com> Date: Fri, 30 Jun 2023 12:16:37 +0100 Subject: [PATCH 3/4] Screen position Attempt at fixing screen position so GUI is visible even if screen arrangement has changed. --- src/PamView/PamGui.java | 40 +++++------ src/PamView/ScreenSize.java | 135 +++++++++++------------------------- 2 files changed, 55 insertions(+), 120 deletions(-) diff --git a/src/PamView/PamGui.java b/src/PamView/PamGui.java index 34f9b000..98ef13e4 100644 --- a/src/PamView/PamGui.java +++ b/src/PamView/PamGui.java @@ -223,32 +223,24 @@ public class PamGui extends PamView implements WindowListener, PamSettings { PamSettingManager.getInstance().registerSettings(this); if (guiParameters.bounds != null) { - /* - * now need to check that the frame is visible on the - * current screen - a pain when psf files are sent between - * users, or when I work on two screens at work and then one - * at home ! - */ - // Rectangle screenRect = ScreenSize.getScreenBounds(20000); - Rectangle screenRect = ScreenSize.getScreenBounds(); - // Rectangle intercept = screenRect.intersection(frame.getBounds()); - if (screenRect == null) { - System.out.println("Unable to get screen dimensions from system"); +// /* +// * now need to check that the frame is visible on the +// * current screen - a pain when psf files are sent between +// * users, or when I work on two screens at work and then one +// * at home ! +// */ + + Point topCorner = guiParameters.bounds.getLocation(); + boolean posOK = true; + try { + posOK = ScreenSize.isPointOnScreen(topCorner); + } catch (Exception e) { } - else { - while (guiParameters.bounds.x + guiParameters.bounds.width < screenRect.x + 200) { - guiParameters.bounds.x += screenRect.width; - } - while (guiParameters.bounds.x > screenRect.x+screenRect.width) { - guiParameters.bounds.x -= screenRect.width; - } - while (guiParameters.bounds.y + guiParameters.bounds.height < screenRect.y + 200) { - guiParameters.bounds.y += screenRect.height; - } - while (guiParameters.bounds.y > screenRect.y+screenRect.height) { - guiParameters.bounds.y -= screenRect.height; - } + if (!posOK) { + // put it in the top corner of the main screen. + guiParameters.bounds.x = guiParameters.bounds.y = 10; } + frame.setBounds(guiParameters.bounds); diff --git a/src/PamView/ScreenSize.java b/src/PamView/ScreenSize.java index a51863a2..4b4d905b 100644 --- a/src/PamView/ScreenSize.java +++ b/src/PamView/ScreenSize.java @@ -3,6 +3,7 @@ package PamView; import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; +import java.awt.Point; import java.awt.Rectangle; import java.util.List; @@ -15,7 +16,7 @@ import javafx.scene.layout.Pane; /** * Class to launch a thread which will get the screen size - * (inlcuding the bounds of multiple monitors) + * (including the bounds of multiple monitors) *

* The process of getting the dimensions is launched in a * different thread and can be going on while other PAMGAURD @@ -32,40 +33,6 @@ public class ScreenSize { private static Rectangle[] screenDimensions; -// private volatile static boolean hasRun = false; -// -// private ScreenSize() { -// //Problems with startup on Mac that -// //seem to have been caused by the -// //GetBounds not being invoked from within -// //the Event Display Thread -// //CJB 2009-06-15 -//// SwingUtilities.invokeLater(new GetBounds()); -// //old version -// //Thread thread = new Thread(new GetBounds()); -// //thread.start(); -// long m1 = System.currentTimeMillis(); -// findScreenBounds(); -// long m2 = System.currentTimeMillis(); -// System.out.println("screen bounds took ms: " + (m2-m1)); -// } -// -// /** -// * Only needs to be called once to -// * start the background process which gets -// * the virtual screen size. -// *

-// * Is called from PAMGUARD Main to get it -// * going asap. -// */ -// public static void startScreenSizeProcess() { -// if (hasRun == false) { -// hasRun = true; -// new ScreenSize(); -// } -// -// } -// /** * Gets the screen bounds, sum / union of all screens. * @return Virtual screen size, or null. @@ -103,40 +70,6 @@ public class ScreenSize { return screenDimensions[iScreen]; } -// /** -// * Gets the virtual screen size. Will wait for them to be -// * extracted from the background thread up to some set timeout -// * @param maxWaitMillis Max time to wait. -// * @return virtual screen dimension, or null if unavailable -// * after the set wait period. -// */ -// public static Rectangle getScreenBounds(int maxWaitMillis) { -// -// startScreenSizeProcess(); -// -// long endTime = System.currentTimeMillis() + maxWaitMillis; -// while (System.currentTimeMillis() <= endTime) { -// if (screenDimension != null) { -// return screenDimension; -// } -// try { -// Thread.sleep(100); -// } -// catch (InterruptedException e) { -// return screenDimension; -// } -// } -// return screenDimension; -// } -// -// /** -// * -// * @return true if screen bounds are available. -// */ -// public boolean haveScreenBounds() { -// return (screenDimension != null); -// } - private static Rectangle findScreenBounds() { Rectangle virtualBounds = new Rectangle(); if (PamGUIManager.getGUIType() == PamGUIManager.NOGUI) { @@ -160,40 +93,50 @@ public class ScreenSize { //let PAMGUARD start up a little quicker //CJB 2009-06-15 GraphicsConfiguration dgc = gd.getDefaultConfiguration(); - // System.out.printf("", dgc.getBufferCapabilities().) - // System.out.println(dgc); screenDimensions[j] = dgc.getBounds(); virtualBounds = virtualBounds.union(dgc.getBounds()); } } - // new Pane(); - // List screens = Screen.getScreens(); - // if (screens != null) { - // for (Screen aScreen : screens) { - // System.out.printf("Screen resX %d, resY %d\n", - // aScreen.getResolutionX(), - // aScreen.getResolutionY()); - // } - // } - //System.out.println("virtualBounds="+virtualBounds); + return virtualBounds; } + + + /** + * Pushes a rectangle so that it's visible on the screen. + * @param bounds - will get modified in place. + * @return true if the position was changed. + */ + public static boolean forceBoundToScreen(Rectangle bounds) { + try { + if (isPointOnScreen(bounds.getLocation()) == false) { + bounds.x = bounds.y = 0; + return true; + } + } catch (Exception e) { + return false; + } + return false; + } + + /** + * Test to see if the point is within the bounds of any available monitor + * @param point point + * @return true if it's within the bounds of any montor + * @throws Exception Thrown if there are no monitors. + */ + public static boolean isPointOnScreen(Point point) throws Exception { + if (screenDimensions == null || screenDimensions.length == 0) { + throw new Exception("No attached screens. Can't test point"); + } + for (int i = 0; i < screenDimensions.length; i++) { + if (screenDimensions[i].contains(point)) { + return true; + } + } + return false; + } - // /** - // * Thread to obtain the screen bounds. -// * @author Doug -// * -// */ -// public class GetBounds implements Runnable { -// -// @Override -// public void run() { -// -// screenDimension = findScreenBounds(); -// -// } -// -// } } From c3c31c3312bb5025259a803612c1c6dd85faa374 Mon Sep 17 00:00:00 2001 From: Douglas Gillespie <50671166+douggillespie@users.noreply.github.com> Date: Fri, 30 Jun 2023 16:59:59 +0100 Subject: [PATCH 4/4] FindGUI command Added terminal command to force GUI back onto primary monitor --- src/PamController/command/CommandManager.java | 1 + src/PamController/command/FindGUICommand.java | 27 +++++++++++++++++++ src/PamView/GuiFrameManager.java | 21 +++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 src/PamController/command/FindGUICommand.java diff --git a/src/PamController/command/CommandManager.java b/src/PamController/command/CommandManager.java index 87f4b888..d6b06fc0 100644 --- a/src/PamController/command/CommandManager.java +++ b/src/PamController/command/CommandManager.java @@ -42,6 +42,7 @@ public abstract class CommandManager extends PamControlledUnit { commandsList.add(new SetXMLSettings()); commandsList.add(new BatchStatusCommand()); commandsList.add(new BatchCommand(this)); + commandsList.add(new FindGUICommand()); } diff --git a/src/PamController/command/FindGUICommand.java b/src/PamController/command/FindGUICommand.java new file mode 100644 index 00000000..526e7e2f --- /dev/null +++ b/src/PamController/command/FindGUICommand.java @@ -0,0 +1,27 @@ +package PamController.command; + +import PamController.PamController; +import PamView.GuiFrameManager; + +public class FindGUICommand extends ExtCommand { + + public FindGUICommand() { + super("findgui", true); + } + + @Override + public String execute(String command) { + GuiFrameManager frameManager = PamController.getInstance().getGuiFrameManager(); + if (frameManager == null) { + return "No GUI to move"; + } + frameManager.findGUI(); + return "GUI Moved"; + } + + @Override + public String getHint() { + return "Move GUI components to the main monitor"; + } + +} diff --git a/src/PamView/GuiFrameManager.java b/src/PamView/GuiFrameManager.java index 030628c0..b49da8d7 100644 --- a/src/PamView/GuiFrameManager.java +++ b/src/PamView/GuiFrameManager.java @@ -633,5 +633,26 @@ public class GuiFrameManager implements PamSettings, PAMControllerGUI { return frameIcon; } + /** + * Function that can move GUI frames back onto the main window. + * Can be used to recover a GUI if it's on a monitor that is not present. + */ + public void findGUI() { + if (pamViewList == null) { + return; + } + int loc = 10; + for (PamViewInterface view : pamViewList) { + JFrame frame = view.getGuiFrame(); + if (frame == null) { + continue; + } + frame.setLocation(loc, loc); + frame.setState(JFrame.NORMAL); + frame.setVisible(true); + loc += 20; + } + } + }