Package rocca

Class RoccaSidePanel

All Implemented Interfaces:
PamObserver, PamSidePanel

public class RoccaSidePanel extends PamObserverAdapter implements PamSidePanel
  • Constructor Details

    • RoccaSidePanel

      public RoccaSidePanel(RoccaControl roccaControl)
  • Method Details

    • getRSDB

      public RoccaSightingDataBlock getRSDB()
    • setNewEncounterID

      public void setNewEncounterID()
      Updates the Encounter ID text box to the current Rocca Parameters value
    • setNewSpeciesID

      public void setNewSpeciesID()
      Updates the Known Species ID text box to the current Rocca Parameters value
    • getPanel

      public JComponent getPanel()
      Specified by:
      getPanel in interface PamSidePanel
      Returns:
      Reference to a graphics component that can be added to the view. This will typically be a JPanel or a JInternalFrame; The component will be displayed to the side of the main tab control.
    • rename

      public void rename(String newName)
      Specified by:
      rename in interface PamSidePanel
    • getObserverName

      public String getObserverName()
      Specified by:
      getObserverName in interface PamObserver
    • receiveSourceNotification

      public void receiveSourceNotification(int type, Object object)
      Description copied from interface: PamObserver
      Receive a notification from the data source - typically a change in DAQ status. See the constants listed in AcquisitionProcess for potential change types.
      Specified by:
      receiveSourceNotification in interface PamObserver
      Overrides:
      receiveSourceNotification in class PamObserverAdapter
      Parameters:
      type - the type of change
      object - generic object added here so that we can include anything in the future
    • setSpecies

      public void setSpecies(String[] speciesAsString)
      Creates a new list of species and sets the counts to 0. Repaints the sidepanel once the fields are updated
      Parameters:
      speciesAsString - a string array of species names (max 5 characters). Note that "Ambig" is automatically added to the beginning of the list, and should note be included in the speciesAsString parameter.
    • updateSightingClass

      public void updateSightingClass()
    • getSpeciesClassCount

      public int[] getSpeciesClassCount()
      Returns the classification counts for the current species list
      Returns:
      an int array containing the classification counts
    • setSpeciesClassCount

      public void setSpeciesClassCount(int[] speciesClassCount)
      Sets all the species counts.
      Parameters:
      speciesClassCount - an int array with the counts for each species. The length of the array must match the length of the species list
    • findSightingUnit

      public RoccaSightingDataUnit findSightingUnit(String sNum)
      Searches through the Sighting Data Block for the passed sighting number. If the sighting number is not found, a "-1" is returned
      Parameters:
      sNum - The sighting number to search for
      Returns:
      The RoccaSightingDataUnit matching the sighting number passed, or a new RoccaSightingDataUnit if the sighting number wasn't found found
    • incSpeciesCount

      public void incSpeciesCount(String sNum, int speciesToInc, double startTime, double dur, boolean isClick)
      Increments a specific species classification count serialVersionUID=15 2014/11/12 add start time to method, and pass to the RoccaSightingDataUnit. serialVersionUID = 22 2015/06/13 add duration and isClick flag to method
      Parameters:
      sNum - the sighting number to increment
      speciesToInc - the index of the species to increment
      startTime - the time of the first data unit, in milliseconds
      dur - the duration of the detection, in milliseconds
      isClick - a flag indicating whether the detection is a click or not
    • incSpeciesCount

      public void incSpeciesCount(String sNum, String speciesToInc, double startTime, double dur, boolean isClick)
      Increments a specific species classification count serialVersionUID=15 2014/11/12 add start time to method, and pass to the RoccaSightingDataUnit. serialVersionUID = 22 2015/06/13 add duration and click flag to method
      Parameters:
      sNum - the sighting number to increment
      speciesToInc - the index of the species to increment
      startTime - the time of the first data unit, in milliseconds
      dur - the duration of the detection, in milliseconds
      isClick - a flag indicating whether the detection is a click or not
    • addSpeciesTreeVotes

      public void addSpeciesTreeVotes(String sNum, double[] newTreeVotes)
      Finds the RoccaSightingDataUnit with the passed sighting number, and adds the tree votes to the running total. If the sighting number is not found, a new RoccaSightingDataUnit is created. serialVersionUID=24 2016/08/10 also set boolean indicating that there's new data in the list, so that the ancillary variables are recalculated on the next save
      Parameters:
      sNum - The sighting number to search for
      newTreeVotes - An array of tree votes
    • getSightingNum

      public String getSightingNum()
    • setStartOfWhistle

      public void setStartOfWhistle(long time, double freq)
    • setEndOfWhistle

      public void setEndOfWhistle(long time, double freq)
    • getAutosaveFreq

      public int getAutosaveFreq()
    • setAutosaveFreq

      public void setAutosaveFreq(int autosaveFreq)
      Note: this method changes the field, but does not update the timer. In order to adjust the period the old timer would need to be deleted and a new timer started. Could also use a ScheduledThreadPoolExecutor...
      Parameters:
      autosaveFreq -
    • setCurrentUnit

      public void setCurrentUnit(RoccaSightingDataUnit currentUnit)
    • getRequiredDataHistory

      public long getRequiredDataHistory(PamObservable o, Object arg)
      Specified by:
      getRequiredDataHistory in interface PamObserver
      Overrides:
      getRequiredDataHistory in class PamObserverAdapter
      Parameters:
      arg - optional argument from PamObservable
      Returns:
      time in milliseconds required by data held in PamObservable