Package angleVetoes

Class AngleVetoes

java.lang.Object
angleVetoes.AngleVetoes
All Implemented Interfaces:
PamSettings, SettingsNameProvider

public class AngleVetoes extends Object implements PamSettings
Class to support functions to handle vetoes on angles to clicks

This is all much more complicated than in RainbowClick since there may be multiple channel groups and there may be multiple vetoes looking at specific angles. For now though, it just handles min and max angles to veto, but you can have multiple vetoes.

Author:
Douglas Gillespie
  • Constructor Details

  • Method Details

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

      public String getUnitName()
      Specified by:
      getUnitName in interface SettingsNameProvider
      Returns:
      A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
    • getUnitType

      public String getUnitType()
      Specified by:
      getUnitType in interface PamSettings
      Returns:
      A Name specific to the type, e.g. Click detector
    • 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
    • getSettingsMenuItem

      public JMenuItem getSettingsMenuItem(Frame frame)
      Get a menu item for inclusion in menus of detectors using the veto (i.e. add the output of this function to the detection menu for the detector).
      Parameters:
      frame - Frame holding the menu
      Returns:
      a menu item.
    • getDisplayMenuItem

      public JMenuItem getDisplayMenuItem(Frame frame)
      Get a menu item for inclusion in menus of detectors using the veto (i.e. add the output of this function to the display menu for the detector).
      Parameters:
      frame - Frame holding the menu
      Returns:
      a menu item.
    • getAngleVetoParameters

      public AngleVetoParameters getAngleVetoParameters()
      Access to the veto parameters
      Returns:
      AngleVetoParameters
    • setAngleVetoParameters

      public void setAngleVetoParameters(AngleVetoParameters angleVetoParameters)
      set angle veto parameters
      Parameters:
      angleVetoParameters -
    • passVeto

      public boolean passVeto(int vetoIndex, double angle)
      Test to see if a given angle passes a particular veto
      Parameters:
      vetoIndex - index of veto
      angle - angle in degrees
      Returns:
      tru if NOT vetoed, false if vetoed.
    • passVeto

      public boolean passVeto(AngleVeto angleVeto, double angle)
      Test to see if a given angle passes a particular veto
      Parameters:
      angleVeto - reference to veto
      angle - angle in degrees
      Returns:
      tru if NOT vetoed, false if vetoed.
    • passAllVetoes

      public boolean passAllVetoes(double angle, boolean collectStats)
      Test a particular angle to see if it passes all veto tests.

      Optionally add data about the angle and whether or not it passed the tests to the display data histograms.

      Parameters:
      angle - angle to test in degrees
      collectStats - set to true if you want to collect stats for display purposes.
      Returns:
      true if passes all tests. False if it ails one or more (true if there are no vetoes)
    • addAngleData

      public void addAngleData(double angle)
      Add data to angle stats histogram for display
      Parameters:
      angle - angle in degrees
    • addPassData

      public void addPassData(boolean pass)
      Add data to pas / fail stats for display
      Parameters:
      pass - true if there was a pass, false for a fail.