Package tethys.deployment
Class DeploymentHandler
java.lang.Object
tethys.CollectionHandler
tethys.deployment.DeploymentHandler
- All Implemented Interfaces:
DeploymentTableObserver
,TethysStateObserver
public class DeploymentHandler
extends CollectionHandler
implements TethysStateObserver, DeploymentTableObserver
Functions to gather data for the deployment document from all around PAMGuard.
There should be just one of these, available from TethysControl and it will try
to sensible handle when and how it updates it's list of PAMGuard and Tethys information
Any part of PAMGuard wanting information on Deployments should come here.
Any part of PAMGuard wanting information on Deployments should come here.
- Author:
- dg50
-
Field Summary
FieldsFields inherited from class tethys.CollectionHandler
tethysControl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
batchExport
(nilus.Deployment outlineDeployment) Called from the offline task (which will probably only be available in batch mode) to export all deployments.canExportDeployments
(boolean fullChecks) Test to see if it's possible to export Deployment documents.nilus.Deployment
createDeploymentDocument
(int i, RecordingPeriod recordingPeriod, String deploymentId) Create deployment document.void
void
Export button pressed on GUI.void
exportDeployments
(ArrayList<RecordingPeriod> selected) Export deployments docs.Get the Instrument info for the current array.long
getDeploymentOverlap
(PDeployment aDeployment, RecordingPeriod aPeriod) Get the overlap in mills between a nilus Deployment and a PAMGuard recording periodGet the automatic duty cycle information.int
Get the first free deploymendId.Get a list of Tethys Deployment docs that match the current PAMGuard data.Get a list of Tethys deployment docs.Get a list of instruments from the current project deployments.Gather up all track information both from the GPS module (if it exists) and the type of hydrophone array (or many!)void
void
setDeploymentExportOptions
(DeploymentExportOpts deploymentExportOptions) void
showOptions
(Window parent) boolean
Update the list of Tethys deploymentsvoid
updateState
(TethysState tethysState) Receive state updates when Tethys has done something (made a connection, moved some data, etc.)
Note that this is for RECEIVING state updates, not for sending them.Methods inherited from class tethys.CollectionHandler
collectionName, getCollection, getDetectorEffort, getMethodString, getSoftwareString, getSupportSoftware, getSupportSoftwareVersion, getTethysControl, getVersionString
-
Field Details
-
Constructor Details
-
Method Details
-
getTrackInformation
Gather up all track information both from the GPS module (if it exists) and the type of hydrophone array (or many!)- Returns:
-
updateState
Description copied from interface:TethysStateObserver
Receive state updates when Tethys has done something (made a connection, moved some data, etc.)
Note that this is for RECEIVING state updates, not for sending them. To avoid infinite notifications loops, use tethysControl.sendStateUpdate(TethysState) to send out state notifications.- Specified by:
updateState
in interfaceTethysStateObserver
- Parameters:
tethysState
-
-
updateProjectDeployments
public boolean updateProjectDeployments()Update the list of Tethys deployments- Returns:
- true if OK
-
getProjectDeployments
Get a list of Tethys deployment docs. Note that this doesn't update the list, but uses the one currently in memory so call updateTethysDeployments() first if necessary.- Returns:
- list of (wrapped) nilus Deployment objects.
-
showOptions
-
createPamguardOverview
public void createPamguardOverview() -
exportDeployments
public void exportDeployments()Export button pressed on GUI. Run wizard.... -
exportDeployments
Export deployments docs. Playing with a couple of different ways of doing this.- Parameters:
selected
-
-
getDeploymentOverview
-
getDeploymentOverlap
Get the overlap in mills between a nilus Deployment and a PAMGuard recording period- Parameters:
aDeployment
- nilus Deployment from TethysaPeriod
- PAMGuard recording period- Returns:
- overlap in milliseconds
-
getMatchedDeployments
Get a list of Tethys Deployment docs that match the current PAMGuard data. Watch for repeats if a single deployment doc covers many perdiods.- Returns:
-
getProjectInstruments
Get a list of instruments from the current project deployments. This may be a shorter list than the list of deployments.- Returns:
-
getFirstFreeDeploymentId
public int getFirstFreeDeploymentId()Get the first free deploymendId. This will get appended to the ProjectName to make and id for each Deployment document- Returns:
-
createDeploymentDocument
public nilus.Deployment createDeploymentDocument(int i, RecordingPeriod recordingPeriod, String deploymentId) Create deployment document. May be better off passing in the Metadata.- Parameters:
i
-recordingPeriod
-deploymentId
-- Returns:
-
getBinaryDataURI
-
getDatabaseURI
-
getRawDataURI
-
canExportDeployments
Test to see if it's possible to export Deployment documents. This is basically a test of various metadata fields that are required, such as instrument id's.
In main Tethys, this is called before the Export button is pressed, so doesn't check information that's filled in in the Wizard. When called from the task though it has to do a more complete set of checks.- Parameters:
fullChecks
- do a more complete set of checks of EVERYTHING that's needed prior to export. If false only do some checks that are needed prior to running the Wizard.- Returns:
- null if OK, or a string describing the first encountered error
-
getCurrentArrayInstrument
Get the Instrument info for the current array.- Returns:
-
getDutyCycle
Get the automatic duty cycle information.- Returns:
-
selectionChanged
public void selectionChanged()- Specified by:
selectionChanged
in interfaceDeploymentTableObserver
-
getDeploymentExportOptions
- Returns:
- the deploymentExportOptions
-
setDeploymentExportOptions
- Parameters:
deploymentExportOptions
- the deploymentExportOptions to set
-
getHelpPoint
- Specified by:
getHelpPoint
in classCollectionHandler
-
batchExport
public void batchExport(nilus.Deployment outlineDeployment) Called from the offline task (which will probably only be available in batch mode) to export all deployments.
Can see various enhancements such as allowing overwriting to include in batch process parameters. Won't ever overwrite.- Parameters:
outlineDeployment
-
-