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.
Author:
dg50
  • Field Details

  • Constructor Details

    • DeploymentHandler

      public DeploymentHandler(TethysControl tethysControl)
  • Method Details

    • getTrackInformation

      public TrackInformation getTrackInformation()
      Gather up all track information both from the GPS module (if it exists) and the type of hydrophone array (or many!)
      Returns:
    • updateState

      public void updateState(TethysState tethysState)
      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 interface TethysStateObserver
    • updateProjectDeployments

      public boolean updateProjectDeployments()
      Update the list of Tethys deployments
      Returns:
      true if OK
    • getProjectDeployments

      public ArrayList<PDeployment> 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

      public void showOptions(Window parent)
    • createPamguardOverview

      public void createPamguardOverview()
    • exportDeployments

      public void exportDeployments()
      Export button pressed on GUI. Run wizard....
    • exportDeployments

      public void exportDeployments(RecordingList allPeriods)
      Export deployments docs. Playing with a couple of different ways of doing this.
      Parameters:
      allPeriods -
    • getDeploymentOverview

      public DeploymentOverview getDeploymentOverview()
    • getDeploymentOverlap

      public long getDeploymentOverlap(PDeployment aDeployment, RecordingPeriod aPeriod)
      Get the overlap in mills between a nilus Deployment and a PAMGuard recording period
      Parameters:
      aDeployment - nilus Deployment from Tethys
      aPeriod - PAMGuard recording period
      Returns:
      overlap in milliseconds
    • getMatchedDeployments

      public ArrayList<PDeployment> 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

      public ArrayList<PInstrument> 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)
    • getBinaryDataURI

      public String getBinaryDataURI()
    • getDatabaseURI

      public String getDatabaseURI()
    • getRawDataURI

      public String getRawDataURI()
    • canExportDeployments

      public String 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.
      Returns:
      null if OK, or a string describing the first encountered error
    • getCurrentArrayInstrument

      public PInstrument getCurrentArrayInstrument()
      Get the Instrument info for the current array.
      Returns:
    • selectionChanged

      public void selectionChanged()
      Specified by:
      selectionChanged in interface DeploymentTableObserver
    • getDeploymentExportOptions

      public DeploymentExportOpts getDeploymentExportOptions()
      Returns:
      the deploymentExportOptions
    • getHelpPoint

      public String getHelpPoint()
      Specified by:
      getHelpPoint in class CollectionHandler