This commit is contained in:
Douglas Gillespie 2024-01-17 21:28:02 +00:00
commit 0c035aa0fe
521 changed files with 22029 additions and 1259 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<projectDescription> <projectDescription>
<name>PamGuard Main DG</name> <name>PamGuard Main Tethys</name>
<comment></comment> <comment></comment>
<projects> <projects>
</projects> </projects>

View File

@ -1,2 +1,4 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
encoding//src/rawDeepLearningClassifer/segmenter/SegmenterProcess.java=UTF-8 encoding//src/rawDeepLearningClassifer/segmenter/SegmenterProcess.java=UTF-8
encoding/<project>=UTF-8
encoding/src=UTF-8

View File

@ -477,6 +477,10 @@ detector settings easily into the other configurations. </span></p>
files) file performance</span></b><span lang=EN-US> when scrolling through files) file performance</span></b><span lang=EN-US> when scrolling through
audio data in Viewer mode. </span></p> audio data in Viewer mode. </span></p>
<p class=MsoNormal><b><span lang=EN-US>Viewer Launch</span></b><span
lang=EN-US> by right clicking on sqlite database and selecting ‘open with / Pamguard
ViewerMode launcher’ menu option.</span></p>
<h2><span lang=EN-US>Bug Fixes</span></h2> <h2><span lang=EN-US>Bug Fixes</span></h2>
<p class=MsoNormal><b><span lang=EN-US>Logger Forms</span></b></p> <p class=MsoNormal><b><span lang=EN-US>Logger Forms</span></b></p>
@ -493,7 +497,7 @@ correctly saving updated bearings to the database. Now fixed. </span></p>
<p class=MsoNormal><b><span lang=EN-US>ROCCA Classifier fixes</span></b></p> <p class=MsoNormal><b><span lang=EN-US>ROCCA Classifier fixes</span></b></p>
<p class=MsoNormal><span lang=EN-US>Allow Rocca to run without classifiers: Fixed <p class=MsoNormal><span lang=EN-US>Allow Rocca to run without classifiers: Fixed
bug that threw an error if no classifier files were  specified in Rocca Params bug that threw an error if no classifier files were  specified in Rocca Params
dialog</span></p> dialog</span></p>
<p class=MsoNormal><span lang=EN-US>Fix memory issue with <p class=MsoNormal><span lang=EN-US>Fix memory issue with
@ -506,9 +510,9 @@ and stop PamObserver Timer to</span></p>
<p class=MsoNormal><span lang=EN-US>Fix problem tracing whistles in Rocca <p class=MsoNormal><span lang=EN-US>Fix problem tracing whistles in Rocca
spectrogram pop-up: Whistle and raw data were being cleared before the user had spectrogram pop-up: Whistle and raw data were being cleared before the user had
time to trace out the whistle, causing PAMGuard to throw an exception.  Both time to trace out the whistle, causing PAMGuard to throw an exception.&nbsp;
were already being cleared when the pop-up window is closed, so no need to do Both were already being cleared when the pop-up window is closed, so no need to
it here.</span></p> do it here.</span></p>
<p class=MsoNormal><b><span lang=EN-US>DIFAR Module</span></b><span lang=EN-US>: <p class=MsoNormal><b><span lang=EN-US>DIFAR Module</span></b><span lang=EN-US>:
Bug crashing the module with null pointer errors fixed.</span></p> Bug crashing the module with null pointer errors fixed.</span></p>
@ -517,9 +521,13 @@ Bug crashing the module with null pointer errors fixed.</span></p>
lang=EN-US>: Fixed bug which caused the detector to slow to almost zero speed lang=EN-US>: Fixed bug which caused the detector to slow to almost zero speed
when large complex sounds with many branches were detected. </span></p> when large complex sounds with many branches were detected. </span></p>
<p class=MsoNormal><b><span lang=EN-US>Click Detector Offline Event Marking</span></b><span
lang=EN-US>: Fixed problem of events not being correctly deleted and also of
clicks not being correctly reassigned to different events. </span></p>
<p class=MsoNormal><b><span lang=EN-US>Screen Position</span></b><span <p class=MsoNormal><b><span lang=EN-US>Screen Position</span></b><span
lang=EN-US>: When using multiple monitors, if you move a configuration to a lang=EN-US>: When using multiple monitors, if you move a configuration to a
computer with a different monitor layout, the GUI should work out if its computer with a different monitor layout, the GUI should work out if it’s
opening on a screen area which no longer exists and move itself onto the opening on a screen area which no longer exists and move itself onto the
primary monitor. </span></p> primary monitor. </span></p>
@ -541,8 +549,8 @@ were reading local time, even when set to use UTC. </span></p>
which mostly occurred when processing large datasets of many offline files, has which mostly occurred when processing large datasets of many offline files, has
been fixed.</span></p> been fixed.</span></p>
<p class=MsoNormal><span lang=EN-US>Data Map: “Scroll To Data” pop-up menu, <p class=MsoNormal><span lang=EN-US>Data Map: “Scroll To Data” pop-up menu,
which didnt always scroll to the correct place, is now fixed. </span></p> which didn’t always scroll to the correct place, is now fixed. </span></p>
<p class=MsoNormal><span lang=EN-US>Bearing Localiser offline: If reprocessing <p class=MsoNormal><span lang=EN-US>Bearing Localiser offline: If reprocessing
bearings, the localizer was not correctly loading required raw or FFT data to bearings, the localizer was not correctly loading required raw or FFT data to
@ -565,7 +573,7 @@ files and stores them within the PAMGuard configuration. This does not affect
processing, but is important for record keeping. </span></p> processing, but is important for record keeping. </span></p>
<p class=MsoNormal><span lang=EN-US>GPS options to use any valid RMC or GGA <p class=MsoNormal><span lang=EN-US>GPS options to use any valid RMC or GGA
string. Not all GPS receivers output their RMC data as GPRMC e.g. some may string. Not all GPS receivers output their RMC data as GPRMC – e.g. some may
output as GNRMC. A new option allows the GPS module to use any string, whatever output as GNRMC. A new option allows the GPS module to use any string, whatever
the first two characters of the string name may be. </span></p> the first two characters of the string name may be. </span></p>
@ -574,14 +582,14 @@ the first two characters of the string name may be. </span></p>
<h2><span lang=EN-US>Bug Fixes</span></h2> <h2><span lang=EN-US>Bug Fixes</span></h2>
<p class=MsoNormal><span lang=EN-US>Use of localization sensor and orientation <p class=MsoNormal><span lang=EN-US>Use of localization sensor and orientation
data for static hydrophones had a bug whereby it would continually forget 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. </span></p> angle offsets applied to static hydrophones in viewer mode. This is now fixed. </span></p>
<p class=MsoNormal><span lang=EN-US>Click tool bar: Correctly shows event <p class=MsoNormal><span lang=EN-US>Click tool bar: Correctly shows event
selection options even if no species classification options are in place. </span></p> selection options even if no species classification options are in place. </span></p>
<p class=MsoNormal><span lang=EN-US>Fixed Landmarks: Earlier versions were <p class=MsoNormal><span lang=EN-US>Fixed Landmarks: Earlier versions were
losing these every time PAMGuard started or new data were loaded in viewer ‘losing’ these every time PAMGuard started or new data were loaded in viewer
mode. Now fixed. </span></p> mode. Now fixed. </span></p>
<p class=MsoNormal><span lang=EN-US>ROCCA: Fixed (another) memory leak which <p class=MsoNormal><span lang=EN-US>ROCCA: Fixed (another) memory leak which
@ -600,11 +608,11 @@ processing.</span></p>
<p class=MsoNormal><span lang=EN-US>New sound type for simulated sounds which <p class=MsoNormal><span lang=EN-US>New sound type for simulated sounds which
generates random chirps between around 200 and 800Hz, roughly the frequency generates random chirps between around 200 and 800Hz, roughly the frequency
youd expect sound from higher frequency baleen whales, such as humpbacks, to you’d expect sound from higher frequency baleen whales, such as humpbacks, to
vocalise at. &nbsp;&nbsp;</span></p> vocalise at. &nbsp;&nbsp;</span></p>
<p class=MsoNormal><span lang=EN-US>Hiding tool tips. A menu item to <p class=MsoNormal><span lang=EN-US>Hiding tool tips. A menu item to
permanently turn off all tool tips, or tap the Esc key to turn them off for 6 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 seconds if they are getting in the way, particularly when trying to interact
with displays using the mouse. </span></p> with displays using the mouse. </span></p>
@ -625,7 +633,7 @@ whistle classification module.</span></p>
<h2><span lang=EN-US>New Features</span></h2> <h2><span lang=EN-US>New Features</span></h2>
<p class=MsoNormal><span lang=EN-US>SoundTrap SUD file reading. If youre using <p class=MsoNormal><span lang=EN-US>SoundTrap SUD file reading. If you’re using
SoundTrap autonomous recorders from Ocean Instruments, you no longer need to SoundTrap autonomous recorders from Ocean Instruments, you no longer need to
decompress the SoundTrap files prior to processing. This will save time and a 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 lot of disk space. Extraction of clicks from the inbuilt SoundTrap Click
@ -689,7 +697,7 @@ audio files. </span></p>
<h2><span lang=EN-US>Bug Fixes</span></h2> <h2><span lang=EN-US>Bug Fixes</span></h2>
<p class=MsoNormal><span lang=EN-US>Soundtrap DWV import. Will now generate <p class=MsoNormal><span lang=EN-US>Soundtrap DWV import. Will now generate
binary files even if DWV file doesnÂt exist (which is correct behavior in binary files even if DWV file doesn’t exist (which is correct behavior in
quiet conditions when no clicks were detected). </span></p> quiet conditions when no clicks were detected). </span></p>
<p class=MsoNormal><span lang=EN-US>Spectrogram. Changes to stop occasional <p class=MsoNormal><span lang=EN-US>Spectrogram. Changes to stop occasional
@ -724,8 +732,8 @@ running in real time. Added template names based on file names. </p>
<p class=MsoNormal>#13 Merging files when offline processing file folders: Had <p class=MsoNormal>#13 Merging files when offline processing file folders: Had
an error introduced in last release which caused it to fail to recognise gaps an error introduced in last release which caused it to fail to recognise gaps
between files, meaning that some output data (i.e. after a gap) would have an between files, meaning that some output data (i.e. after a gap) would have an
incorrect time stamp. This did not affect data if the ‘merge contiguous incorrect time stamp. This did not affect data if the ‘merge contiguous
files’ option was not selected. </p> files’ option was not selected. </p>
<p class=MsoNormal>#14 Logger forms data were not plotting correctly. This was <p class=MsoNormal>#14 Logger forms data were not plotting correctly. This was
due to the required data selection functions not being fully implemented. This due to the required data selection functions not being fully implemented. This
@ -787,17 +795,16 @@ font-family:"Times New Roman",serif'>&nbsp;</span></p>
<p class=MsoNormal><b><span lang=EN-US>Localisation Modules</span></b><span <p class=MsoNormal><b><span lang=EN-US>Localisation Modules</span></b><span
lang=EN-US> </span></p> lang=EN-US> </span></p>
<p class=MsoNormal>Bearing and Group 3D localization modules have been <p class=MsoNormal>Bearing and Group 3D localization modules have been thoroughly
thoroughly tested and a number of bugs rectified. Documentation has been tested and a number of bugs rectified. Documentation has been developed and is
developed and is available in the online help. Further, a number of example available in the online help. Further, a number of example configurations have
configurations have been generated, configuration files for these are available been generated, configuration files for these are available in the PAMGuard
in the PAMGuard downloads area <a downloads area <a href="http://www.pamguard.org/downloads.php?cat_id=3">here</a>.</p>
href="http://www.pamguard.org/downloads.php?cat_id=3">here</a>.</p>
<p class=MsoNormal><b><span lang=EN-US>Detection Group Localiser</span></b><span <p class=MsoNormal><b><span lang=EN-US>Detection Group Localiser</span></b><span
lang=EN-US> </span></p> lang=EN-US> </span></p>
<p class=MsoNormal>This module has been renamed ÓDetection GrouperÔ, so <p class=MsoNormal>This module has been renamed “Detection Grouper”, so
as to avoid confusion with the Group 3D localizer. This is because the 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 Detection Grouper is more for organizing data into groups to be localized than
it is for doing localization.</p> it is for doing localization.</p>
@ -919,9 +926,9 @@ included in a future release. </p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>17. </span><span <p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>17. </span><span
lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
lang=EN-US> </span>An implementation of the Generalized Power Law Detector, lang=EN-US> </span>An implementation of the Generalized Power Law Detector,
developed by Tyler Helble ([Helble et al., ‘A generalized power-law developed by Tyler Helble ([Helble et al., ‘A generalized power-law
detection algorithm for humpback whale vocalizations’, The Journal of the detection algorithm for humpback whale vocalizations’, The Journal of the
Acoustical Society of America, vol. 131, no. 4, pp. 2682–2699, 2012) is now Acoustical Society of America, vol. 131, no. 4, pp. 2682–2699, 2012) is now
available. For details, see the online help </p> available. For details, see the online help </p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>18. </span><span <p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>18. </span><span
@ -1050,11 +1057,11 @@ understand the notes listed for <a href="#_Latest_Beta_Version_2.00.10">Beta
Version 2.00.10</a> before proceeding with installation and use of this Version 2.00.10</a> before proceeding with installation and use of this
version.</b></p> version.</b></p>
<p class=MsoNormal>This version of PAMGuard has been bundled with Java 13 <p class=MsoNormal>This version of PAMGuard has been bundled with Java 13 (release
(release 13.0.1). PSFX files generated in previous beta releases (2.xx.xx) 13.0.1). PSFX files generated in previous beta releases (2.xx.xx) should be
should be compatible with this version, and vice-versa. PSF files generated in compatible with this version, and vice-versa. PSF files generated in core
core releases (1.15.xx) can be loaded in this version, but will be converted to releases (1.15.xx) can be loaded in this version, but will be converted to PSFX
PSFX files when PAMGuard exits.</p> files when PAMGuard exits.</p>
<p class=MsoNormal><b><span lang=EN-US>Bug Fixes</span></b></p> <p class=MsoNormal><b><span lang=EN-US>Bug Fixes</span></b></p>
@ -1187,8 +1194,8 @@ lang=EN-US> </span>Add option to alarm module to attach screenshots of all
frames to email alerts. </p> frames to email alerts. </p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>7. </span><span <p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>7. </span><span
lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
Add Beamformer and Bearing Localiser modules </p> lang=EN-US> </span>Add Beamformer and Bearing Localiser modules </p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>8. </span><span <p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>8. </span><span
lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
@ -1311,9 +1318,9 @@ Bug 446. Multiple PamDataBlocks with same name turn on/off together in
Spectrogram display.</p> Spectrogram display.</p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>15. </span><span <p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>15. </span><span
lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
Bug 447. Viewer mode throws exception when trying to load beamformer lang=EN-US> </span>Bug 447. Viewer mode throws exception when trying to load
localisations</p> beamformer localisations</p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>16. </span><span <p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>16. </span><span
lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
@ -1816,9 +1823,9 @@ see new options in main menu.</p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>2. </span><span <p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>2. </span><span
lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
lang=EN-US> </span>Added Matched Template Click Classifier. Classifies clicks lang=EN-US> </span>Added Matched Template Click Classifier. Classifies clicks based
based on an ideal template to match and a template to reject. An example of on an ideal template to match and a template to reject. An example of this is
this is to classify beaked whale clicks in an environment with dolphin clicks.</p> to classify beaked whale clicks in an environment with dolphin clicks.</p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>3. </span><span <p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>3. </span><span
lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
@ -1933,12 +1940,12 @@ A number of upgrades and fixes to the Localiser algorithms, including expanding
to work with whistles.</p> to work with whistles.</p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>3. </span><span <p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>3. </span><span
lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
Added option to export all settings and parameters as an XML-formatted file. lang=EN-US> </span>Added option to export all settings and parameters as an
Note that this required changes to the structure of the Array Manager, and as XML-formatted file. Note that this required changes to the structure of the
such any settings (psf) files created with this version of Pamguard cannot be Array Manager, and as such any settings (psf) files created with this version
used in older versions. Older psf files can be loaded with this version, but of Pamguard cannot be used in older versions. Older psf files can be loaded
will be converted.</p> with this version, but will be converted.</p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>4. </span><span <p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>4. </span><span
lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
@ -2090,8 +2097,8 @@ lang=EN-US> </span>User is now able to specify Soundtrap date/time format</p>
<h1><a name="_Latest_Beta_Version_2.00.11"></a><span lang=EN-US>Beta Version <h1><a name="_Latest_Beta_Version_2.00.11"></a><span lang=EN-US>Beta Version
2.00.11 October 2017</span></h1> 2.00.11 October 2017</span></h1>
<p class=MsoNormal><span lang=EN-US>PAMGuard Version 2 contains major updates. <p class=MsoNormal><span lang=EN-US>PAMGuard Version 2 contains major updates. You
You should read and understand the notes listed for <a should read and understand the notes listed for <a
href="#_Latest_Beta_Version_2.00.10">Beta Version 2.00.10</a> before proceeding href="#_Latest_Beta_Version_2.00.10">Beta Version 2.00.10</a> before proceeding
with installation and use of this version.</span></p> with installation and use of this version.</span></p>
@ -2194,7 +2201,7 @@ 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 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 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. link with any data post processed in Matlab or other custom analysis software.
UID’s are also added to PAMGuard database tables. </span></p> UID’s are also added to PAMGuard database tables. </span></p>
<h4><span lang=EN-US>Converting Old Data</span></h4> <h4><span lang=EN-US>Converting Old Data</span></h4>
@ -2202,13 +2209,13 @@ UID’s are also added to PAMGuard database tables. </span></p>
viewer they will automatically be converted. For safety, the original binary viewer they will automatically be converted. For safety, the original binary
files will not be overwritten and the new data will be placed in a new folder files will not be overwritten and the new data will be placed in a new folder
on your computer with the same path as the old data, but suffixed with on your computer with the same path as the old data, but suffixed with
ÃÂ_WithUIDÃÂ, e.g. if your binary data were previously stored in the folder ‘_WithUID’, e.g. if your binary data were previously stored in the folder
C:\MySurvey\binarydata the new data will be written to C:\MySurvey\binarydata the new data will be written to
C:\MySurvey\binarydata_WithUID. </span></p> C:\MySurvey\binarydata_WithUID. </span></p>
<p class=MsoNormal><span lang=EN-US>The additional UID column will be added to <p class=MsoNormal><span lang=EN-US>The additional UID column will be added to
all database tables and populated with unique values. For data which are stored all database tables and populated with unique values. For data which are stored
in both the binary files and in database tables, the same UID’s will be used in both the binary files and in database tables, the same UID’s will be used
in both data stores. </span></p> in both data stores. </span></p>
<h3><span lang=EN-US>New Displays</span></h3> <h3><span lang=EN-US>New Displays</span></h3>
@ -2350,10 +2357,9 @@ happens when the user selects save as new configuration. This has been fixed.</p
<p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>6.</span><span <p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>6.</span><span
lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>Bug 315. code searched for file in working folder, which is the </span>Bug 315. code searched for file in working folder, which is the installation
installation folder when starting PAMGuard using a shortcut link. But when folder when starting PAMGuard using a shortcut link. But when double-clicking
double-clicking on a psf, the working folder is the location of the psf. This on a psf, the working folder is the location of the psf. This has been fixed.</p>
has been fixed.</p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>7.</span><span <p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>7.</span><span
lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span lang=EN-US style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span
@ -2413,9 +2419,9 @@ dependencies)</span></p>
<p class=MsoNormal><b><span lang=EN-US>Other Changes</span></b></p> <p class=MsoNormal><b><span lang=EN-US>Other Changes</span></b></p>
<p class=MsoNormal><span lang=EN-US>The installer has been updated to handle <p class=MsoNormal><span lang=EN-US>The installer has been updated to handle both
both 64 bit and 32 bit installations. PAMGuard psf files are now registered in 64 bit and 32 bit installations. PAMGuard psf files are now registered in the
the Windows Registry, so double-clicking on a psf file should run PAMGuard in 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 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, Registry can only hold a single executable reference for psf files; therefore,
for users with multiple installations of PAMGuard, double-clicking on a psf for users with multiple installations of PAMGuard, double-clicking on a psf
@ -2443,7 +2449,7 @@ November 2016</span></h1>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>1.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <p class=MsoListParagraph style='text-indent:-18.0pt'><span lang=EN-US>1.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Bug 303. Some ASIO sound cards not working with either ASIO system in PAMGuard. Bug 303. Some ASIO sound cards not working with either ASIO system in PAMGuard.
For the PAMGuard ASIO system, this was due to a data format used by some sound For the PAMGuard ASIO system, this was due to a data format used by some sound
cards never being properly implemented. For the ÓNew ASIO systemÔ which cards never being properly implemented. For the “New ASIO system” which
is based on jAsioHost, the unpacking of that format contained a bug which is based on jAsioHost, the unpacking of that format contained a bug which
returned incorrect numbers, so data were swamped with noise. Both systems are returned incorrect numbers, so data were swamped with noise. Both systems are
now fixed. By preference, users should use the PAMGuard ASIO system since the now fixed. By preference, users should use the PAMGuard ASIO system since the
@ -3395,8 +3401,8 @@ whistle.</p>
<li class=MsoNormal style='margin-bottom:0cm'>Airgun display. If this was <li class=MsoNormal style='margin-bottom:0cm'>Airgun display. If this was
included in the PAMGuard model before the GPS module it would hang included in the PAMGuard model before the GPS module it would hang
PAMGuard. This has been rectified. </li> PAMGuard. This has been rectified. </li>
<li class=MsoNormal style='margin-bottom:0cm'>Fixed occasional exceptions in <li class=MsoNormal style='margin-bottom:0cm'>Fixed occasional exceptions in the
the sound output modules when playing back from files. </li> sound output modules when playing back from files. </li>
<li class=MsoNormal style='margin-bottom:0cm'>Fixed exceptions in spectrogram <li class=MsoNormal style='margin-bottom:0cm'>Fixed exceptions in spectrogram
user interface. </li> user interface. </li>
<li class=MsoNormal style='margin-bottom:0cm'>Fixed National Instruments sound <li class=MsoNormal style='margin-bottom:0cm'>Fixed National Instruments sound
@ -3478,8 +3484,8 @@ other data sources for the PAMGuard viewer. </p>
storage to the database offline for any module having both binary and database storage to the database offline for any module having both binary and database
storage. </p> storage. </p>
<p class=MsoNormal style='margin-left:36.0pt'>Can create a blank MS Access <p class=MsoNormal style='margin-left:36.0pt'>Can create a blank MS Access database
database (2007 and later *.accdb formats only).</p> (2007 and later *.accdb formats only).</p>
<p class=MsoNormal style='margin-left:36.0pt'>Can open MS Access from within <p class=MsoNormal style='margin-left:36.0pt'>Can open MS Access from within
PAMGuard to make it easier to view database content. </p> PAMGuard to make it easier to view database content. </p>
@ -3798,10 +3804,10 @@ source, even if that data source is loaded after the FFT module is created.</p>
<p class=MsoNormal>1. Binary storage module. </p> <p class=MsoNormal>1. Binary storage module. </p>
<p class=MsoNormal>Performs a parallel role to the PAMGAURD database but uses <p class=MsoNormal>Performs a parallel role to the PAMGAURD database but uses binary
binary files in a proprietary format which is considerably more efficient for files in a proprietary format which is considerably more efficient for data of
data of unknown length such as whistle contours or small clips of click unknown length such as whistle contours or small clips of click waveform. This
waveform. This feature is currently implemented in the following modules:</p> feature is currently implemented in the following modules:</p>
<p class=MsoListParagraph style='text-indent:-18.0pt'><span style='font-family: <p class=MsoListParagraph style='text-indent:-18.0pt'><span style='font-family:
Symbol'>'</span><span style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Symbol'>'</span><span style='font-size:7.0pt;font-family:"Times New Roman",serif'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
@ -4010,8 +4016,8 @@ column was setting to zero. This is now fixed</p>
<p class=MsoNormal>Ishmael Detectors</p> <p class=MsoNormal>Ishmael Detectors</p>
<p class=MsoNormal>Better rendering of detection boxes on spectrogram display <p class=MsoNormal>Better rendering of detection boxes on spectrogram display and
and more meaningful names in spectrogram display menu.</p> more meaningful names in spectrogram display menu.</p>
<p class=MsoNormal>Sound acquisition</p> <p class=MsoNormal>Sound acquisition</p>

View File

@ -4,7 +4,7 @@
<groupId>org.pamguard</groupId> <groupId>org.pamguard</groupId>
<artifactId>Pamguard</artifactId> <artifactId>Pamguard</artifactId>
<name>Pamguard Java12+</name> <name>Pamguard Java12+</name>
<version>2.02.09f</version> <version>2.02.09aa</version>
<description>Pamguard for Java 12+, using Maven to control dependcies</description> <description>Pamguard for Java 12+, using Maven to control dependcies</description>
<url>www.pamguard.org</url> <url>www.pamguard.org</url>
<organization> <organization>
@ -17,6 +17,7 @@
<resource> <resource>
<directory>src</directory> <directory>src</directory>
<excludes> <excludes>
<exclude>META-INF/*.SF,META-INF/*.DSA,META-INF/*.RSA</exclude>
<exclude>**/*.java</exclude> <exclude>**/*.java</exclude>
<exclude>jars/*.*</exclude> <exclude>jars/*.*</exclude>
</excludes> </excludes>
@ -196,6 +197,10 @@
<properties> <properties>
<maven.compiler.target>11</maven.compiler.target> <maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source> <maven.compiler.source>11</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<javafx.version>16</javafx.version> <javafx.version>16</javafx.version>
<jaxb.runtime.version>2.4.0-b180830.0438</jaxb.runtime.version>
<jaxb.xjc.version>2.4.0-b180830.0438</jaxb.xjc.version>
<jaxb.api.version>2.4.0-b180830.0359</jaxb.api.version>
</properties> </properties>
</project> </project>

1429
pom.xml

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,4 @@
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
#Thu Dec 21 11:13:37 GMT 2023
javaclient-3.0.jar>=
javaclient-3.0.pom>=

Binary file not shown.

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>tethys.org</groupId>
<artifactId>javaclient</artifactId>
<version>3.0</version>
<description>POM was created from install:install-file</description>
</project>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>tethys.org</groupId>
<artifactId>javaclient</artifactId>
<versioning>
<release>3.0</release>
<versions>
<version>3.0</version>
</versions>
<lastUpdated>20231221111337</lastUpdated>
</versioning>
</metadata>

View File

@ -0,0 +1,4 @@
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
#Thu Dec 21 11:14:13 GMT 2023
nilus-3.0.pom>=
nilus-3.0.jar>=

View File

@ -0,0 +1,11 @@
#Thu Dec 21 16:45:12 GMT 2023
bedatadriven|https\://nexus.bedatadriven.com/content/groups/public/|javadoc=1703177112968
talan|https\://nexus.talanlabs.com/content/repositories/releases/|javadoc=1703177112968
repo|file\://C\:\\Users\\dg50\\source\\repos\\PAMGuardDG_2/repo|javadoc=1703177112968
central|https\://repo1.maven.org/maven2|sources=1703157324238
unidata-all|https\://artifacts.unidata.ucar.edu/repository/unidata-all/|javadoc=1703177112968
repo|file\://C\:\\Users\\dg50\\source\\repos\\PAMGuardDG_2/repo|sources=1703157324238
talan|https\://nexus.talanlabs.com/content/repositories/releases/|sources=1703157324238
bedatadriven|https\://nexus.bedatadriven.com/content/groups/public/|sources=1703157324238
unidata-all|https\://artifacts.unidata.ucar.edu/repository/unidata-all/|sources=1703157324238
central|https\://repo1.maven.org/maven2|javadoc=1703177112968

View File

@ -0,0 +1,12 @@
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
#Thu Dec 21 16:45:12 GMT 2023
@default-talan-https\://nexus.talanlabs.com/content/repositories/releases/.lastUpdated=1703177112601
https\://repo1.maven.org/maven2/.error=
file\://C\:\\Users\\dg50\\source\\repos\\PAMGuardDG_2/repo/.error=
file\://C\:\\Users\\dg50\\source\\repos\\PAMGuardDG_2/repo/.lastUpdated=1703177110940
https\://artifacts.unidata.ucar.edu/repository/unidata-all/.error=
https\://nexus.bedatadriven.com/content/groups/public/.error=
https\://nexus.bedatadriven.com/content/groups/public/.lastUpdated=1703177112519
https\://artifacts.unidata.ucar.edu/repository/unidata-all/.lastUpdated=1703177112101
https\://repo1.maven.org/maven2/.lastUpdated=1703177112965
https\://nexus.talanlabs.com/content/repositories/releases/.error=Could not transfer artifact tethys.org\:nilus\:jar\:javadoc\:3.0 from/to talan (https\://nexus.talanlabs.com/content/repositories/releases/)\: nexus.talanlabs.com

View File

@ -0,0 +1,12 @@
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
#Thu Dec 21 11:15:24 GMT 2023
@default-talan-https\://nexus.talanlabs.com/content/repositories/releases/.lastUpdated=1703157323819
https\://repo1.maven.org/maven2/.error=
file\://C\:\\Users\\dg50\\source\\repos\\PAMGuardDG_2/repo/.error=
file\://C\:\\Users\\dg50\\source\\repos\\PAMGuardDG_2/repo/.lastUpdated=1703157322932
https\://artifacts.unidata.ucar.edu/repository/unidata-all/.error=
https\://nexus.bedatadriven.com/content/groups/public/.error=
https\://nexus.bedatadriven.com/content/groups/public/.lastUpdated=1703157323770
https\://artifacts.unidata.ucar.edu/repository/unidata-all/.lastUpdated=1703157323508
https\://repo1.maven.org/maven2/.lastUpdated=1703157324237
https\://nexus.talanlabs.com/content/repositories/releases/.error=Could not transfer artifact tethys.org\:nilus\:jar\:sources\:3.0 from/to talan (https\://nexus.talanlabs.com/content/repositories/releases/)\: nexus.talanlabs.com

Binary file not shown.

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>tethys.org</groupId>
<artifactId>nilus</artifactId>
<version>3.0</version>
<description>POM was created from install:install-file</description>
</project>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>tethys.org</groupId>
<artifactId>nilus</artifactId>
<versioning>
<release>3.0</release>
<versions>
<version>3.0</version>
</versions>
<lastUpdated>20231221111413</lastUpdated>
</versioning>
</metadata>

View File

@ -5,6 +5,7 @@ import java.lang.reflect.Field;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamModel.parametermanager.PrivatePamParameterData; import PamModel.parametermanager.PrivatePamParameterData;
public class AISParameters implements Serializable, Cloneable, ManagedParameters { public class AISParameters implements Serializable, Cloneable, ManagedParameters {
@ -51,7 +52,7 @@ public class AISParameters implements Serializable, Cloneable, ManagedParameters
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
try { try {
Field field = this.getClass().getDeclaredField("nmeaSource"); Field field = this.getClass().getDeclaredField("nmeaSource");
ps.put(new PrivatePamParameterData(this, field) { ps.put(new PrivatePamParameterData(this, field) {

View File

@ -5,6 +5,7 @@ import java.io.Serializable;
import NMEA.NMEABitArray; import NMEA.NMEABitArray;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamUtils.LatLong; import PamUtils.LatLong;
/** /**
@ -160,7 +161,7 @@ sensor.
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
return ps; return ps;
} }

View File

@ -6,6 +6,7 @@ import java.util.Calendar;
import NMEA.NMEABitArray; import NMEA.NMEABitArray;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamUtils.PamCalendar; import PamUtils.PamCalendar;
public class AISStaticData extends AISReport implements Serializable, ManagedParameters{ public class AISStaticData extends AISReport implements Serializable, ManagedParameters{
@ -393,7 +394,7 @@ public class AISStaticData extends AISReport implements Serializable, ManagedPar
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
return ps; return ps;
} }

View File

@ -283,6 +283,16 @@ public class AcquisitionControl extends RawInputControlledUnit implements PamSet
return daqControllers; return daqControllers;
} }
@Override
public String getDataLocation() {
if (offlineFileServer == null) {
return null;
}
else {
return offlineFileServer.getDataLocation();
}
}
public AcquisitionProcess getDaqProcess() { public AcquisitionProcess getDaqProcess() {
return acquisitionProcess; return acquisitionProcess;
} }

View File

@ -151,6 +151,7 @@ public class AcquisitionDialog extends PamDialog {
acquisitionParameters = oldParams.clone(); acquisitionParameters = oldParams.clone();
acquisitionControl = daqControl; acquisitionControl = daqControl;
// singleInstance = null;
if (singleInstance == null || singleInstance.getOwner() != parentFrame) { if (singleInstance == null || singleInstance.getOwner() != parentFrame) {
singleInstance = new AcquisitionDialog(parentFrame); singleInstance = new AcquisitionDialog(parentFrame);

View File

@ -10,6 +10,7 @@ import Array.Preamplifier;
import PamController.PamController; import PamController.PamController;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamModel.parametermanager.PrivatePamParameterData; import PamModel.parametermanager.PrivatePamParameterData;
import PamguardMVC.PamConstants; import PamguardMVC.PamConstants;
@ -320,7 +321,7 @@ public class AcquisitionParameters implements Serializable, Cloneable, ManagedPa
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
try { try {
Field field = this.getClass().getDeclaredField("channelList"); Field field = this.getClass().getDeclaredField("channelList");
ps.put(new PrivatePamParameterData(this, field) { ps.put(new PrivatePamParameterData(this, field) {

View File

@ -5,6 +5,7 @@ import java.lang.reflect.Field;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamModel.parametermanager.PrivatePamParameterData; import PamModel.parametermanager.PrivatePamParameterData;
import binaryFileStorage.BinaryHeader; import binaryFileStorage.BinaryHeader;
import binaryFileStorage.BinaryObjectData; import binaryFileStorage.BinaryObjectData;
@ -30,7 +31,7 @@ class DaqStatusModuleHeader extends ModuleHeader implements Serializable, Manage
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
try { try {
Field field = this.getClass().getDeclaredField("daqName"); Field field = this.getClass().getDeclaredField("daqName");
ps.put(new PrivatePamParameterData(this, field) { ps.put(new PrivatePamParameterData(this, field) {

View File

@ -5,6 +5,7 @@ import java.util.ArrayList;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
/** /**
* Used by FileInputSystem * Used by FileInputSystem
@ -78,7 +79,7 @@ public class FileInputParameters implements Serializable, Cloneable, ManagedPara
return null; return null;
} }
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
return ps; return ps;
} }
} }

View File

@ -700,7 +700,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
if (currentFile > 0 && currentFile >= allFiles.size()) { if (currentFile > 0 && currentFile >= allFiles.size()) {
fileListComplete(); fileListComplete();
} }
// System.out.println("FolderinputSytem: daqHasEnded"); System.out.println("FolderinputSytem: daqHasEnded");
} }
private void setFolderProgress() { private void setFolderProgress() {

View File

@ -4,6 +4,7 @@ import java.io.Serializable;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import simulatedAcquisition.SimProcess; import simulatedAcquisition.SimProcess;
/** /**
@ -47,7 +48,7 @@ public class SoundCardParameters implements Serializable, Cloneable, ManagedPara
return null; return null;
} }
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
return ps; return ps;
} }
} }

View File

@ -6,6 +6,7 @@ import java.util.TimeZone;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import soundtrap.STXMLFile; import soundtrap.STXMLFile;
public class StandardFileDateSettings implements Serializable, Cloneable, ManagedParameters { public class StandardFileDateSettings implements Serializable, Cloneable, ManagedParameters {
@ -150,7 +151,7 @@ public class StandardFileDateSettings implements Serializable, Cloneable, Manage
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
return ps; return ps;
} }
} }

View File

@ -6,6 +6,7 @@ import Acquisition.AcquisitionControl;
import Acquisition.AcquisitionDialog; import Acquisition.AcquisitionDialog;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
public class PPSParameters implements Cloneable, Serializable, ManagedParameters { public class PPSParameters implements Cloneable, Serializable, ManagedParameters {
@ -36,7 +37,7 @@ public class PPSParameters implements Cloneable, Serializable, ManagedParameters
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
return ps; return ps;
} }

View File

@ -6,6 +6,7 @@ import java.lang.reflect.Field;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamModel.parametermanager.PrivatePamParameterData; import PamModel.parametermanager.PrivatePamParameterData;
import PamUtils.LatLong; import PamUtils.LatLong;
@ -95,7 +96,7 @@ public class AirgunParameters implements Serializable, Cloneable, ManagedParamet
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
try { try {
Field field = this.getClass().getDeclaredField("dimE"); Field field = this.getClass().getDeclaredField("dimE");
ps.put(new PrivatePamParameterData(this, field) { ps.put(new PrivatePamParameterData(this, field) {

View File

@ -44,6 +44,8 @@ public class ArrayDialog extends PamDialog implements ActionListener {
private EnvironmentPanel environmentPanel; private EnvironmentPanel environmentPanel;
private HydrophoneDiagram hydrophoneDiagram; private HydrophoneDiagram hydrophoneDiagram;
private InstrumentIdentityPanel instrumentIdentityPanel;
private JButton okButton, cancelButton; private JButton okButton, cancelButton;
@ -69,11 +71,14 @@ public class ArrayDialog extends PamDialog implements ActionListener {
eastPanel.add(channelPanel.getChannelPanel()); eastPanel.add(channelPanel.getChannelPanel());
environmentPanel = new EnvironmentPanel(this); environmentPanel = new EnvironmentPanel(this);
instrumentIdentityPanel = new InstrumentIdentityPanel();
// eastPanel.add(environmentPanel.getEnvironmentPanel());
hydrophoneDiagram = new HydrophoneDiagram(this); hydrophoneDiagram = new HydrophoneDiagram(this);
JPanel westPanel = new JPanel(new BorderLayout()); JPanel westPanel = new JPanel(new BorderLayout());
westPanel.add(BorderLayout.CENTER, hydrophoneDiagram.getPlotPanel()); westPanel.add(BorderLayout.CENTER, hydrophoneDiagram.getPlotPanel());
westPanel.add(BorderLayout.SOUTH, environmentPanel.getEnvironmentPanel()); westPanel.add(BorderLayout.SOUTH, environmentPanel.getEnvironmentPanel());
westPanel.add(BorderLayout.NORTH, instrumentIdentityPanel.getComponent());
splitPanel.add(westPanel); splitPanel.add(westPanel);
@ -144,6 +149,7 @@ public class ArrayDialog extends PamDialog implements ActionListener {
hydrophoneDialogPanel.setParams(selArray); hydrophoneDialogPanel.setParams(selArray);
channelPanel.setParams(); channelPanel.setParams();
hydrophoneDiagram.rePaint(); hydrophoneDiagram.rePaint();
instrumentIdentityPanel.setParams(selArray);
if (selArray != null) { if (selArray != null) {
environmentPanel.setNewSpeed(selArray.getSpeedOfSound()); environmentPanel.setNewSpeed(selArray.getSpeedOfSound());
} }
@ -171,6 +177,7 @@ public class ArrayDialog extends PamDialog implements ActionListener {
array.setSpeedOfSound(environmentPanel.getNewSpeed()); array.setSpeedOfSound(environmentPanel.getNewSpeed());
array.setSpeedOfSoundError(environmentPanel.getNewError()); array.setSpeedOfSoundError(environmentPanel.getNewError());
hydrophoneDialogPanel.getParams(); hydrophoneDialogPanel.getParams();
instrumentIdentityPanel.getParams(array);
if (checkDaqChannels(array) == false) { if (checkDaqChannels(array) == false) {
return false; return false;
@ -250,6 +257,7 @@ public class ArrayDialog extends PamDialog implements ActionListener {
environmentPanel.setNewSpeed(currentArray.getSpeedOfSound()); environmentPanel.setNewSpeed(currentArray.getSpeedOfSound());
environmentPanel.setNewError(currentArray.getSpeedOfSoundError()); environmentPanel.setNewError(currentArray.getSpeedOfSoundError());
} }
instrumentIdentityPanel.setParams(currentArray);
} }
void newChannelSelection() { void newChannelSelection() {

View File

@ -28,6 +28,7 @@ import java.util.Arrays;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamModel.parametermanager.PrivatePamParameterData; import PamModel.parametermanager.PrivatePamParameterData;
import pamMaths.PamVector; import pamMaths.PamVector;
import PamView.PamSymbol; import PamView.PamSymbol;
@ -158,7 +159,7 @@ public class Hydrophone implements Serializable, Cloneable, ManagedParameters {
return sensitivity; return sensitivity;
} }
protected void setSensitivity(double sensitivity) { public void setSensitivity(double sensitivity) {
this.sensitivity = sensitivity; this.sensitivity = sensitivity;
} }
@ -333,7 +334,7 @@ public class Hydrophone implements Serializable, Cloneable, ManagedParameters {
/** /**
* @return Returns the coordinate. * @return Returns the coordinate.
*/ */
protected double[] getCoordinates() { public double[] getCoordinates() {
return Arrays.copyOf(coordinate,3); return Arrays.copyOf(coordinate,3);
} }
@ -364,7 +365,7 @@ public class Hydrophone implements Serializable, Cloneable, ManagedParameters {
/** /**
* @param preampGain The preampGain to set. * @param preampGain The preampGain to set.
*/ */
protected void setPreampGain(double preampGain) { public void setPreampGain(double preampGain) {
this.preampGain = preampGain; this.preampGain = preampGain;
} }
@ -478,7 +479,7 @@ public class Hydrophone implements Serializable, Cloneable, ManagedParameters {
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet pps = PamParameterSet.autoGenerate(this); PamParameterSet pps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
Field f; Field f;
try { try {
f = this.getClass().getDeclaredField("coordinate"); f = this.getClass().getDeclaredField("coordinate");

View File

@ -7,6 +7,7 @@ import Array.streamerOrigin.StreamerDataIterator;
import GPS.GpsData; import GPS.GpsData;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamModel.parametermanager.PrivatePamParameterData; import PamModel.parametermanager.PrivatePamParameterData;
import PamUtils.LatLong; import PamUtils.LatLong;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
@ -225,7 +226,7 @@ abstract public class HydrophoneLocator implements Serializable, Cloneable, Mana
*/ */
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
try { try {
Field field = this.getClass().getDeclaredField("pamArray"); Field field = this.getClass().getDeclaredField("pamArray");
ps.put(new PrivatePamParameterData(this, field) { ps.put(new PrivatePamParameterData(this, field) {

View File

@ -0,0 +1,72 @@
package Array;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.TitledBorder;
import PamView.dialog.PamGridBagContraints;
import PamView.panel.WestAlignedPanel;
/**
* Instrument identity panel, contrians additional fields required by Tethys.
* @author dg50
*
*/
public class InstrumentIdentityPanel {
private JPanel mainPanel;
private JTextField instrumentId;
private JTextField instrumentType;
public InstrumentIdentityPanel() {
mainPanel = new WestAlignedPanel();
mainPanel.setBorder(new TitledBorder("Instrument information"));
mainPanel.setLayout(new GridBagLayout());
GridBagConstraints c = new PamGridBagContraints();
mainPanel.add(new JLabel("Instrument Type ", JLabel.RIGHT), c);
c.gridx++;
mainPanel.add(instrumentType = new JTextField(20), c);
c.gridx = 0;
c.gridy++;
mainPanel.add(new JLabel("Instrument Id ", JLabel.RIGHT), c);
c.gridx++;
mainPanel.add(instrumentId = new JTextField(20), c);
instrumentType.setToolTipText("Instrument type, e.g. Towed array, HARP, EAR, Popup, DMON, Rock Hopper, etc.");
instrumentId.setToolTipText("Instrument identifier, e.g. serial number");
}
public JComponent getComponent() {
return mainPanel;
}
public void setParams(PamArray currentArray) {
if (currentArray == null) {
currentArray = ArrayManager.getArrayManager().getCurrentArray();
}
if (currentArray == null) {
return;
}
instrumentType.setText(currentArray.getInstrumentType());
instrumentId.setText(currentArray.getInstrumentId());
}
public void getParams(PamArray currentArray) {
if (currentArray == null) {
currentArray = ArrayManager.getArrayManager().getCurrentArray();
}
if (currentArray == null) {
return;
}
currentArray.setInstrumentType(instrumentType.getText());
currentArray.setInstrumentId(instrumentId.getText());
}
}

View File

@ -16,5 +16,10 @@ abstract public class MovingHydrophoneLocator extends SimpleHydrophoneLocator {
super(pamArray, streamer); super(pamArray, streamer);
} }
@Override
public boolean isChangeable() {
return true;
}
} }

View File

@ -35,6 +35,7 @@ import Array.streamerOrigin.StreamerDataIterator;
import GPS.GpsData; import GPS.GpsData;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamModel.parametermanager.PrivatePamParameterData; import PamModel.parametermanager.PrivatePamParameterData;
import PamUtils.LatLong; import PamUtils.LatLong;
import PamUtils.PamArrayUtils; import PamUtils.PamArrayUtils;
@ -90,6 +91,33 @@ public class PamArray implements Serializable, Cloneable, ManagedParameters {
private String arrayName; private String arrayName;
private String arrayFile; private String arrayFile;
/**
* Type, used for Tethys and other meta data control
*/
private String instrumentType;
/**
* Array Id. Can be anything. Compulsory for Tethys.
*/
private String instrumentId;
public String getInstrumentType() {
return instrumentType;
}
public void setInstrumentType(String instrumentType) {
this.instrumentType = instrumentType;
}
public String getInstrumentId() {
return instrumentId;
}
public void setInstrumentId(String instrumentId) {
this.instrumentId = instrumentId;
}
// private int originInterpolation = ORIGIN_USE_LATEST; // private int originInterpolation = ORIGIN_USE_LATEST;
private int originInterpolation = ORIGIN_USE_PRECEEDING; private int originInterpolation = ORIGIN_USE_PRECEEDING;
@ -1574,7 +1602,7 @@ public class PamArray implements Serializable, Cloneable, ManagedParameters {
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
try { try {
Field field = this.getClass().getDeclaredField("streamers"); Field field = this.getClass().getDeclaredField("streamers");
ps.put(new PrivatePamParameterData(this, field) { ps.put(new PrivatePamParameterData(this, field) {

View File

@ -25,6 +25,7 @@ import java.io.Serializable;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
/** /**
* *
@ -79,7 +80,7 @@ public class Preamplifier implements Serializable, Cloneable, ManagedParameters
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
return ps; return ps;
} }

View File

@ -17,6 +17,7 @@ import PamController.PamController;
import PamController.masterReference.MasterReferencePoint; import PamController.masterReference.MasterReferencePoint;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamModel.parametermanager.PrivatePamParameterData; import PamModel.parametermanager.PrivatePamParameterData;
import PamUtils.LatLong; import PamUtils.LatLong;
import PamUtils.PamCalendar; import PamUtils.PamCalendar;
@ -767,7 +768,7 @@ public class Streamer implements Serializable, Cloneable, ManagedParameters {
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
try { try {
Field field = this.getClass().getDeclaredField("coordinate"); Field field = this.getClass().getDeclaredField("coordinate");
ps.put(new PrivatePamParameterData(this, field) { ps.put(new PrivatePamParameterData(this, field) {

View File

@ -259,6 +259,7 @@ public class StreamerDialog extends PamDialog {
// } // }
singleInstance.currentArray = currentArray; singleInstance.currentArray = currentArray;
singleInstance.defaultStreamer = streamer;//.clone(); singleInstance.defaultStreamer = streamer;//.clone();
// singleInstance.st
singleInstance.setParams(); singleInstance.setParams();
singleInstance.setVisible(true); singleInstance.setVisible(true);
return singleInstance.defaultStreamer; return singleInstance.defaultStreamer;
@ -549,6 +550,17 @@ public class StreamerDialog extends PamDialog {
pack(); pack();
} }
} }
try {
OriginSettings os = defaultStreamer.getOriginSettings(currentOriginMethod.getClass());
if (os != null) {
currentOriginMethod.setOriginSettings(os);
}
}
catch (Exception e) {
// will throw if it tries to set the wrong type of settings.
}
enableControls(); enableControls();
} }

View File

@ -3,6 +3,7 @@ package Array.streamerOrigin;
import PamController.SettingsObject; import PamController.SettingsObject;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
/** /**
* Class to hold settings for the different origin methods. * Class to hold settings for the different origin methods.
@ -47,7 +48,7 @@ public abstract class OriginSettings implements SettingsObject, Cloneable, Manag
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
return ps; return ps;
} }

View File

@ -5,6 +5,7 @@ import java.util.Arrays;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import mcc.MccJniInterface; import mcc.MccJniInterface;
import mcc.mccjna.MCCConstants; import mcc.mccjna.MCCConstants;
@ -67,7 +68,7 @@ public class ArrayAccelParams implements Serializable, Cloneable, ManagedParamet
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
return ps; return ps;
} }

View File

@ -5,6 +5,7 @@ import java.lang.reflect.Field;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamModel.parametermanager.PrivatePamParameterData; import PamModel.parametermanager.PrivatePamParameterData;
import PamView.GroupedSourceParameters; import PamView.GroupedSourceParameters;
import PamguardMVC.PamConstants; import PamguardMVC.PamConstants;
@ -44,7 +45,7 @@ public class AzigramParameters implements Serializable, ManagedParameters, Clone
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
try { try {
Field field = this.getClass().getDeclaredField("name"); Field field = this.getClass().getDeclaredField("name");
ps.put(new PrivatePamParameterData(this, field) { ps.put(new PrivatePamParameterData(this, field) {

View File

@ -7,6 +7,7 @@ import org.w3c.dom.Element;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
/** /**
* FilterPArameters for use when the filter is on it's own (within a FilterController) * FilterPArameters for use when the filter is on it's own (within a FilterController)
@ -39,7 +40,7 @@ public class FilterParameters_2 implements Serializable, Cloneable, ManagedParam
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
return ps; return ps;
} }

View File

@ -30,6 +30,7 @@ import org.w3c.dom.Element;
import PamController.PamControlledUnit; import PamController.PamControlledUnit;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamUtils.FrequencyFormat; import PamUtils.FrequencyFormat;
/** /**
@ -358,7 +359,7 @@ public class FilterParams implements Serializable, Cloneable, ManagedParameters
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
return ps; return ps;
} }

View File

@ -5,6 +5,7 @@ import java.lang.reflect.Field;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamModel.parametermanager.PrivatePamParameterData; import PamModel.parametermanager.PrivatePamParameterData;
public class GPSParameters implements Serializable, Cloneable, ManagedParameters { public class GPSParameters implements Serializable, Cloneable, ManagedParameters {
@ -175,7 +176,7 @@ public class GPSParameters implements Serializable, Cloneable, ManagedParameters
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
try { try {
Field field = this.getClass().getDeclaredField("nmeaSource"); Field field = this.getClass().getDeclaredField("nmeaSource");
ps.put(new PrivatePamParameterData(this, field) { ps.put(new PrivatePamParameterData(this, field) {

View File

@ -1,5 +1,6 @@
package GPS; package GPS;
import PamUtils.PamCalendar;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
public class GpsDataUnit extends PamDataUnit { public class GpsDataUnit extends PamDataUnit {
@ -52,12 +53,18 @@ public class GpsDataUnit extends PamDataUnit {
*/ */
@Override @Override
public String getSummaryString() { public String getSummaryString() {
// TODO Auto-generated method stub // String str = super.getSummaryString();
String str = super.getSummaryString(); String str = String.format("<html>%s<br>UID:%d, Database: %d<br>%s<br>",
"GPS Data", getUID(), getDatabaseIndex(), PamCalendar.formatDBDateTime(getTimeMilliseconds(), true));
if (gpsData != null) { if (gpsData != null) {
str += gpsData.summaryString(); str += gpsData.summaryString();
} }
return str; return str;
} }
@Override
public double[] getFrequency() {
return null;
}
} }

View File

@ -295,7 +295,8 @@ public class GpsLogger extends SQLLogging {
* time from the UTC column which is NOT the GpsData time which was the real GPS time. * time from the UTC column which is NOT the GpsData time which was the real GPS time.
*/ */
int gpsIntTimeVal = gpsTime.getIntegerValue(); int gpsIntTimeVal = gpsTime.getIntegerValue();
Object ts = getTableDefinition().getTimeStampItem().getValue(); PamTableDefinition pamTableDef = (PamTableDefinition) getTableDefinition();
Object ts = pamTableDef.getTimeStampItem().getValue();
long gpsDate = sqlTypes.millisFromTimeStamp(ts); long gpsDate = sqlTypes.millisFromTimeStamp(ts);
if (gpsDate%1000 == 0) { if (gpsDate%1000 == 0) {
// some databases may have stored the milliseconds, in which // some databases may have stored the milliseconds, in which

View File

@ -17,6 +17,7 @@ import java.lang.reflect.Field;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PrivatePamParameterData; import PamModel.parametermanager.PrivatePamParameterData;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamView.GroupedSourceParameters; import PamView.GroupedSourceParameters;
public class IshDetParams implements Serializable, Cloneable, ManagedParameters { public class IshDetParams implements Serializable, Cloneable, ManagedParameters {
@ -96,7 +97,7 @@ public class IshDetParams implements Serializable, Cloneable, ManagedParameters
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
try { try {
Field field = this.getClass().getDeclaredField("inputDataSource"); Field field = this.getClass().getDeclaredField("inputDataSource");
ps.put(new PrivatePamParameterData(this, field) { ps.put(new PrivatePamParameterData(this, field) {

View File

@ -4,6 +4,7 @@ import java.io.Serializable;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
/** /**
* Ishamel display parameters for the Spectrogram plug in. * Ishamel display parameters for the Spectrogram plug in.
@ -42,7 +43,7 @@ public class IshDisplayParams implements Serializable, Cloneable, ManagedParamet
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
return ps; return ps;
} }

View File

@ -8,14 +8,13 @@ import java.sql.Types;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
import generalDatabase.EmptyTableDefinition;
//import pamDatabase.SQLLogging; //import pamDatabase.SQLLogging;
//import PamguardMVC.RecyclingDataBlock; //import PamguardMVC.RecyclingDataBlock;
import generalDatabase.PamDetectionLogging; import generalDatabase.PamDetectionLogging;
public class IshLogger extends PamDetectionLogging { public class IshLogger extends PamDetectionLogging {
IshDetControl ishDetControl; IshDetControl ishDetControl;
PamTableDefinition tableDefinition;
PamTableItem systemDate, durationSecs, secSinceStart, peakHeight; PamTableItem systemDate, durationSecs, secSinceStart, peakHeight;
// Peak is more important than start time for matched filter & spectrogram correlation // Peak is more important than start time for matched filter & spectrogram correlation
PamTableItem peakSample, peakDelaySecs; PamTableItem peakSample, peakDelaySecs;
@ -25,7 +24,7 @@ public class IshLogger extends PamDetectionLogging {
super(pamDataBlock, UPDATE_POLICY_WRITENEW); super(pamDataBlock, UPDATE_POLICY_WRITENEW);
this.ishDetControl = ishDetControl; this.ishDetControl = ishDetControl;
tableDefinition = getTableDefinition(); EmptyTableDefinition tableDefinition = getTableDefinition();
// PamTableItem tableItem; // PamTableItem tableItem;
// setUpdatePolicy(UPDATE_POLICY_WRITENEW); // setUpdatePolicy(UPDATE_POLICY_WRITENEW);

View File

@ -14,14 +14,13 @@ import IshmaelDetector.IshDetection;
import PamUtils.LatLong; import PamUtils.LatLong;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
import generalDatabase.EmptyTableDefinition;
//import pamDatabase.SQLLogging; //import pamDatabase.SQLLogging;
//import PamguardMVC.RecyclingDataBlock; //import PamguardMVC.RecyclingDataBlock;
import generalDatabase.PamDetectionLogging; import generalDatabase.PamDetectionLogging;
public class IshLocSqlLogging extends PamDetectionLogging { public class IshLocSqlLogging extends PamDetectionLogging {
IshLocControl ishLocControl; IshLocControl ishLocControl;
PamTableDefinition tableDefinition;
PamTableItem systemDate, durationSecs, secSinceStart, peakHeight; PamTableItem systemDate, durationSecs, secSinceStart, peakHeight;
private PamTableItem latitude, longitude, refLatitude, refLongitude, x, y, z; private PamTableItem latitude, longitude, refLatitude, refLongitude, x, y, z;
@ -30,7 +29,7 @@ public class IshLocSqlLogging extends PamDetectionLogging {
super(pamDataBlock, UPDATE_POLICY_WRITENEW); super(pamDataBlock, UPDATE_POLICY_WRITENEW);
this.ishLocControl = ishDetControl; this.ishLocControl = ishDetControl;
tableDefinition = getTableDefinition(); EmptyTableDefinition tableDefinition = getTableDefinition();
tableDefinition.addTableItem(latitude = new PamTableItem("Latitude", Types.DOUBLE)); tableDefinition.addTableItem(latitude = new PamTableItem("Latitude", Types.DOUBLE));
tableDefinition.addTableItem(longitude = new PamTableItem("Longitude", Types.DOUBLE)); tableDefinition.addTableItem(longitude = new PamTableItem("Longitude", Types.DOUBLE));
tableDefinition.addTableItem(refLatitude = new PamTableItem("ReferenceLatitude", Types.DOUBLE)); tableDefinition.addTableItem(refLatitude = new PamTableItem("ReferenceLatitude", Types.DOUBLE));

View File

@ -4,6 +4,7 @@ import java.io.Serializable;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
public class KernelSmoothingParameters implements Serializable, Cloneable, ManagedParameters { public class KernelSmoothingParameters implements Serializable, Cloneable, ManagedParameters {
@ -25,7 +26,7 @@ public class KernelSmoothingParameters implements Serializable, Cloneable, Manag
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
return ps; return ps;
} }

View File

@ -4,6 +4,7 @@ import java.io.Serializable;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import fftFilter.FFTFilterParams; import fftFilter.FFTFilterParams;
/** /**
@ -157,7 +158,7 @@ public class DelayMeasurementParams implements Serializable, Cloneable, ManagedP
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
return ps; return ps;
} }

View File

@ -4,6 +4,7 @@ import java.io.Serializable;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
public class MCMCParams2 implements Serializable, Cloneable, ManagedParameters { public class MCMCParams2 implements Serializable, Cloneable, ManagedParameters {
@ -126,7 +127,7 @@ public class MCMCParams2 implements Serializable, Cloneable, ManagedParameters
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
return ps; return ps;
} }

View File

@ -4,6 +4,7 @@ import java.io.Serializable;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
public class MCMCParams implements Serializable, Cloneable, ManagedParameters { public class MCMCParams implements Serializable, Cloneable, ManagedParameters {
@ -64,7 +65,7 @@ public class MCMCParams implements Serializable, Cloneable, ManagedParameters {
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
return ps; return ps;
} }

View File

@ -4,6 +4,7 @@ import java.io.Serializable;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
/** /**
@ -69,7 +70,7 @@ public class HyperbolicParams implements Serializable, Cloneable, ManagedParamet
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
return ps; return ps;
} }

View File

@ -4,6 +4,7 @@ import java.io.Serializable;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import Spectrogram.WindowFunction; import Spectrogram.WindowFunction;
/** /**
@ -104,7 +105,7 @@ public class RawOrFFTParams implements Serializable, Cloneable, RawOrFFTParamsIn
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
return ps; return ps;
} }

View File

@ -85,7 +85,15 @@ public class GebcoMapFile implements MapFileManager {
* @see Map.MapFile#readFileData(java.io.File) * @see Map.MapFile#readFileData(java.io.File)
*/ */
public boolean readFileData(File file) { public boolean readFileData(File file) {
return readMapFile(file, true); try {
return readMapFile(file, true);
}
catch (Exception e) {
// trap error someone reported at end November 22. Suspect it was their corrupt map file causing problems.
String err = String.format("Map file %s is missing or corrupt and cannot be loaded", file.getName());
WarnOnce.showWarning("Map File Error", err, WarnOnce.OK_OPTION);
return false;
}
} }
private boolean readMapFile(File gebcoFile, boolean readContours) { private boolean readMapFile(File gebcoFile, boolean readContours) {

View File

@ -7,6 +7,7 @@ import java.util.ListIterator;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
/** /**
* PArameters for MapDetectionsManager which * PArameters for MapDetectionsManager which
@ -65,7 +66,7 @@ public class MapDetectionsParameters implements Serializable, Cloneable, Managed
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
return ps; return ps;
} }

View File

@ -27,6 +27,7 @@ import java.lang.reflect.Field;
import Array.Hydrophone; import Array.Hydrophone;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamModel.parametermanager.PrivatePamParameterData; import PamModel.parametermanager.PrivatePamParameterData;
public class MapParameters implements Serializable, Cloneable, ManagedParameters { public class MapParameters implements Serializable, Cloneable, ManagedParameters {
@ -301,7 +302,7 @@ public class MapParameters implements Serializable, Cloneable, ManagedParameters
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
return ps; return ps;
} }

View File

@ -20,9 +20,15 @@
*/ */
package Map; package Map;
import java.awt.Point;
import java.awt.event.MouseMotionAdapter; import java.awt.event.MouseMotionAdapter;
import java.awt.geom.AffineTransform; import java.awt.geom.AffineTransform;
import java.util.ListIterator;
import GPS.GPSControl;
import GPS.GPSDataBlock;
import GPS.GpsDataUnit;
import PamController.PamController;
import PamUtils.Coordinate3d; import PamUtils.Coordinate3d;
import PamUtils.LatLong; import PamUtils.LatLong;
import PamUtils.PamCoordinate; import PamUtils.PamCoordinate;
@ -385,6 +391,45 @@ public class MapRectProjector extends MapProjector {
return xTrans; return xTrans;
} }
@Override
public String getHoverText(Point mousePoint, int ploNumberMatch) {
String text = super.getHoverText(mousePoint, ploNumberMatch);
if (text == null) {
return findGpsTrackText(mousePoint, ploNumberMatch);
}
else {
return text;
}
}
private String findGpsTrackText(Point mousePoint, int ploNumberMatch) {
GPSControl gpsControl = GPSControl.getGpsControl();
if (gpsControl == null) {
return null;
}
LatLong currentPos = getDataPosition(new Coordinate3d(mousePoint.x, mousePoint.y));
GPSDataBlock gpsDataBlock = gpsControl.getGpsDataBlock();
double dist = Double.MAX_VALUE;
GpsDataUnit closest = null;
ListIterator<GpsDataUnit> it = gpsDataBlock.getListIterator(0);
while (it.hasNext()) {
GpsDataUnit gpsUnit = it.next();
double r = gpsUnit.getGpsData().distanceToMetres(currentPos);
if (r < dist) {
dist = r;
closest = gpsUnit;
}
}
if (closest == null) {
return null;
}
double rPix = dist*this.pixelsPerMetre;
if (rPix > 20) {
return null;
}
return closest.getSummaryString();
}
} }

View File

@ -4,6 +4,7 @@ import java.io.Serializable;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
public class GridbaseParameters implements Cloneable, Serializable, ManagedParameters { public class GridbaseParameters implements Cloneable, Serializable, ManagedParameters {
@ -25,7 +26,7 @@ public class GridbaseParameters implements Cloneable, Serializable, ManagedParam
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
return ps; return ps;
} }

View File

@ -24,6 +24,7 @@ import java.io.Serializable;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import serialComms.jserialcomm.PJSerialComm; import serialComms.jserialcomm.PJSerialComm;
public class NMEAParameters implements Serializable, Cloneable, ManagedParameters { public class NMEAParameters implements Serializable, Cloneable, ManagedParameters {
@ -149,7 +150,7 @@ public class NMEAParameters implements Serializable, Cloneable, ManagedParameter
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
return ps; return ps;
} }

View File

@ -33,6 +33,13 @@ public interface OfflineDataStore {
*/ */
public String getDataSourceName(); public String getDataSourceName();
/**
* Get the data location. This may be a specific file, or might be a folder
* if data are in many files, a URI, etc.
* @return store locations
*/
public String getDataLocation();
/** /**
* Load data for a given datablock between two time limits. * Load data for a given datablock between two time limits.
* @param dataBlock datablock owner of the data * @param dataBlock datablock owner of the data

View File

@ -23,6 +23,7 @@ package PamController;
import java.awt.Component; import java.awt.Component;
import java.awt.Frame; import java.awt.Frame;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
import javax.swing.JFrame; import javax.swing.JFrame;
import javax.swing.JMenu; import javax.swing.JMenu;
@ -35,7 +36,9 @@ import offlineProcessing.OfflineTaskGroup;
import PamController.status.ModuleStatus; import PamController.status.ModuleStatus;
import PamController.status.ModuleStatusManager; import PamController.status.ModuleStatusManager;
import PamController.status.ProcessCheck; import PamController.status.ProcessCheck;
import PamModel.PamModel;
import PamModel.PamModuleInfo; import PamModel.PamModuleInfo;
import PamModel.PamPluginInterface;
import PamView.ClipboardCopier; import PamView.ClipboardCopier;
import PamView.PamGui; import PamView.PamGui;
import PamView.PamSidePanel; import PamView.PamSidePanel;
@ -886,6 +889,23 @@ public abstract class PamControlledUnit implements SettingsNameProvider {
public int getInstanceIndex() { public int getInstanceIndex() {
return instanceIndex; return instanceIndex;
} }
/**
* Get detail if this is a plugin.
* @return plugin detail, or null if it's not a plugin.
*/
public PamPluginInterface getPlugin() {
List<PamPluginInterface> pluginList = ((PamModel) PamController.getInstance().getModelInterface()).getPluginList();
if (pluginList == null) {
return null;
}
for (PamPluginInterface plugin : pluginList) {
if (plugin.getClassName().equals(this.getClass().getName())) {
return plugin;
}
}
return null;
}
/** /**
* The PamConfiguration holds the master list of modules which form part of a * The PamConfiguration holds the master list of modules which form part of a

View File

@ -36,6 +36,7 @@ import org.apache.commons.io.input.ClassLoaderObjectInputStream;
import PamModel.PamModel; import PamModel.PamModel;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamView.dialog.warn.WarnOnce; import PamView.dialog.warn.WarnOnce;
@ -398,7 +399,7 @@ public class PamControlledUnitSettings implements Serializable, ManagedParameter
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
return ps; return ps;
} }

View File

@ -58,6 +58,7 @@ import fftManager.FFTDataUnit;
import generalDatabase.DBControlUnit; import generalDatabase.DBControlUnit;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.stage.Stage; import javafx.stage.Stage;
import metadata.MetaDataContol;
import Array.ArrayManager; import Array.ArrayManager;
import PamController.command.MulticastController; import PamController.command.MulticastController;
import PamController.command.NetworkController; import PamController.command.NetworkController;
@ -457,6 +458,7 @@ public class PamController implements PamControllerInterface, PamSettings {
System.out.println(""); System.out.println("");
System.out.println("Note - ignore the following SLF4J warn/error messages, they are not applicable to this application"); System.out.println("Note - ignore the following SLF4J warn/error messages, they are not applicable to this application");
ArrayManager.getArrayManager(); // create the array manager so that it get's it's settings ArrayManager.getArrayManager(); // create the array manager so that it get's it's settings
MetaDataContol.getMetaDataControl();
/** /**
* Check for archived files and unpack automatically. * Check for archived files and unpack automatically.
@ -1186,6 +1188,8 @@ public class PamController implements PamControllerInterface, PamSettings {
} }
if (saveSettings) { if (saveSettings) {
startTime = PamCalendar.getSessionStartTime();
// System.out.printf("Saving settings for start time %s\n", PamCalendar.formatDBDateTime(startTime));
saveSettings(PamCalendar.getSessionStartTime()); saveSettings(PamCalendar.getSessionStartTime());
} }
@ -1344,6 +1348,9 @@ public class PamController implements PamControllerInterface, PamSettings {
} }
guiFrameManager.pamEnded(); guiFrameManager.pamEnded();
long stopTime = PamCalendar.getTimeInMillis();
saveEndSettings(stopTime);
// no good having this here since it get's called at the end of every file. // no good having this here since it get's called at the end of every file.
// if (GlobalArguments.getParam(PamController.AUTOEXIT) != null) { // if (GlobalArguments.getParam(PamController.AUTOEXIT) != null) {
//// can exit here, since we've auto started, can auto exit. //// can exit here, since we've auto started, can auto exit.
@ -1462,6 +1469,26 @@ public class PamController implements PamControllerInterface, PamSettings {
pamConfiguration.saveSettings(timeNow); pamConfiguration.saveSettings(timeNow);
} }
/**
* Gets called in pamStart and may / will attempt to store all
* PAMGUARD settings via the database and binary storage modules.
*/
private void saveEndSettings(long timeNow) {
// System.out.printf("Updating settings with end time %s\n", PamCalendar.formatDBDateTime(timeNow));
ArrayList<PamControlledUnit> pamControlledUnits = pamConfiguration.getPamControlledUnits();
PamControlledUnit pcu;
PamSettingsSource settingsSource;
for (int iU = 0; iU < pamControlledUnits.size(); iU++) {
pcu = pamControlledUnits.get(iU);
if (PamSettingsSource.class.isAssignableFrom(pcu.getClass())) {
settingsSource = (PamSettingsSource) pcu;
settingsSource.saveEndSettings(timeNow);
}
}
}
/** /**
* Export configuration into an XML file * Export configuration into an XML file
* @param parentFrame * @param parentFrame

View File

@ -0,0 +1,20 @@
package PamController;
/**
* Interface to define modules which can be considered as sensors of some sort.
* e.g. depth and orientation modules and the SoundTrap clickdetecotr
* @author dg50
*
*/
public interface PamSensor {
public String getUnitName();
public String getUnitType();
public String getSensorDescription();
public String getSensorId();
}

View File

@ -20,6 +20,14 @@ public interface PamSettingsSource {
*/ */
public boolean saveStartSettings(long timeNow); public boolean saveStartSettings(long timeNow);
/**
* Save settings when processing ends.
* This may just be an update of the settings saves with saveStartSettings, e.g. an end time.
* @param timeNow
* @return true if saved correctly.
*/
public boolean saveEndSettings(long timeNow);
/** /**
* Get the number of different settings * Get the number of different settings
* within the settings source. * within the settings source.

View File

@ -31,12 +31,12 @@ public class PamguardVersionInfo {
* Version number, major version.minorversion.sub-release. * Version number, major version.minorversion.sub-release.
* Note: can't go higher than sub-release 'f' * Note: can't go higher than sub-release 'f'
*/ */
static public final String version = "2.02.09f"; static public final String version = "2.02.09aa";
/** /**
* Release date * Release date
*/ */
static public final String date = "28 December 2023"; static public final String date = "12 January 20242";
// /** // /**
// * Release type - Beta or Core // * Release type - Beta or Core

View File

@ -4,6 +4,7 @@ import java.io.Serializable;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
/** /**
* Very simple class used in an ArrayList of used modules that * Very simple class used in an ArrayList of used modules that
@ -54,7 +55,7 @@ public class UsedModuleInfo implements Serializable, ManagedParameters {
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
return ps; return ps;
} }

View File

@ -29,6 +29,7 @@ import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Element; import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import com.sun.javafx.runtime.VersionInfo; import com.sun.javafx.runtime.VersionInfo;
@ -42,12 +43,14 @@ import PamController.PamguardVersionInfo;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterData; import PamModel.parametermanager.PamParameterData;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamUtils.PamCalendar; import PamUtils.PamCalendar;
import PamUtils.XMLUtils; import PamUtils.XMLUtils;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
import PamguardMVC.PamProcess; import PamguardMVC.PamProcess;
import binaryFileStorage.BinaryStore; import binaryFileStorage.BinaryStore;
import tethys.TethysControl;
/** /**
* Class for writing XML configuration output to a file. * Class for writing XML configuration output to a file.
@ -62,6 +65,8 @@ public class PamguardXMLWriter implements PamSettings {
private static final Set<Class<?>> WRAPPER_TYPES = getWrapperTypes(); private static final Set<Class<?>> WRAPPER_TYPES = getWrapperTypes();
private XMLWriterSettings writerSettings = new XMLWriterSettings(); private XMLWriterSettings writerSettings = new XMLWriterSettings();
private boolean excludeDisplaySettings;
// private String xmlNameSpace;
private static PamguardXMLWriter singleInstance; private static PamguardXMLWriter singleInstance;
@ -83,6 +88,19 @@ public class PamguardXMLWriter implements PamSettings {
} }
return singleInstance; return singleInstance;
} }
/**
* Recursively walk the tree and add a namespace to every
* single element.
* @param doc
* @param nameSpace
* @return
*/
public boolean addNameSpaceToElements(Document doc, Element el, String nameSpace) {
// el.setAttributeNS(nameSpace, nameSpace, nameSpace);
NamedNodeMap attributes = el.getAttributes();
return true;
}
/** /**
* Make a document with the options specified in writerSettings. * Make a document with the options specified in writerSettings.
@ -371,6 +389,32 @@ public class PamguardXMLWriter implements PamSettings {
* @return xml content as a a string. * @return xml content as a a string.
*/ */
public String getAsString(Document doc) { public String getAsString(Document doc) {
return getAsString(doc, true);
// try {
// DOMSource domSource = new DOMSource(doc);
// StringWriter writer = new StringWriter();
// StreamResult result = new StreamResult(writer);
// TransformerFactory tf = TransformerFactory.newInstance();
// Transformer transformer = tf.newTransformer();
// transformer.setOutputProperty(OutputKeys.METHOD, "xml");
// transformer.setOutputProperty(OutputKeys.ENCODING, "ISO-8859-1");
//// transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
// transformer.setOutputProperty(OutputKeys.INDENT, "yes");
// transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
// transformer.transform(domSource, result);
// return writer.toString();
// } catch (TransformerException e) {
// e.printStackTrace();
// return null;
// }
}
/**
* Get the xml document as a String.
* @param doc xml document
* @param indent Indent / format the document.
* @return xml content as a a string.
*/
public String getAsString(Document doc, boolean indent) {
try { try {
DOMSource domSource = new DOMSource(doc); DOMSource domSource = new DOMSource(doc);
StringWriter writer = new StringWriter(); StringWriter writer = new StringWriter();
@ -380,7 +424,7 @@ public class PamguardXMLWriter implements PamSettings {
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); transformer.setOutputProperty(OutputKeys.METHOD, "xml");
transformer.setOutputProperty(OutputKeys.ENCODING, "ISO-8859-1"); transformer.setOutputProperty(OutputKeys.ENCODING, "ISO-8859-1");
// transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); // transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty(OutputKeys.INDENT, indent ? "yes" : "no");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
transformer.transform(domSource, result); transformer.transform(domSource, result);
return writer.toString(); return writer.toString();
@ -411,8 +455,7 @@ public class PamguardXMLWriter implements PamSettings {
* @param pamSettingsUnit * @param pamSettingsUnit
* @return xml element * @return xml element
*/ */
private Element writeUnitSettings(Document doc, Element parent, PamSettings pamSettingsUnit) { public Element writeUnitSettings(Document doc, Element parent, PamSettings pamSettingsUnit) {
int[] settingInds = findSettings(null, pamSettingsUnit.getUnitName()); int[] settingInds = findSettings(null, pamSettingsUnit.getUnitName());
PamSettings[] settingsObjects = null; PamSettings[] settingsObjects = null;
if (settingInds != null) { if (settingInds != null) {
@ -436,7 +479,7 @@ public class PamguardXMLWriter implements PamSettings {
* can be temporary settings objects when writing temporary settings from dialogs. * can be temporary settings objects when writing temporary settings from dialogs.
* @return new XML element. * @return new XML element.
*/ */
private Element writeUnitSettings(Document doc, Element parent, PamSettings pamSettingsUnit, PamSettings[] toWrite) { public Element writeUnitSettings(Document doc, Element parent, PamSettings pamSettingsUnit, PamSettings[] toWrite) {
Element moduleData = doc.createElement("MODULE"); Element moduleData = doc.createElement("MODULE");
moduleData.setAttribute("Java.class", pamSettingsUnit.getClass().getName()); moduleData.setAttribute("Java.class", pamSettingsUnit.getClass().getName());
moduleData.setAttribute("UnitType", pamSettingsUnit.getUnitType()); moduleData.setAttribute("UnitType", pamSettingsUnit.getUnitType());
@ -457,6 +500,9 @@ public class PamguardXMLWriter implements PamSettings {
Element settingEl = doc.createElement("CONFIGURATION"); Element settingEl = doc.createElement("CONFIGURATION");
moduleData.appendChild(settingEl); moduleData.appendChild(settingEl);
for (int i = 0; i < toWrite.length; i++) { for (int i = 0; i < toWrite.length; i++) {
if (wantObject(toWrite[i]) == false) {
continue;
}
Element setEl = writeSettings(doc, toWrite[i], new ArrayList<Object>()); Element setEl = writeSettings(doc, toWrite[i], new ArrayList<Object>());
if (setEl != null) { if (setEl != null) {
settingEl.appendChild(setEl); settingEl.appendChild(setEl);
@ -467,6 +513,32 @@ public class PamguardXMLWriter implements PamSettings {
return moduleData; return moduleData;
} }
/**
* USed by the Tethys writer to avoid writing display settings.
* @param pamSettings
* @return
*/
private boolean wantObject(PamSettings pamSettings) {
if (excludeDisplaySettings == false) {
return true;
}
Object obj = pamSettings.getSettingsReference();
if (obj == null) {
return false;
}
if (obj instanceof ManagedParameters) {
ManagedParameters managedParams = (ManagedParameters) obj;
PamParameterSet paramSet = managedParams.getParameterSet();
if (paramSet == null) {
return false;
}
if (paramSet.getParameterSetType() == ParameterSetType.DISPLAY && excludeDisplaySettings) {
return false;
}
}
return true;
}
/** /**
* Write settings for a settings object, using the standard retreived object * Write settings for a settings object, using the standard retreived object
* from the settings. * from the settings.
@ -478,6 +550,14 @@ public class PamguardXMLWriter implements PamSettings {
private Element writeSettings(Document doc, PamSettings pamSettings, ArrayList<Object> objectHierarchy) { private Element writeSettings(Document doc, PamSettings pamSettings, ArrayList<Object> objectHierarchy) {
return writeSettings(doc, pamSettings, pamSettings.getSettingsReference(), objectHierarchy); return writeSettings(doc, pamSettings, pamSettings.getSettingsReference(), objectHierarchy);
} }
public Document writeOneObject(Object data) {
Document doc = XMLUtils.createBlankDoc();
Element el = doc.createElement("Settings");
Element newel = writeObjectData(doc, el, data, new ArrayList<Object>());
doc.appendChild(newel);
return doc;
}
/** /**
* Write settings using an object of choice instead of the standard one from PamSettings. * Write settings using an object of choice instead of the standard one from PamSettings.
@ -489,6 +569,7 @@ public class PamguardXMLWriter implements PamSettings {
* @return * @return
*/ */
private Element writeSettings(Document doc, PamSettings pamSettings, Object data, ArrayList<Object> objectHierarchy) { private Element writeSettings(Document doc, PamSettings pamSettings, Object data, ArrayList<Object> objectHierarchy) {
Element el = doc.createElement("SETTINGS"); Element el = doc.createElement("SETTINGS");
el.setAttribute("Type", pamSettings.getUnitType()); el.setAttribute("Type", pamSettings.getUnitType());
el.setAttribute("Name", pamSettings.getUnitName()); el.setAttribute("Name", pamSettings.getUnitName());
@ -500,10 +581,13 @@ public class PamguardXMLWriter implements PamSettings {
return el; return el;
} }
private Element writeObjectData(Document doc, Element el, Object data, ArrayList<Object> objectHierarchy) { public Element writeObjectData(Document doc, Element el, Object data, ArrayList<Object> objectHierarchy) {
if (data == null) { if (data == null) {
return null; return null;
} }
if (objectHierarchy == null) {
objectHierarchy = new ArrayList<>();
}
if (objectHierarchy.contains(data)) { if (objectHierarchy.contains(data)) {
// just write the reference, but nothing else or we'll end up in an infinite loop of objects. // just write the reference, but nothing else or we'll end up in an infinite loop of objects.
Element e = doc.createElement("Object"); Element e = doc.createElement("Object");
@ -525,8 +609,10 @@ public class PamguardXMLWriter implements PamSettings {
if (parameterSet == null) { if (parameterSet == null) {
return null; return null;
} }
objectHierarchy.add(data); if (objectHierarchy != null) {
objectHierarchy.add(data);
}
for (PamParameterData pamParam:parameterSet.getParameterCollection()) { for (PamParameterData pamParam:parameterSet.getParameterCollection()) {
try { try {
Object paramData = pamParam.getData(); Object paramData = pamParam.getData();
@ -765,9 +851,10 @@ public class PamguardXMLWriter implements PamSettings {
processData.setAttribute("Name", process.getProcessName()); processData.setAttribute("Name", process.getProcessName());
PamDataBlock source = process.getParentDataBlock(); PamDataBlock source = process.getParentDataBlock();
if (source != null) { if (source != null) {
Element inputEl = doc.createElement("Input"); Element inputEl = source.getDataBlockXML(doc);
inputEl.setAttribute("Name", source.getLongDataName()); // Element inputEl = doc.createElement("Input");
inputEl.setAttribute("Channels", String.format("0x%X", source.getChannelMap())); // inputEl.setAttribute("Name", source.getLongDataName());
// inputEl.setAttribute("Channels", String.format("0x%X", source.getChannelMap()));
processData.appendChild(inputEl); processData.appendChild(inputEl);
} }
int nOut = process.getNumOutputDataBlocks(); int nOut = process.getNumOutputDataBlocks();
@ -798,7 +885,16 @@ public class PamguardXMLWriter implements PamSettings {
*/ */
private int[] findSettings(String type, String name) { private int[] findSettings(String type, String name) {
if (settingsSets == null) { if (settingsSets == null) {
return null; makeSettingsList();
if (settingsSets == null) {
return null;
}
}
if (usedSettingsSets == null) {
usedSettingsSets = new boolean[settingsSets.size()];
}
else if (usedSettingsSets.length < settingsSets.size()) {
usedSettingsSets = Arrays.copyOf(usedSettingsSets, settingsSets.size());
} }
int[] found = new int[settingsSets.size()]; int[] found = new int[settingsSets.size()];
int nFound = 0; int nFound = 0;
@ -818,7 +914,7 @@ public class PamguardXMLWriter implements PamSettings {
return Arrays.copyOf(found, nFound); return Arrays.copyOf(found, nFound);
} }
private ArrayList<PamSettings> makeSettingsList() { public ArrayList<PamSettings> makeSettingsList() {
PamSettingManager settingsManager = PamSettingManager.getInstance(); PamSettingManager settingsManager = PamSettingManager.getInstance();
settingsSets = settingsManager.getOwners(); settingsSets = settingsManager.getOwners();
if (settingsSets == null) { if (settingsSets == null) {
@ -850,6 +946,14 @@ public class PamguardXMLWriter implements PamSettings {
return doc; return doc;
} }
/**
* Is this element a writable type ? Basically, this means
* that it's a primitive of some sort. Otherwise it's
* probably an object and may even be a list in which case
* it will need treating differently.
* @param clazz
* @return
*/
public static boolean isWritableType(Class<?> clazz) public static boolean isWritableType(Class<?> clazz)
{ {
if (clazz.isEnum()) return true; if (clazz.isEnum()) return true;
@ -940,5 +1044,23 @@ public class PamguardXMLWriter implements PamSettings {
return true; return true;
} }
/**
* @return the excludeDisplaySettings
*/
public boolean isExcludeDisplaySettings() {
return excludeDisplaySettings;
}
/**
* @param excludeDisplaySettings the excludeDisplaySettings to set
*/
public void setExcludeDisplaySettings(boolean excludeDisplaySettings) {
this.excludeDisplaySettings = excludeDisplaySettings;
}
// public void setStaticNameSpace(String xmlNameSpace) {
// this.xmlNameSpace = xmlNameSpace;
// }
} }

View File

@ -4,6 +4,7 @@ import java.io.Serializable;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
public class XMLWriterSettings implements Serializable, Cloneable, ManagedParameters { public class XMLWriterSettings implements Serializable, Cloneable, ManagedParameters {
@ -34,7 +35,7 @@ public class XMLWriterSettings implements Serializable, Cloneable, ManagedParame
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
return ps; return ps;
} }

View File

@ -5,6 +5,7 @@ import java.io.Serializable;
import PamController.soundMedium.GlobalMedium.SoundMedium; import PamController.soundMedium.GlobalMedium.SoundMedium;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
/** /**
* Stores parameters for the current medium. * Stores parameters for the current medium.
@ -41,7 +42,7 @@ public class GlobalMediumParams implements Serializable, Cloneable, ManagedParam
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
return ps; return ps;
} }

View File

@ -44,11 +44,15 @@ import whistlesAndMoans.AbstractWhistleDataUnit;
import fftManager.FFTDataUnit; import fftManager.FFTDataUnit;
import fftManager.PamFFTControl; import fftManager.PamFFTControl;
import group3dlocaliser.Group3DLocaliserControl; import group3dlocaliser.Group3DLocaliserControl;
import metadata.MetaDataContol;
import meygenturbine.MeygenTurbine; import meygenturbine.MeygenTurbine;
import printscreen.PrintScreenControl; import printscreen.PrintScreenControl;
import rockBlock.RockBlockControl; import rockBlock.RockBlockControl;
import tethys.TethysControl;
import turbineops.TurbineOperationControl; import turbineops.TurbineOperationControl;
import GPS.GpsDataUnit; import GPS.GpsDataUnit;
import Map.MapController;
import Map.gridbaselayer.GridbaseControl;
import NMEA.NMEADataUnit; import NMEA.NMEADataUnit;
import PamController.PamControlledUnitSettings; import PamController.PamControlledUnitSettings;
import PamController.PamController; import PamController.PamController;
@ -62,6 +66,7 @@ import PamguardMVC.PamDataBlock;
import analogarraysensor.ArraySensorControl; import analogarraysensor.ArraySensorControl;
import backupmanager.BackupManager; import backupmanager.BackupManager;
import beamformer.continuous.BeamFormerControl; import beamformer.continuous.BeamFormerControl;
import beamformer.localiser.BeamFormLocaliserControl;
import bearinglocaliser.BearingLocaliserControl; import bearinglocaliser.BearingLocaliserControl;
import binaryFileStorage.SecondaryBinaryStore; import binaryFileStorage.SecondaryBinaryStore;
import cepstrum.CepstrumControl; import cepstrum.CepstrumControl;
@ -454,6 +459,19 @@ final public class PamModel implements PamSettings {
mi.setToolTipText("Manage automated data backups"); mi.setToolTipText("Manage automated data backups");
mi.setModulesMenuGroup(utilitiesGroup); mi.setModulesMenuGroup(utilitiesGroup);
mi.setMaxNumber(1); mi.setMaxNumber(1);
// mi = PamModuleInfo.registerControlledUnit(MetaDataContol.class.getName(), MetaDataContol.unitType);
// mi.setToolTipText("Project Meta Data");
// mi.setModulesMenuGroup(utilitiesGroup);
// mi.setMaxNumber(1);
if (isViewer) {
mi = PamModuleInfo.registerControlledUnit(TethysControl.class.getName(), TethysControl.defaultName);
mi.setToolTipText("Interface to Tethys Database");
mi.setModulesMenuGroup(utilitiesGroup);
mi.setMaxNumber(1);
}
/* /*
* ************* End Utilities Group ******************* * ************* End Utilities Group *******************
@ -1064,7 +1082,7 @@ final public class PamModel implements PamSettings {
// clear the current list // clear the current list
pluginList.clear(); pluginList.clear();
daqList.clear(); daqList.clear();
/* /*
* If developing a new PAMPlugin in eclipse, the easiest way to do it is to make a new * If developing a new PAMPlugin in eclipse, the easiest way to do it is to make a new
* Eclipse project for your plugin code. Within that project, copy this PamModel class * Eclipse project for your plugin code. Within that project, copy this PamModel class
@ -1079,6 +1097,8 @@ final public class PamModel implements PamSettings {
* When you export the code for your plugin to a jar file, remember to NOT inlcude the copy of * When you export the code for your plugin to a jar file, remember to NOT inlcude the copy of
* PamModel ! * PamModel !
*/ */
// pluginList.add(new MorlaisWP1aPlugin());
// Load up whatever default classloader was used to create this class. Must use the same classloader // Load up whatever default classloader was used to create this class. Must use the same classloader
// for all plugins, or else we will not be able to create proper dependencies between them or be able // for all plugins, or else we will not be able to create proper dependencies between them or be able
@ -1146,11 +1166,30 @@ final public class PamModel implements PamSettings {
// to add that URL to the default classloader path. // to add that URL to the default classloader path.
URL newURL = jarList.get(i).toURI().toURL(); URL newURL = jarList.get(i).toURI().toURL();
// original method
// Method method = URLClassLoader.class.getDeclaredMethod("addURL", URL.class);
// method.setAccessible(true);
// method.invoke(cl, newURL);
// first fix attempt - create a brand new URLClassLoader. As expected, we get a ClassCastException when trying
// to load the parameters so we can't save params using this method
// URL[] newURLArray = new URL[1];
// newURLArray[0] = newURL;
// cl = new URLClassLoader(newURLArray);
// second attempt - custom class loader with the system app loader specified as the parent. Loads controlled unit, but // second attempt - custom class loader with the system app loader specified as the parent. Loads controlled unit, but
// as before it doesn't load the parameters // as before it doesn't load the parameters
classLoader.addURL(newURL); classLoader.addURL(newURL);
// third attempt
// Class<?> genericClass = cl.getClass();
// Method method = genericClass.getSuperclass().getDeclaredMethod("addURL", new Class[] {URL.class});
// method.setAccessible(true);
// method.invoke(cl, new Object[] {newURL});
// Save the name of the class to the global pluginBeingLoaded variable, and load the class. // Save the name of the class to the global pluginBeingLoaded variable, and load the class.
this.setPluginBeingLoaded(className); this.setPluginBeingLoaded(className);
// Class c = cl.loadClass(className); // Class c = cl.loadClass(className);
@ -1231,8 +1270,9 @@ final public class PamModel implements PamSettings {
"for help.<p>" + "for help.<p>" +
"This plug-in will not be available for loading"; "This plug-in will not be available for loading";
String help = null; 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); System.err.println("Exception while loading " + className);
System.err.println(e1.getMessage());
continue; continue;
} }
} }
@ -1245,7 +1285,7 @@ final public class PamModel implements PamSettings {
"for help.<p>" + "for help.<p>" +
"This plug-in will not be available for loading"; "This plug-in will not be available for loading";
String help = null; 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()); System.err.println("Exception while loading " + jarList.get(i).getName());
continue; continue;
} }
@ -1270,7 +1310,7 @@ final public class PamModel implements PamSettings {
// instantiate the plugin control class using the custom class loader // instantiate the plugin control class using the custom class loader
try { try {
// File classFile = new File(pf.getJarFile()); File classFile = new File(pf.getJarFile());
//URLClassLoader cl = new URLClassLoader(new URL[]{classFile.toURI().toURL()}); //URLClassLoader cl = new URLClassLoader(new URL[]{classFile.toURI().toURL()});
// mi = PamModuleInfo.registerControlledUnit(pf.getClassName(), pf.getDescription(),cl); // mi = PamModuleInfo.registerControlledUnit(pf.getClassName(), pf.getDescription(),cl);
mi = PamModuleInfo.registerControlledUnit(pf.getClassName(), pf.getDescription(),classLoader); mi = PamModuleInfo.registerControlledUnit(pf.getClassName(), pf.getDescription(),classLoader);
@ -1336,7 +1376,7 @@ final public class PamModel implements PamSettings {
"for help.<p>" + "for help.<p>" +
"This plug-in will not be available for loading"; "This plug-in will not be available for loading";
String help = null; 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()); System.err.println("Exception while loading " + pf.getDefaultName());
pluginList.remove(pf); pluginList.remove(pf);
continue; continue;

View File

@ -4,6 +4,7 @@ import java.io.Serializable;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
public class PamModelSettings implements Cloneable, Serializable, ManagedParameters { public class PamModelSettings implements Cloneable, Serializable, ManagedParameters {
@ -74,7 +75,7 @@ public class PamModelSettings implements Cloneable, Serializable, ManagedParamet
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
return ps; return ps;
} }

View File

@ -34,6 +34,11 @@ abstract public class PamParameterData {
*/ */
private String postTitle; private String postTitle;
/**
* field length for automatic dialogs.
*/
private int fieldLength;
/** /**
* @param parentObject * @param parentObject
@ -45,6 +50,21 @@ abstract public class PamParameterData {
this.field = field; this.field = field;
} }
/**
* @param parentObject
* @param field
* @param shortName
* @param toolTip
* @param fieldLength length of text in automatic dialogs.
*/
public PamParameterData(Object parentObject, Field field, String shortName, String toolTip, int fieldLength) {
super();
this.field = field;
this.shortName = shortName;
this.toolTip = toolTip;
this.fieldLength = fieldLength;
}
/** /**
* @param parentObject * @param parentObject
* @param field * @param field
@ -58,7 +78,6 @@ abstract public class PamParameterData {
this.toolTip = toolTip; this.toolTip = toolTip;
} }
/** /**
* @param shortName the shortName to set * @param shortName the shortName to set
*/ */
@ -66,6 +85,20 @@ abstract public class PamParameterData {
this.shortName = shortName; this.shortName = shortName;
} }
/**
* Set info about a parameter
* @param shortName short name, e.g. to use in a dialog
* @param postTitle post title, e.g. text coming after a data entry field in a dialog
* @param toolTip tool tip to display over the component in a dialog.
* @param fieldLength length of text in automatic dialogs.
*/
public void setInfo(String shortName, String postTitle, String toolTip, int fieldLength) {
this.shortName = shortName;
this.postTitle = postTitle;
this.toolTip = toolTip;
this.fieldLength = fieldLength;
}
/** /**
* Set info about a parameter * Set info about a parameter
* @param shortName short name, e.g. to use in a dialog * @param shortName short name, e.g. to use in a dialog
@ -136,6 +169,9 @@ abstract public class PamParameterData {
* @return a short name for the field, suitable for use in dialogs. * @return a short name for the field, suitable for use in dialogs.
*/ */
public String getShortName() { public String getShortName() {
if (shortName == null) {
return getFieldName();
}
return shortName; return shortName;
} }
@ -166,5 +202,19 @@ abstract public class PamParameterData {
return String.format("Param %s class %s", getFieldName(), getDataClass()); return String.format("Param %s class %s", getFieldName(), getDataClass());
} }
/**
* @return the fieldLength
*/
public int getFieldLength() {
return fieldLength;
}
/**
* @param fieldLength the fieldLength to set
*/
public void setFieldLength(int fieldLength) {
this.fieldLength = fieldLength;
}
} }

View File

@ -59,9 +59,12 @@ public class PamParameterDataGetter extends PrivatePamParameterData {
if (setter == null) { if (setter == null) {
return false; return false;
} }
// need to convert the type
Object convObj = convertStringType(data);
try { try {
setter.invoke(getParentObject(), data); Object parentObj = getParentObject();
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { setter.invoke(parentObj, convObj);
} catch (InvocationTargetException e) {
e.printStackTrace(); e.printStackTrace();
return false; return false;
} }

View File

@ -29,6 +29,9 @@ public class PamParameterSet {
private static boolean printDebug = false; private static boolean printDebug = false;
public enum ParameterSetType {DETECTOR, DISPLAY};
private ParameterSetType parameterSetType;
/** /**
* Standard modifiers to exclude. This is important for many classes which will tend to * Standard modifiers to exclude. This is important for many classes which will tend to
* do crazy things such as incorporate ALL of their final fields, e.g. when a Color * do crazy things such as incorporate ALL of their final fields, e.g. when a Color
@ -55,8 +58,10 @@ public class PamParameterSet {
* in the STANDARD_MODIFIER_EXCLUSIONS list (FINAL or STATIC). * in the STANDARD_MODIFIER_EXCLUSIONS list (FINAL or STATIC).
* @return Created parameter set. * @return Created parameter set.
*/ */
public static PamParameterSet autoGenerate(Object parentObject) { public static PamParameterSet autoGenerate(Object parentObject, ParameterSetType parameterSetType) {
return autoGenerate(parentObject, STANDARD_MODIFIER_EXCLUSIONS); PamParameterSet paramSet = autoGenerate(parentObject, STANDARD_MODIFIER_EXCLUSIONS);
paramSet.setParameterSetType(parameterSetType);
return paramSet;
} }
/** /**
@ -286,4 +291,19 @@ public class PamParameterSet {
public PamParameterData removeParameterData(String paramName) { public PamParameterData removeParameterData(String paramName) {
return parameterDatas.remove(paramName); return parameterDatas.remove(paramName);
} }
/**
* @return the parameterSetType
*/
public ParameterSetType getParameterSetType() {
return parameterSetType;
}
/**
* @param parameterSetType the parameterSetType to set
*/
public void setParameterSetType(ParameterSetType parameterSetType) {
this.parameterSetType = parameterSetType;
}
} }

View File

@ -0,0 +1,73 @@
package PamModel.parametermanager;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;
import PamModel.parametermanager.swing.ManagedParameterDialog;
import generalDatabase.parameterstore.ParameterDatabaseStore;
/**
* Just about everything giving overall control of some managed parameters.
* May be a bit too specific on first cut and need to be abstracted.
* Testing on 'Deployment' data.
* @author dg50
*
* @param <T>
*/
public class ParameterSetManager<T extends ManagedParameters> {
private T managedParams;
private String name;
public ParameterSetManager(T defaultParams, String name) {
setManagedParams(defaultParams);
this.name = name;
// if (managedParams == null) {
// managedParams = new T();
// }
}
/**
* @return the managedParams
*/
public T getManagedParams() {
return managedParams;
}
/**
* @param managedParams the managedParams to set
*/
public void setManagedParams(T managedParams) {
this.managedParams = managedParams;
}
public JMenuItem getMenuItem(Window parent) {
if (managedParams == null) {
return null;
}
JMenuItem menuItem = new JMenuItem(name + " ...");
menuItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
showDialog(parent);
}
});
return menuItem;
}
protected void showDialog(Window parent) {
ManagedParameterDialog<T> dialog = new ManagedParameterDialog<T>(parent, name, managedParams);
T newParams = dialog.showDialog(parent, name, managedParams);
if (newParams != null) {
ParameterDatabaseStore paramDatabase = new ParameterDatabaseStore("MetaData");
paramDatabase.saveParameterSet(newParams);
}
}
}

View File

@ -1,6 +1,7 @@
package PamModel.parametermanager; package PamModel.parametermanager;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.Type;
/** /**
* Abstract instance of PamParameterDataInterface which implements everything * Abstract instance of PamParameterDataInterface which implements everything
@ -36,9 +37,48 @@ public abstract class PrivatePamParameterData extends PamParameterData {
* This should really be implemented in every concrete class, but no time to do that now. Aim to delete * This should really be implemented in every concrete class, but no time to do that now. Aim to delete
* this function here, then go through and implement everywhere ... * this function here, then go through and implement everywhere ...
*/ */
return false; // return false;
Object convData = convertStringType(data);
getField().set(this, convData);
return true;
} }
/**
* convert a string type to a different type appropriate for the field in
* question.
* @param value
* @return
*/
public Object convertStringType(Object value) {
if (value == null) {
return null;
}
if (value instanceof String == false) {
return value;
}
String str = (String) value;
Type type = getField().getGenericType();
Class<?> cls = getField().getType();
String clsName = cls.getName();
switch (clsName) {
case "int":
case "Integer":
return Integer.valueOf(str);
case "double":
case "Double":
return Double.valueOf(str);
case "float":
case "Float":
return Float.valueOf(str);
case "short":
case "Short":
return Short.valueOf(str);
}
return value;
}
} }

View File

@ -0,0 +1,49 @@
package PamModel.parametermanager.swing;
import java.awt.Window;
import PamModel.parametermanager.ManagedParameters;
import PamView.dialog.PamDialog;
public class ManagedParameterDialog<T extends ManagedParameters> extends PamDialog {
private T params;
private ManagedParameterPanel<T> parameterPanel;
public ManagedParameterDialog(Window parentFrame, String title, T params) {
super(parentFrame, title, false);
parameterPanel = new ManagedParameterPanel<T>(params);
setDialogComponent(parameterPanel.getPanel());
}
public T showDialog(Window parentFrame, String title, T parameters) {
// ManagedParameterDialog dialog = new ManagedParameterDialog<>(parentFrame, title, parameters);
setParams(parameters);
setVisible(true);
return params;
}
private void setParams(T params) {
this.params = params;
this.parameterPanel.setParams(params);
}
@Override
public boolean getParams() {
return parameterPanel.getParams(params);
}
@Override
public void cancelButtonPressed() {
params = null;
}
@Override
public void restoreDefaultSettings() {
// TODO Auto-generated method stub
}
}

View File

@ -0,0 +1,149 @@
package PamModel.parametermanager.swing;
import java.awt.Color;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.util.Collection;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.text.JTextComponent;
import PamModel.parametermanager.FieldNotFoundException;
import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterData;
import PamModel.parametermanager.PamParameterSet;
import PamView.dialog.PamDialog;
import PamView.dialog.PamGridBagContraints;
public class ManagedParameterPanel<T extends ManagedParameters> {
private JPanel mainPanel;
private Collection<PamParameterData> parameterSet;
private static final int DEFAULT_TEXT_LENGTH = 6;
private static final int MAX_SINGLE_LINE_LENGTH = 40;
private JTextComponent[] textComponents;
public ManagedParameterPanel(T parameterExample) {
mainPanel = new JPanel(new GridBagLayout());
GridBagConstraints c = new PamGridBagContraints();
PamParameterSet exampleSet = parameterExample.getParameterSet();
parameterSet = exampleSet.getParameterCollection();
int n = parameterSet.size();
textComponents = new JTextComponent[n];
int i = 0;
for (PamParameterData paramData : parameterSet) {
textComponents[i] = createComponent(paramData);
c.gridx = 0;
c.fill = GridBagConstraints.NONE;
c.anchor = GridBagConstraints.NORTHEAST;
mainPanel.add(new JLabel(paramData.getShortName(), JLabel.RIGHT), c);
c.gridx++;
if (textComponents[i] instanceof JTextArea) {
c.fill = GridBagConstraints.HORIZONTAL;
}
else {
c.fill = GridBagConstraints.NONE;
}
c.anchor = GridBagConstraints.WEST;
mainPanel.add(textComponents[i], c);
textComponents[i].setToolTipText(getTipText(paramData));
c.gridy++;
i++;
}
}
private String getTipText(PamParameterData paramData) {
String tip = paramData.getToolTip();
if (tip != null) {
return tip;
}
else {
return paramData.getFieldName();
}
}
private JTextComponent createComponent(PamParameterData paramData) {
int textLen = paramData.getFieldLength();
if (textLen == 0) {
textLen = DEFAULT_TEXT_LENGTH;
}
if (textLen <= MAX_SINGLE_LINE_LENGTH) {
return new JTextField(textLen);
}
else {
JTextField dummyField = new JTextField(2);
// dummyField.getBorder().
JTextArea textArea = new JTextArea(textLen/MAX_SINGLE_LINE_LENGTH+1, MAX_SINGLE_LINE_LENGTH);
textArea.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY));
return textArea;
}
}
public JComponent getPanel() {
return mainPanel;
}
public void setParams(T params) {
int i = 0;
PamParameterData newParamData = null;
Object data = null;
for (PamParameterData paramData : this.parameterSet) {
// find the parameter in the new parameters (parameterSet is just a formatting placeholder)
try {
newParamData = params.getParameterSet().findParameterData(paramData.getFieldName());
} catch (FieldNotFoundException e) {
e.printStackTrace();
}
try {
data = newParamData.getData();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
if (data != null) {
textComponents[i].setText(data.toString());
}
else {
textComponents[i].setText(null);
}
i++;
}
}
public boolean getParams(T params) {
int i = 0;
PamParameterData newParamData = null;
Object data = null;
for (PamParameterData paramData : this.parameterSet) {
// find the parameter in the new parameters (parameterSet is just a formatting placeholder)
try {
newParamData = params.getParameterSet().findParameterData(paramData.getFieldName());
} catch (FieldNotFoundException e) {
e.printStackTrace();
}
String txt = textComponents[i].getText();
try {
newParamData.setData(txt);
} catch (IllegalArgumentException | IllegalAccessException e) {
String msg = "Invalid parameter. Data type should be " + paramData.getField().getType().getName();
return PamDialog.showWarning(null, newParamData.getShortName(), msg);
}
i++;
}
return true;
}
}

View File

@ -26,6 +26,7 @@ import java.io.Serializable;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
/** /**
* Class definition for a x,y coordinate number type. * Class definition for a x,y coordinate number type.
@ -168,7 +169,7 @@ public class Coordinate3d implements Serializable , Cloneable, PamCoordinate, Ma
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
return ps; return ps;
} }

View File

@ -15,6 +15,7 @@ import java.text.NumberFormat;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PrivatePamParameterData; import PamModel.parametermanager.PrivatePamParameterData;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamguardMVC.PamConstants; import PamguardMVC.PamConstants;
import net.sf.geographiclib.Geodesic; import net.sf.geographiclib.Geodesic;
import net.sf.geographiclib.PolygonArea; import net.sf.geographiclib.PolygonArea;
@ -833,7 +834,7 @@ public class LatLong implements Serializable, Cloneable, Transferable, PamCoordi
*/ */
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
try { try {
Field field = this.getClass().getDeclaredField("height"); Field field = this.getClass().getDeclaredField("height");
ps.put(new PrivatePamParameterData(this, field) { ps.put(new PrivatePamParameterData(this, field) {

View File

@ -47,10 +47,7 @@ public class PamCalendar {
public static TimeZone defaultTimeZone = TimeZone.getTimeZone("UTC"); public static TimeZone defaultTimeZone = TimeZone.getTimeZone("UTC");
/* private static TimeZone localTimeZone = defaultTimeZone;// TimeZone.getDefault();
* Not used: all now handled in PamCalendar.
*/
// private static TimeZone localTimeZone = defaultTimeZone;// TimeZone.getDefault();
public static final long millisPerDay = 1000L*24L*3600L; public static final long millisPerDay = 1000L*24L*3600L;
@ -63,7 +60,7 @@ public class PamCalendar {
private static boolean soundFile; private static boolean soundFile;
/** /**
* time from the start of the file to the current moment. * time from the start of the file to the currentmoment.
* This is updated every time data re read from the file, so is * This is updated every time data re read from the file, so is
* accurate to about 1/10 second. * accurate to about 1/10 second.
* For accurate timing within detectors, always try to use sample number * For accurate timing within detectors, always try to use sample number
@ -180,44 +177,8 @@ public class PamCalendar {
public static TimeZone getDisplayTimeZone(boolean useLocal) { public static TimeZone getDisplayTimeZone(boolean useLocal) {
// return TimeZone.getTimeZone("UTC"); // return TimeZone.getTimeZone("UTC");
return useLocal ? CalendarControl.getInstance().getChosenTimeZone() : defaultTimeZone; // return useLocal ? CalendarControl.getInstance().getChosenTimeZone() : defaultTimeZone;
// return useLocal ? localTimeZone : 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) { public static String formatDateTime(Date date) {
@ -430,13 +391,8 @@ public class PamCalendar {
public static String formatDBStyleTime(long timeInMillis, boolean showMillis, boolean useLocal) { public static String formatDBStyleTime(long timeInMillis, boolean showMillis, boolean useLocal) {
Calendar c = Calendar.getInstance(); Calendar c = Calendar.getInstance();
TimeZone tz = getDisplayTimeZone(useLocal);
// if (tz != null) {
// long offs = tz.getOffset(timeInMillis);
// timeInMillis += tz.getOffset(timeInMillis);
// }
c.setTimeInMillis(timeInMillis); c.setTimeInMillis(timeInMillis);
c.setTimeZone(tz); c.setTimeZone(getDisplayTimeZone(useLocal));
DateFormat df; DateFormat df;
if (showMillis) { if (showMillis) {
df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
@ -444,7 +400,7 @@ public class PamCalendar {
else { else {
df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
} }
df.setTimeZone(tz); df.setTimeZone(getDisplayTimeZone(useLocal));
Date d = c.getTime(); Date d = c.getTime();
// return String.format("%tY-%<tm-%<td %<tH:%<tM:%<tS", d); // return String.format("%tY-%<tm-%<td %<tH:%<tM:%<tS", d);
@ -776,7 +732,6 @@ public class PamCalendar {
public static long msFromDateString(String dateString) { public static long msFromDateString(String dateString) {
return msFromDateString(dateString, false); return msFromDateString(dateString, false);
} }
/** /**
* Read a date string and turn it into a millisecond time. * Read a date string and turn it into a millisecond time.
* @param dateString * @param dateString

View File

@ -4,6 +4,7 @@ import java.io.Serializable;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
public class GlobalTimeParameters implements Serializable, Cloneable, ManagedParameters { public class GlobalTimeParameters implements Serializable, Cloneable, ManagedParameters {
@ -91,7 +92,7 @@ public class GlobalTimeParameters implements Serializable, Cloneable, ManagedPar
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
return ps; return ps;
} }

View File

@ -5,6 +5,7 @@ import java.util.TimeZone;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
public class TimeDisplayParameters implements Serializable, Cloneable, ManagedParameters { public class TimeDisplayParameters implements Serializable, Cloneable, ManagedParameters {
@ -34,7 +35,7 @@ public class TimeDisplayParameters implements Serializable, Cloneable, ManagedPa
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
return ps; return ps;
} }

View File

@ -4,6 +4,7 @@ import java.io.Serializable;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
public class NMEATimeParameters implements Serializable, Cloneable, ManagedParameters { public class NMEATimeParameters implements Serializable, Cloneable, ManagedParameters {
@ -26,7 +27,7 @@ public class NMEATimeParameters implements Serializable, Cloneable, ManagedParam
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
return ps; return ps;
} }

View File

@ -4,6 +4,7 @@ import java.io.Serializable;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
public class NTPTimeParameters implements Serializable, Cloneable, ManagedParameters { public class NTPTimeParameters implements Serializable, Cloneable, ManagedParameters {
@ -32,7 +33,7 @@ public class NTPTimeParameters implements Serializable, Cloneable, ManagedParame
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
return ps; return ps;
} }

View File

@ -5,6 +5,7 @@ import java.io.Serializable;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
/** /**
* A series of functions for creating arrays of colours * A series of functions for creating arrays of colours
@ -410,7 +411,7 @@ public class ColourArray implements Cloneable, Serializable, ManagedParameters {
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
return ps; return ps;
} }

View File

@ -265,6 +265,11 @@ public abstract class GeneralProjector<T extends PamCoordinate> {
JComponent toolTipComponent; JComponent toolTipComponent;
/**
* Gets an adapter that can provide tooltips automatically based on plotted data units.
* @param component
* @return
*/
public MouseHoverAdapter getMouseHoverAdapter(JComponent component) { public MouseHoverAdapter getMouseHoverAdapter(JComponent component) {
ToolTipManager tt = ToolTipManager.sharedInstance(); ToolTipManager tt = ToolTipManager.sharedInstance();
tt.registerComponent(component); tt.registerComponent(component);
@ -384,7 +389,9 @@ public abstract class GeneralProjector<T extends PamCoordinate> {
} }
String hintText = dataBlock.getHoverText(this, hoveredDataUnit, hoverData.get(unitIndex).getAmbiguity()); String hintText = dataBlock.getHoverText(this, hoveredDataUnit, hoverData.get(unitIndex).getAmbiguity());
if (hintText == null) return null; if (hintText == null) {
return null;
}
// System.out.println(hintText); // System.out.println(hintText);
return hintText; return hintText;
} }

View File

@ -4,6 +4,7 @@ import java.io.Serializable;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamUtils.PamUtils; import PamUtils.PamUtils;
import PamView.dialog.GroupedSourcePanel; import PamView.dialog.GroupedSourcePanel;
@ -210,7 +211,7 @@ public class GroupedSourceParameters implements Serializable, Cloneable, Managed
*/ */
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DETECTOR);
return ps; return ps;
} }

View File

@ -7,6 +7,7 @@ import java.util.ArrayList;
import PamController.PamControlledUnit; import PamController.PamControlledUnit;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamModel.parametermanager.PrivatePamParameterData; import PamModel.parametermanager.PrivatePamParameterData;
/** /**
@ -55,7 +56,7 @@ public class GuiFrameSettings implements Serializable, Cloneable, ManagedParamet
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
try { try {
Field field = this.getClass().getDeclaredField("unitFrameInfo"); Field field = this.getClass().getDeclaredField("unitFrameInfo");
ps.put(new PrivatePamParameterData(this, field) { ps.put(new PrivatePamParameterData(this, field) {
@ -89,7 +90,7 @@ public class GuiFrameSettings implements Serializable, Cloneable, ManagedParamet
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
try { try {
Field field = this.getClass().getDeclaredField("guiFrame"); Field field = this.getClass().getDeclaredField("guiFrame");
ps.put(new PrivatePamParameterData(this, field) { ps.put(new PrivatePamParameterData(this, field) {

View File

@ -61,6 +61,7 @@ import javax.swing.JMenuBar;
import javax.swing.JMenuItem; import javax.swing.JMenuItem;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JRootPane;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.Timer; import javax.swing.Timer;
@ -73,6 +74,7 @@ import javax.swing.event.MenuListener;
import Acquisition.DaqSystemInterface; import Acquisition.DaqSystemInterface;
import annotation.tasks.AnnotationManager; import annotation.tasks.AnnotationManager;
import metadata.MetaDataContol;
import performanceTests.PerformanceDialog; import performanceTests.PerformanceDialog;
import tipOfTheDay.TipOfTheDayManager; import tipOfTheDay.TipOfTheDayManager;
import Array.ArrayManager; import Array.ArrayManager;
@ -601,6 +603,7 @@ public class PamGui extends PamView implements WindowListener, PamSettings {
fileMenu.add(menuItem); fileMenu.add(menuItem);
} }
// if (SMRUEnable.isEnable()) {
menuItem = new JMenuItem("Import PAMGuard Modules"); menuItem = new JMenuItem("Import PAMGuard Modules");
menuItem.setToolTipText("Import module settings from a different PAMGuard configuration (psfx files only"); menuItem.setToolTipText("Import module settings from a different PAMGuard configuration (psfx files only");
menuItem.addActionListener(new ActionListener() { menuItem.addActionListener(new ActionListener() {
@ -610,6 +613,7 @@ public class PamGui extends PamView implements WindowListener, PamSettings {
} }
}); });
fileMenu.add(menuItem); fileMenu.add(menuItem);
// }
fileMenu.addSeparator(); fileMenu.addSeparator();
@ -759,6 +763,7 @@ public class PamGui extends PamView implements WindowListener, PamSettings {
//for changing "hydrophones" to "microphone" and vice versa if medium changes. //for changing "hydrophones" to "microphone" and vice versa if medium changes.
menu.addMenuListener(new SettingsMenuListener()); menu.addMenuListener(new SettingsMenuListener());
menu.add(MetaDataContol.getMetaDataControl().createMenu(frame));
menu.addSeparator(); menu.addSeparator();
@ -1664,10 +1669,10 @@ public class PamGui extends PamView implements WindowListener, PamSettings {
protected void getGuiParameters() { protected void getGuiParameters() {
guiParameters.extendedState = frame.getExtendedState(); guiParameters.extendedState = frame.getExtendedState();
guiParameters.state = frame.getState(); guiParameters.state = frame.getState();
if (guiParameters.state != Frame.MAXIMIZED_BOTH) { // if (guiParameters.state != Frame.MAXIMIZED_BOTH) {
guiParameters.size = frame.getSize(); guiParameters.size = frame.getSize();
guiParameters.bounds = frame.getBounds(); guiParameters.bounds = frame.getBounds();
} // }
} }
/** /**
@ -1982,6 +1987,30 @@ public class PamGui extends PamView implements WindowListener, PamSettings {
public PamTabbedPane getTabbedPane() { public PamTabbedPane getTabbedPane() {
return this.mainTab; return this.mainTab;
} }
/**
* find a parent window for a JComponent. This can be useful in
* finding windows to open child dialogs when the object holding
* the component may not have a direct reference back to it's dialog.
* @param component any Swing component
* @return parent Window (or frame) if it can be found
*/
public static Window findComponentWindow(JComponent component) {
if (component == null) {
return null;
}
JRootPane root = component.getRootPane();
if (root == null) {
return null;
}
Container rootP = root.getParent();
if (rootP instanceof Window) {
return (Window) rootP;
}
else {
return null;
}
}
} }

View File

@ -38,6 +38,7 @@ import javax.swing.JPanel;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamView.PamColors.PamColor; import PamView.PamColors.PamColor;
import PamView.symbol.SymbolData; import PamView.symbol.SymbolData;
@ -808,7 +809,7 @@ public class PamSymbol extends PamSymbolBase implements Serializable, Icon, Clon
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
return ps; return ps;
} }

View File

@ -48,6 +48,7 @@ public class WarnOnce implements PamSettings {
int ans = showWarning(parent, "Warning Messages", "Show all PAMGuard warning messages", WarnOnce.OK_CANCEL_OPTION); int ans = showWarning(parent, "Warning Messages", "Show all PAMGuard warning messages", WarnOnce.OK_CANCEL_OPTION);
if (ans == WarnOnce.CANCEL_OPTION) return; if (ans == WarnOnce.CANCEL_OPTION) return;
singleInstance.warnOnceList.clearList(); singleInstance.warnOnceList.clearList();
singleInstance.showThisSess.clear();
} }
@Override @Override

View File

@ -4,6 +4,7 @@ import java.io.Serializable;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
public class OverlayDataInfo implements Serializable, Cloneable, ManagedParameters { public class OverlayDataInfo implements Serializable, Cloneable, ManagedParameters {
@ -31,7 +32,7 @@ public class OverlayDataInfo implements Serializable, Cloneable, ManagedParamete
*/ */
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
return ps; return ps;
} }

View File

@ -6,6 +6,7 @@ import java.util.Hashtable;
import PamModel.parametermanager.ManagedParameters; import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet; import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
import PamModel.parametermanager.PrivatePamParameterData; import PamModel.parametermanager.PrivatePamParameterData;
import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataBlock;
@ -73,7 +74,7 @@ public class MarkDataSelectorParams implements Serializable, Cloneable, ManagedP
@Override @Override
public PamParameterSet getParameterSet() { public PamParameterSet getParameterSet() {
PamParameterSet ps = PamParameterSet.autoGenerate(this); PamParameterSet ps = PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
try { try {
Field field = this.getClass().getDeclaredField("overlayChoices"); Field field = this.getClass().getDeclaredField("overlayChoices");
ps.put(new PrivatePamParameterData(this, field) { ps.put(new PrivatePamParameterData(this, field) {

View File

@ -3,7 +3,11 @@ package PamView.symbol;
import java.io.Serializable; import java.io.Serializable;
import java.util.Hashtable; import java.util.Hashtable;
public class ManagedSymbolData implements Cloneable, Serializable { import PamModel.parametermanager.ManagedParameters;
import PamModel.parametermanager.PamParameterSet;
import PamModel.parametermanager.PamParameterSet.ParameterSetType;
public class ManagedSymbolData implements Cloneable, Serializable, ManagedParameters {
public static final long serialVersionUID = 1L; public static final long serialVersionUID = 1L;
@ -34,5 +38,10 @@ public class ManagedSymbolData implements Cloneable, Serializable {
return symbolOptions; return symbolOptions;
} }
@Override
public PamParameterSet getParameterSet() {
return PamParameterSet.autoGenerate(this, ParameterSetType.DISPLAY);
}
} }

View File

@ -0,0 +1,160 @@
package PamView.wizard;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import javax.swing.JButton;
import javax.swing.JPanel;
import PamView.dialog.PamDialog;
import tethys.swing.export.ExportStreamInfoPanel;
import tethys.swing.export.ExportWizardCard;
abstract public class PamWizard extends PamDialog {
private static final long serialVersionUID = 1L;
private JPanel cardPanel;
private CardLayout cardLayout;
private JPanel mainPanel;
private JButton prevButton;
private ArrayList<PamWizardCard> wizardCards = new ArrayList();
public PamWizard(Window parentFrame, String title) {
super(parentFrame, title, false);
cardLayout = new CardLayout();
mainPanel = new JPanel(new BorderLayout());
cardPanel = new JPanel(cardLayout);
mainPanel.add(BorderLayout.CENTER, cardPanel);
setDialogComponent(mainPanel);
getOkButton().setText("Finish");
prevButton = new JButton("Previous");
getButtonPanel().add(prevButton, 0);
prevButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
previousButton();
}
});
setResizable(true);
}
public void addCard(PamWizardCard wizPanel) {
cardPanel.add(wizPanel, wizPanel.getTitle());
wizardCards.add(wizPanel);
}
/**
* Get the main panel. This is the main dialog panel and uses a borderlayout
* with the cards in the CENTER of the panel. Additional information panels
* (generally fixed and not changing with the dialog) can be added NORTH, SOUTH, WEST and EAST.
* @return main Panel.
*/
public JPanel getMainPanel() {
return mainPanel;
}
/**
* Called when 'previous' button is clicked.
*/
protected void previousButton() {
cardLayout.previous(cardPanel);
enableControls();
}
public void enableControls() {
int iCard = getCardIndex();
prevButton.setEnabled(iCard > 0);
boolean isLast = iCard == wizardCards.size()-1;
// getOkButton().setEnabled(!isLast);
getOkButton().setText(isLast ? "Finish" : "Next");
}
private boolean checkCurrentCard() {
int iCard = getCardIndex();
if (iCard < 0) {
return true;
}
return getCardParams(wizardCards.get(iCard));
}
abstract public void setCardParams(PamWizardCard wizardCard);
abstract public boolean getCardParams(PamWizardCard wizardCard);
public int getCardIndex() {
for (int i = 0; i < cardPanel.getComponentCount(); i++) {
Component component = cardPanel.getComponent(i);
if (component.isVisible()) {
return i;
}
}
return -1;
}
public JButton getPreviousButton() {
return prevButton;
}
public void setParams() {
for (PamWizardCard wizCard : wizardCards) {
setCardParams(wizCard);
}
enableControls();
}
@Override
public boolean getParams() {
/**
* This is the OK button, so we need to NOT return OK, which would close the
* dialog until we're on the last card.
*/
if (checkCurrentCard() == false) {
return false;
}
int iCard = getCardIndex();
if (iCard < wizardCards.size()-1) {
cardLayout.next(cardPanel);
enableControls();
return false;
}
return true;
}
@Override
public void restoreDefaultSettings() {
// TODO Auto-generated method stub
}
/**
* Move to the first card in the stack
*/
public void moveFirst() {
cardLayout.first(cardPanel);
}
/**
* Move to the last card in the stack
*/
public void moveLast() {
cardLayout.last(cardPanel);
}
}

Some files were not shown because too many files have changed in this diff Show More