Package tethys

Class TethysControl

All Implemented Interfaces:
PamSettings, SettingsNameProvider, TethysStateObserver

public class TethysControl extends PamControlledUnit implements PamSettings, TethysStateObserver
Quick play with a simple system for outputting data to Tethys. At it's start this is simply going to offer a dialog and have a few functions which show how to access data within PAMGuard.
Author:
dg50
  • Field Details Link icon

  • Constructor Details Link icon

    • TethysControl Link icon

      public TethysControl(String unitName)
  • Method Details Link icon

    • getDbxmlConnect Link icon

      public DBXMLConnect getDbxmlConnect()
      Get DBXML Connector. This class contains all the functions that are needed to talk to the database.
      Returns:
      DBXML functions.
    • createDetectionMenu Link icon

      public JMenuItem createDetectionMenu(Frame parentFrame)
      Description copied from class: PamControlledUnit
      Create a JMenu object containing MenuItems associated with PamProcesses
      Overrides:
      createDetectionMenu in class PamControlledUnit
      Parameters:
      parentFrame - The owner frame of the menu
      Returns:
      reference to a JMenu which can be added to an existing menu or menu bar

      Note that if multiple views are to use the same menu, then they should each create a new menu (by setting Create to true) the first time they call this method.

    • createFileMenu Link icon

      public JMenuItem createFileMenu(JFrame parentFrame)
      Overrides:
      createFileMenu in class PamControlledUnit
      Parameters:
      parentFrame - parent frame for the menu
      Returns:
      the file menu item
    • createTethysMenu Link icon

      public JMenuItem createTethysMenu(Frame parentFrame)
      Make a menu. Can go either in File or Settings. TBD.
      Parameters:
      parentFrame -
      Returns:
    • showProjectDeploymentsDialog Link icon

      public void showProjectDeploymentsDialog()
    • getExportableDataBlocks Link icon

      public ArrayList<PamDataBlock> getExportableDataBlocks()
    • getSynchronisationInfos Link icon

      public ArrayList<DatablockSynchInfo> getSynchronisationInfos()
      Get the synchronisation info for all datablocks. This list should be static, but check it in case something has been added or removed.
      Returns:
    • findDatablockSynchInfo Link icon

      public DatablockSynchInfo findDatablockSynchInfo(PamDataBlock dataBlock)
    • openTethysClient Link icon

      public void openTethysClient()
      open client in the default web browser
    • openTethysCollection Link icon

      public void openTethysCollection(Collection collection)
      open client in the default web browser
    • openCollectionInPAMGuard Link icon

      public void openCollectionInPAMGuard(Collection collection)
    • openCollectionInBrowser Link icon

      public void openCollectionInBrowser(String collectionName)
    • getTabPanel Link icon

      public PamTabPanel getTabPanel()
      Description copied from class: PamControlledUnit
      Gets a reference to a panel to be added to a view
      Overrides:
      getTabPanel in class PamControlledUnit
      Returns:
      reference to a PamTabPanel object
      See Also:
    • getTethysExportParams Link icon

      public TethysExportParams getTethysExportParams()
      Returns:
      the tethysExportParams
    • getGlobalDeplopymentData Link icon

      public nilus.Deployment getGlobalDeplopymentData()
      Get global deployment data. This is a bit of a mess, trying to use a separate module so that the rest of PAMGuard can use it, but creating the
      Returns:
    • addStateObserver Link icon

      public void addStateObserver(TethysStateObserver stateObserver)
      Add a new state observer.
      Parameters:
      stateObserver -
    • removeStateObserver Link icon

      public boolean removeStateObserver(TethysStateObserver stateObserver)
      Remove a state observer.
      Parameters:
      stateObserver -
      Returns:
      true if it existed.
    • sendStateUpdate Link icon

      public void sendStateUpdate(TethysState tethysState)
      Send state updates around to all state observers.
      Parameters:
      tethysState -
    • getDataSelectName Link icon

      public String getDataSelectName()
      A name for any deta selectors.
      Returns:
    • getDbxmlQueries Link icon

      public DBXMLQueries getDbxmlQueries()
    • notifyModelChanged Link icon

      public void notifyModelChanged(int changeType)
      Description copied from class: PamControlledUnit
      General notification when the PAMGAURD model changes.
      Overrides:
      notifyModelChanged in class PamControlledUnit
      Parameters:
      changeType - type of change
    • checkServer Link icon

      public ServerStatus checkServer()
      Check the server. This will send around a notification if the state has changed since the last call to this function, so it's unlikely you'll need to use the return value
      Returns:
      server status.
    • getSettingsReference Link icon

      public Serializable getSettingsReference()
      Specified by:
      getSettingsReference in interface PamSettings
      Returns:
      The serialisable object that will be stored
    • getSettingsVersion Link icon

      public long getSettingsVersion()
      Specified by:
      getSettingsVersion in interface PamSettings
      Returns:
      An integer version number for the settings
    • restoreSettings Link icon

      public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
      Specified by:
      restoreSettings in interface PamSettings
      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
    • updateState Link icon

      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
    • getDeploymentHandler Link icon

      public DeploymentHandler getDeploymentHandler()
      One stop place to get Deployment information. Will provide both information on record periods in PAMGuard and also Deployment docs in Tethys.
      Returns:
      set of functions for handling deployments.
    • getDetectionsHandler Link icon

      public DetectionsHandler getDetectionsHandler()
    • getLocalizationHandler Link icon

      public LocalizationHandler getLocalizationHandler()
      Returns:
      the localizationHandler
    • showException Link icon

      public void showException(TethysException tethysException)
    • displayDocument Link icon

      public void displayDocument(DocumentInfo docInfo)
    • displayDocument Link icon

      public void displayDocument(String collection, String documentId)
      Load a document from the database and display it in a popup window
      Parameters:
      collection -
      documentId -
    • exportDocument Link icon

      public void exportDocument(String collection, String documentId)
      Load a document from the database and write to a file selected by the user
      Parameters:
      collection -
      documentId -
    • getItisFunctions Link icon

      public ITISFunctions getItisFunctions()
      Returns:
      the itisFunctions
    • exportedDetections Link icon

      public void exportedDetections(PamDataBlock dataBlock)
      Called when a detections document has been exported.
      Parameters:
      dataBlock -
    • deletedDetections Link icon

      public void deletedDetections(PamDataBlock dataBlock)
    • getCalibrationHandler Link icon

      public CalibrationHandler getCalibrationHandler()
      Returns:
      the calibrationHandler
    • getLastServerStatus Link icon

      public ServerStatus getLastServerStatus()
      Returns:
      the lastServerStatus
    • isServerOk Link icon

      public boolean isServerOk()
      Quick way for any controls to see that the server is probably OK without actually pinging it.
      Returns:
      true if last ping of server was OK