angleVetoes
Class AngleVetoes

java.lang.Object
  extended by angleVetoes.AngleVetoes
All Implemented Interfaces:
PamSettings

public class AngleVetoes
extends java.lang.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

Nested Class Summary
(package private)  class AngleVetoes.DisplayAction
          Action listener for the display menu
(package private)  class AngleVetoes.SettingsAction
          ActionListener for the getSettingsMenuItem()
 
Field Summary
private  AngleVetoDisplay angleVetoDisplay
           
private  AngleVetoParameters angleVetoParameters
           
private  PamControlledUnit pamControlledUnit
           
 
Constructor Summary
AngleVetoes(PamControlledUnit pamControlledUnit)
           
 
Method Summary
 void addAngleData(double angle)
          Add data to angle stats histogram for display
 void addPassData(boolean pass)
          Add data to pas / fail stats for display
private  void displayAction(java.awt.Frame frame)
           
 AngleVetoParameters getAngleVetoParameters()
          Access to the veto parameters
 javax.swing.JMenuItem getDisplayMenuItem(java.awt.Frame frame)
          Get a menu item for inclusion in menus of detectors using the veto (i.e.
private  void getNewSettings(java.awt.Frame frame)
           
 javax.swing.JMenuItem getSettingsMenuItem(java.awt.Frame frame)
          Get a menu item for inclusion in menus of detectors using the veto (i.e.
 java.io.Serializable getSettingsReference()
           
 long getSettingsVersion()
           
 java.lang.String getUnitName()
           
 java.lang.String getUnitType()
           
 boolean passAllVetoes(double angle, boolean collectStats)
          Test a particular angle to see if it passes all veto tests.
 boolean passVeto(AngleVeto angleVeto, double angle)
          Test to see if a given angle passes a particular veto
 boolean passVeto(int vetoIndex, double angle)
          Test to see if a given angle passes a particular veto
 boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
           
 void setAngleVetoParameters(AngleVetoParameters angleVetoParameters)
          set angle veto parameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pamControlledUnit

private PamControlledUnit pamControlledUnit

angleVetoParameters

private AngleVetoParameters angleVetoParameters

angleVetoDisplay

private AngleVetoDisplay angleVetoDisplay
Constructor Detail

AngleVetoes

public AngleVetoes(PamControlledUnit pamControlledUnit)
Method Detail

getSettingsReference

public java.io.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 java.lang.String getUnitName()
Specified by:
getUnitName in interface PamSettings
Returns:
A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.

getUnitType

public java.lang.String getUnitType()
Specified by:
getUnitType in interface PamSettings
Returns:
A Name specific to the type, e.g. Glick 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 javax.swing.JMenuItem getSettingsMenuItem(java.awt.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.

getNewSettings

private void getNewSettings(java.awt.Frame frame)

getDisplayMenuItem

public javax.swing.JMenuItem getDisplayMenuItem(java.awt.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.

displayAction

private void displayAction(java.awt.Frame frame)

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.