Merge Dougs fork (#53)

* Variable sound output level

Mods to SoundPlayback module to allow additional parameters. Implemented
system for NI cards to allow changes to selected output voltage range
meaning output can be boosted to level higher than current default.

* Code to support nogui operations when no screens present on headless
system

* Fix problem of nogui headless operation trying to access screen size.

* Click detector display fixes

1. ICI not displaying correctly
2. Component sizes in display dialog on hres monitors

* Work on batch processing, after testing of options to autostart,
autoexit and set wav file folder, database and binary store.

* Update MHTClickTrainAlgorithm.java

Fix unsynchronised access to a datablock in click train detector which was causing index errors.

* Revamp of offline process messaging and control

Includes some databsae logging of completed tasks

* Offline task logging

Bit more work, including notes and database storage of task
reprocessing. Guess this could all become 'proper' PAMGuard data and be
shown in a table on the display but that not priority enough.

* Dialog packing

Fix a couple of dialogs which don't back well on HDPI monitors

* UDP Control

Added multiport functionality

* Java version

Changes unpacker to deal with non numeric characters on Linux

* Fix to getVersion()

So new version of this command should now work on Linux and Windows.

* Multiport test

Quick tester for multiport comms

* Spectrogram display

Stop spectrogram display continually recreating panels since it was
unsubscribing discarded ones and sometimes causing crash in observable
notifications.

* Backup manager bug

Error if no database. Fixed.

* Daylight saving problem

Fix daylight saving problem in generation of timestamps in SQLTypes. See long explanation in SQLTypes.java. Only occurred in the hour after daylight saving starts.
This commit is contained in:
Douglas Gillespie 2022-09-13 09:12:34 +01:00 committed by GitHub
parent cd89c65d7c
commit ae6e2f947b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 3 deletions

View File

@ -83,7 +83,8 @@ public class PamCalendar {
* viewPositions which is the number of milliseconds from the sessionsStartTime.
*/
private static long viewPosition;
/**
* If files are being analysed, return the time based on the file
* position. Otherwise just take the normal system time.

View File

@ -337,11 +337,30 @@ public class SQLTypes {
* @return Appropriate object (Generally TimeStamp, but SWLite uses Long)
*/
public Object getTimeStamp(Long timeMillis) {
/**
* This has just got nasty WRT time zones.
* When the TimeStamp is written to database it uses the default time zone correction, which of course
* I don't want since I only do UTC. I was therefore subtracting this off before creating the ts
* so that it all worked fine when it was added back on again.
* This was fine for many years until someone processed data from exactly when the clocks went
* forward in the spring. Because the data were just after the clocks going forward, it took off
* an hour, then failed to add it back on again since the time was now before daylight saving.
* Amazed this has never happened before. Well done G and E ! I can fix it by setting the
* default time zone to UTC when PAMGuard starts, but note that all future references to local time
* will then be UTC. If I try to change it temporarily it doesn't help since the Timestamp always
* goes to the default, so it needs to be on UTC at the moment data are written to the database, not
* just in this function.
*/
if (timeMillis == null) {
return null;
}
TimeZone tz = TimeZone.getDefault();
return new Timestamp(timeMillis - tz.getOffset(timeMillis));
// TimeZone tz = TimeZone.getDefault();
// TimeZone.setDefault(PamCalendar.defaultTimeZone);
// Timestamp ts = new Timestamp(timeMillis - tz.getOffset(timeMillis));
Timestamp ts = new Timestamp(timeMillis);
// TimeZone.setDefault(tz);
// Timestamp newTS = ts.toLocalDateTime();
return ts;
}
/**

View File

@ -33,6 +33,7 @@ import PamController.pamBuoyGlobals;
import PamController.command.TerminalController;
import PamModel.SMRUEnable;
import PamUtils.FileFunctions;
import PamUtils.PamCalendar;
import PamUtils.PamExceptionHandler;
import PamUtils.PlatformInfo;
import PamUtils.Splash;
@ -134,6 +135,8 @@ public class Pamguard {
Thread folderSizeThread = new Thread(folderSizeMon);
folderSizeThread.start();
TimeZone.setDefault(PamCalendar.defaultTimeZone);
System.out.println("**********************************************************");
try {
// get the java runnable file name.