Package tethys.species
Class SpeciesMapManager
java.lang.Object
tethys.species.SpeciesMapManager
- All Implemented Interfaces:
PamSettings
,SettingsNameProvider
Master manager for species maps which will eventually allow for export and import from XML
documents, databases and other things ...
Might be a problem for some batch task management having these so global and having datablocks in the external config that are not in the main model. Will move storage to individual datablocks and here simply have functions to gather all for some global output.
(Perhaps not as XML, will simply output the serialized map - easier.
Might be a problem for some batch task management having these so global and having datablocks in the external config that are not in the main model. Will move storage to individual datablocks and here simply have functions to gather all for some global output.
(Perhaps not as XML, will simply output the serialized map - easier.
- Author:
- dg50
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionboolean
exportSpeciesMaps
(Window parentFrame, String singleDataBlock) Export all species maps to a serialized object file.void
Get species maps from all PAMGuard datablocks which have such a map Nothing is ever removed from here, which probably matters.void
gatherSpeciesMaps
(PamConfiguration configuration) Get species maps from all PAMGuard datablocks which have such a map Nothing is ever removed from here, which probably matters.getExportAction
(Window parentFrame) getImportAction
(Window parentFrame) static SpeciesMapManager
Get an instance of the global species manager.Gathers species maps from datablocks using the default configuration.getSettingsReference
(PamConfiguration pamConfiguration) Gathers species maps from datablocks using the given configuration (used in batch control)long
getSpeciesMap
(PamDataBlock pamDataBlock) boolean
importSpeciesMaps
(Window parentFrame, String selectedBlock) Import global species maps from selected file.boolean
restoreSettings
(PamControlledUnitSettings pamControlledUnitSettings)
-
Field Details
-
Method Details
-
getInstance
Get an instance of the global species manager. This handles look up tables for each datablock to convert from internal PAMGuard names to ITIS species codes and usefully call types for output to Tethys.- Returns:
-
getUnitName
- Specified by:
getUnitName
in interfaceSettingsNameProvider
- Returns:
- A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
-
getUnitType
- Specified by:
getUnitType
in interfacePamSettings
- Returns:
- A Name specific to the type, e.g. Click detector
-
getSettingsReference
Gathers species maps from datablocks using the default configuration.- Specified by:
getSettingsReference
in interfacePamSettings
- Returns:
- The serialisable object that will be stored
-
getSettingsReference
Gathers species maps from datablocks using the given configuration (used in batch control)- Parameters:
pamConfiguration
-- Returns:
- serialised data for species maps.
-
gatherSpeciesMaps
public void gatherSpeciesMaps()Get species maps from all PAMGuard datablocks which have such a map Nothing is ever removed from here, which probably matters. -
gatherSpeciesMaps
Get species maps from all PAMGuard datablocks which have such a map Nothing is ever removed from here, which probably matters.- Parameters:
configuration
- PAMGuard configuration if not the main one (used in batch processing job control)
-
getSpeciesMap
-
getSettingsVersion
public long getSettingsVersion()- Specified by:
getSettingsVersion
in interfacePamSettings
- Returns:
- An integer version number for the settings
-
restoreSettings
- Specified by:
restoreSettings
in interfacePamSettings
- Parameters:
pamControlledUnitSettings
-- Returns:
- true if successful The object performs final checks (if needed) and then casts the settings data pamcontrolledunitSettings.settings into the correct type and uses as required
-
getExportAction
-
getImportAction
-
exportSpeciesMaps
Export all species maps to a serialized object file.- Parameters:
parentFrame
-singleDataBlock
- name of datablock to automatically check.- Returns:
-
importSpeciesMaps
Import global species maps from selected file.- Parameters:
parentFrame
-selectedBlock
- specific block, which will get checked by default in the dialog. Can be null- Returns:
-