Package rocca
Class RoccaSidePanel
java.lang.Object
PamguardMVC.PamObserverAdapter
rocca.RoccaSidePanel
- All Implemented Interfaces:
PamObserver
,PamSidePanel
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSpeciesTreeVotes
(String sNum, double[] newTreeVotes) Finds the RoccaSightingDataUnit with the passed sighting number, and adds the tree votes to the running total.findSightingUnit
(String sNum) Searches through the Sighting Data Block for the passed sighting number.int
getPanel()
long
getRSDB()
int[]
Returns the classification counts for the current species listvoid
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.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.void
receiveSourceNotification
(int type, Object object) Receive a notification from the data source - typically a change in DAQ status.void
void
setAutosaveFreq
(int autosaveFreq) Note: this method changes the field, but does not update the timer.void
setCurrentUnit
(RoccaSightingDataUnit currentUnit) void
setEndOfWhistle
(long time, double freq) void
Updates the Encounter ID text box to the current Rocca Parameters valuevoid
Updates the Known Species ID text box to the current Rocca Parameters valuevoid
setSpecies
(String[] speciesAsString) Creates a new list of species and sets the counts to 0.void
setSpeciesClassCount
(int[] speciesClassCount) Sets all the species counts.void
setStartOfWhistle
(long time, double freq) void
Methods inherited from class PamguardMVC.PamObserverAdapter
addData, getObserverObject, masterClockUpdate, noteNewSettings, removeObservable, setSampleRate, updateData
-
Constructor Details
-
RoccaSidePanel
-
-
Method Details
-
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
- Specified by:
getPanel
in interfacePamSidePanel
- 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
- Specified by:
rename
in interfacePamSidePanel
-
getObserverName
- Specified by:
getObserverName
in interfacePamObserver
-
receiveSourceNotification
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 interfacePamObserver
- Overrides:
receiveSourceNotification
in classPamObserverAdapter
- Parameters:
type
- the type of changeobject
- generic object added here so that we can include anything in the future
-
setSpecies
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
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 incrementspeciesToInc
- the index of the species to incrementstartTime
- the time of the first data unit, in millisecondsdur
- the duration of the detection, in millisecondsisClick
- 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 incrementspeciesToInc
- the index of the species to incrementstartTime
- the time of the first data unit, in millisecondsdur
- the duration of the detection, in millisecondsisClick
- a flag indicating whether the detection is a click or not
-
addSpeciesTreeVotes
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 fornewTreeVotes
- An array of tree votes
-
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
-
getRequiredDataHistory
- Specified by:
getRequiredDataHistory
in interfacePamObserver
- Overrides:
getRequiredDataHistory
in classPamObserverAdapter
- Parameters:
arg
- optional argument from PamObservable- Returns:
- time in milliseconds required by data held in PamObservable
-