Class ClickTrainControl

java.lang.Object
PamController.PamControlledUnit
clickTrainDetector.ClickTrainControl
All Implemented Interfaces:
PamSettings, SettingsNameProvider

public class ClickTrainControl extends PamControlledUnit implements PamSettings
A click train detector. The detector has a detection stage and a classification stage.

The detector is an algorithm which extract any plausible click train from the data.

The classification stage decides whether a detected click train should be saved or removed form the click train data block.

Author:
Jamie Macaulay
  • Field Details

    • PROCESSING_START

      public static final int PROCESSING_START
      Flag for processing start
      See Also:
    • NEW_PARAMS

      public static final int NEW_PARAMS
      Flag to indicate a setup is required
      See Also:
    • PROCESSING_END

      public static final int PROCESSING_END
      See Also:
    • NEW_PARENT_DATABLOCK

      public static final int NEW_PARENT_DATABLOCK
      Flag indicating a new parent data block has been selected. This allows settings panes to execute any appropriate GUI changes.
      See Also:
    • CLOCK_UPDATE

      public static final int CLOCK_UPDATE
      The PAMGuard clock has been updated.
      See Also:
    • helpPoint

      public static final String helpPoint
      Help point which can be referenced form dialogs, etc.
      See Also:
  • Constructor Details

    • ClickTrainControl

      public ClickTrainControl(String unitName)
      Constructor for the ClickTrainControl.
      Parameters:
      unitName - - the unit name.
  • Method Details

    • getClickTrainDataBlock

      public ClickTrainDataBlock getClickTrainDataBlock()
      Get the click train data block. The click train data block holds all confirmed click trains included those which are not classified to species.
      Returns:
      the clickTrainDataBlock
    • getClssfdClickTrainDataBlock

      public ClickTrainDataBlock getClssfdClickTrainDataBlock()
      Get the classified click train data block. This holds click trains which have been classified to a species.
      Returns:
      the classified click train data block.
    • setClickTrainParams

      public void setClickTrainParams(ClickTrainParams clickTrainParams)
    • setupControlledUnit

      public void setupControlledUnit()
      Description copied from class: PamControlledUnit
      called for all PamControlledUnits after all units have been created. This is a good time for the controlled units and processes to find and check their source data and the configuration generally since most onjects (i.e. output data blocks) should be in place
      Overrides:
      setupControlledUnit in class PamControlledUnit
    • getDataSelector

      public DataSelector getDataSelector()
      The current data selector.
      Returns:
      the current data selector.
    • getSettingsReference

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

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

      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
    • notifyModelChanged

      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
    • getClickTrainParams

      public ClickTrainParams getClickTrainParams()
      Get click train parameters.
      Returns:
      the click train parameters.
    • getClickTrainProcess

      public ClickTrainProcess getClickTrainProcess()
      Get click train process.
      Returns:
      the click train process.
    • getCurrentCTAlgorithm

      public ClickTrainAlgorithm getCurrentCTAlgorithm()
      Get the current click train algorithm.
      Returns:
      the click train algorithm.
    • update

      public void update(int flag)
      Send update flag to module. Sends the flag to all click train algorithms.
      Parameters:
      flag - - the update flag.
    • getCTClassificationProcess

      public CTClassificationProcess getCTClassificationProcess()
      Get the classification process. This classifies the click train.
      Returns:
      the ctClassificationProcess
    • getClickTrainAlgorithms

      public ArrayList<ClickTrainAlgorithm> getClickTrainAlgorithms()
      Get all available click train algorithms.
      Returns:
      list of available click train algorithms.
    • updateParams

      public void updateParams(ClickTrainParams newParams)
      Update the parameters.
      Parameters:
      newParams - - the parameters to update.
    • getParentDataBlock

      public PamDataBlock<?> getParentDataBlock()
      Convenience method to get the current parent data block of the process.
      Returns:
      - the parent data block.
    • getClickDataBlock

      public PamDataBlock getClickDataBlock()
      Get the parent data block if it is a click train data block
      Returns:
      the click data block.
    • getAlgorithmParams

      public boolean getAlgorithmParams()
      Called whenever CLICK train settings panes should getParams() e.g. when a dialog is closed. The algorithms handle their own settings.
    • getCurrentClassifiers

      public ArrayList<CTClassifier> getCurrentClassifiers()
      Get the current classifiers.
      Returns:
      the current classifiers.
    • getSidePanel

      public PamSidePanel getSidePanel()
      Swing GUI
      Overrides:
      getSidePanel in class PamControlledUnit
      Returns:
      a pamSidePanel object.
      See Also:
    • createDetectionMenu

      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.

    • getSwingGUI

      public CTSwingGUI getSwingGUI()
    • getGUI

      public PamControlledUnitGUI getGUI(int flag)
      Description copied from class: PamControlledUnit
      Get the GUI for the PAMControlled unit. This has multiple GUI options which are instantiated depending on the view type.
      Overrides:
      getGUI in class PamControlledUnit
      Parameters:
      flag - . The GUI type flag defined in PAMGuiManager.
      Returns:
      the GUI for the PamControlledUnit unit.
    • getClickTrainsOffline

      public ClickTrainOfflineProcess getClickTrainsOffline()
      Get the offline process for the click train detector i.e. using it in viewer mode.
      Returns:
      the offline process.
    • createDataSelector

      public void createDataSelector(PamDataBlock<?> source)
      Get the data selector.
      Parameters:
      source - - the source data block
    • getClassifierManager

      public CTClassifierManager getClassifierManager()
      The classifier manager.
      Returns:
      the classifier manager.
    • getClickClassifierProccess

      public CTClassificationProcess getClickClassifierProccess()
      Get the classification process
      Returns:
      the classification process.
    • getCTLocalisationProccess

      public CTLocalisationProcess getCTLocalisationProccess()
      Get the click train localisation process. This localises clicks from the classified click train data block.
      Returns:
      the click loclaisation process.
    • getWarningManager

      public CTWarningManager getWarningManager()
      Get the warning manager. This handles any warning messages passed from the UI or other processes.
      Returns:
      the warning manager.
    • isNotifyProcesses

      public boolean isNotifyProcesses()
      True to notify downstream processes if a new click train is detected.
      Returns:
      true to notify processes.
    • setNotifyProcesses

      public void setNotifyProcesses(boolean notify)
      Set whether to notify downstream processes if a new click train is detected.
    • getModuleStatus

      public ModuleStatus getModuleStatus()
      Description copied from class: PamControlledUnit
      Quick convenient way of getting the module status.
      Overrides:
      getModuleStatus in class PamControlledUnit
      Returns:
      Module Status or null if no status manager present.
    • getCTAlgorithmInfoManager

      public CTAlgorithmInfoManager getCTAlgorithmInfoManager()
      Get the algorithm info manager. This handles logging information on different algorithms into the database
      Returns: