public class StaticLocaliserControl extends PamControlledUnit implements PamSettings
The static localiser ('localiser' with an 's') is designed to allow the localisation of a single vocalisation incident on a synchronised or unsynchronised hydrophone array. As of 17/05/2012 only a click and offline click datablock can be used in localisation, however the module has been written to allow others to enable different data blocks easily. In addition different localisation algorithms can be integrated by writing a single class.
To enable a new data block for localisation.
1) Create a new sub class of 'AbstractDetectionMatch' and fill out the relevant functions. This class takes a PamDataUnit and it's parent datablock then works out all the possible time delays between the hydrophone elements within the specified array. A flag can be passed to this class in order to determine how to calculate time delays (usually by specifying which dataunits on other hydrophones to use). For example in 'ClickDetectionMatch' flags to include only clicks which are part of the same event and/or species are passed when working out time delays. However a flag could be passed which initiates a more complex type of time delay calculation, perhaps using click train matching techniques.
2)Create a new control panel, a subclass of 'AbstractLocaliserControl' and again make sure to fill out all the required functions properly. This panel should allow the user to navigate through the individual pamdataunits within the pamdatablock. It should also allow the user to select which flags to send to the time delay calculation. For example the click control panel allows the user to select different species classifications. If a species classification is selected in the control panel, the panel will return a flag which, in 'ClickDetectionMatch' tells the time delay algorithm only to select dataunits which are of the same classification
3)Implement 'StaticLocaliserProvider' for the data block in question. This will create a function which must return an AbstractLocaliserControl class, i.e. the controlPanel you just made.
4)In your subclass of PamDataUnit, eg ClickDetection, change the functions 'getDetectionMatch()' and 'getDetectionMatch(int type)' to return the subclass of AbstractDetectionMatch you've created. Note if there are no flags for your AbstractDetectionMatch sub class simply return the same for both these functions.
5)Sit back and enjoy the program crashing. Time to debug.
To create a new localisation algorithm
1) Create a subclass of 'AbstractStaticLocaliserAlgorithm' and fill out the relevant functions. Note that the runModel() algorithm returns an ArrayList of StaticLocalisationResults. This is because an algorithm may be intelligent enough to calculate two possible locations. If not just have an ArrayList of one result.
2)In the StaticLoclalise class add an instance of your new AbstractStaticLocaliserAlgorithm subclass to the 'algorithms' ArrayList in the constructor. ]
Hopefully users will add new compatible detections and localisation algorithms over time.
Modifier and Type | Field and Description |
---|---|
static int |
CONTROL_PANEL_PAUSED
The control panel has been paused or un-paused: This is only used in real time operation
|
boolean |
isViewer |
static int |
RUN_ALGORITHMS
Beginning to run the localisation algorithms.
|
static int |
SEL_DETECTION_CHANGED
The selected detection has changed.
|
static int |
SEL_DETECTION_CHANGED_BATCH
The selected detection has changed in batch processing mode.
|
static int |
SETTINGS_CHANGE |
static int |
START_REAL_TIME
The localiser has started in real time mode
|
static int |
STOP_REAL_TIME
The localiser has stopped in real time mode due to pamguard stopping.
|
static int |
TD_FINISHED_CALC
The time delay manager has finished calculating.
|
static int |
TD_PROGRESS_UPDATE
The time delay manager has a progress update on time dely calc.
|
static int |
TD_SEL_CHANGED
A different time delay has been selected
|
static int |
TD_START_CALC
The time delay manager has started calculated time delays
|
Constructor and Description |
---|
StaticLocaliserControl(java.lang.String unitName) |
Modifier and Type | Method and Description |
---|---|
boolean |
canLocalise(PamDetection pamDetection)
This is primarily used for batch analysis of data in offline mode or data in real time mode.
|
javax.swing.JMenu |
createDetectionMenu()
Creates a static localiser specific JMenu.
|
void |
dataBlockChanged()
Carries out tasks required if the dataBlock is changed.
|
void |
findDataBlocks()
Get only data blocks which satisfy the StaticLocaliserProvider, i.e.
|
AlarmCounterProvider |
getAlarmCounterProvider() |
PamDataBlock |
getCurrentDatablock() |
java.util.ArrayList<PamDataBlock> |
getCurrentDataBlocks() |
java.util.ArrayList<java.util.ArrayList<PamDataBlock>> |
getDataBlocks()
Returns just the single datablocks
|
java.util.ArrayList<java.util.ArrayList<PamDataBlock>> |
getDataBlocksAll()
Returns both the single and unsync dataBlocks
|
java.util.ArrayList<java.util.ArrayList<PamDataBlock>> |
getDataBlocksUnsync()
Returns just the unsynchronised dataBlocks;
|
java.awt.Frame |
getFrame() |
int[] |
getHydrophoneList()
Gets a list of hydrophones in the current selected datablock.
|
StaticLocaliserOfflineFunctions |
getOfflineFunctions()
get offline functions for static localiser.
|
StaticLocaliserParams |
getParams()
Get the parameters class for the static localiser
|
ResultsFilterManager |
getResultsFilter()
Get the results filter manager.
|
java.io.Serializable |
getSettingsReference() |
long |
getSettingsVersion() |
SLMapping |
getSlMapping()
Get the map manager.
|
StaticLocalise |
getStaticLocaliser()
Get the static localiser, contains localisation algorithms.
|
StaticLocaliserSQLLogging |
getStaticLocaliserSQLLogging() |
StaticLocalisationMainPanel |
getStaticMainPanel()
Get the main panel for the static localiser.
|
javax.swing.JMenuBar |
getTabSpecificMenuBar(java.awt.Frame parentFrame,
javax.swing.JMenuBar standardMenu,
PamGui pamGui)
Create a tab specific menu to go with this PamControlledUnit.
|
TDManager |
getTDManager()
Get the time delay manager.
|
java.lang.String |
getUnitType() |
int |
getVerboseLevel() |
void |
notifyModelChanged(int changeType)
General notification when the PAMGAURD model changes.
|
boolean |
restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) |
void |
run()
Begin the process of localisation but only localise one time delay possibility.
|
void |
runAll()
Begin the process of localisation process for one or more time delay possibilities.
|
void |
runBatch()
Run an automatic localisation, i.e.
|
void |
save(SLResult slResult)
Saves a static localisation result directly to the database.
|
void |
saveAll()
Saves either all the possible results from all the algorithms, or if showOnlyLowestChiValueDelay is selected in the main options panel saves only the result with the lowest chi value but for all algorithms.
|
void |
saveBest()
Saves only the the best result.
|
void |
setCurrentDatablock(PamDataBlock dataBlock) |
void |
setCurrentDataBlocks(java.util.ArrayList<PamDataBlock> currentDataBlocks) |
void |
setParams(StaticLocaliserParams newParams) |
StaticLocaliserSQLLogging |
setStaticLocaliserSQLLogging(StaticLocaliserSQLLogging staticLocaliserSQLLogging) |
void |
setStaticTDManager(TDManager staticTDManager)
Set the time delay manager for the static localiser.
|
void |
tdManagerThreadUpdate(int threadUpdate)
Notify panels of an update from the tdmanager thread.
|
addOfflineTaskGroup, addOtherRelatedMenuItems, addPamProcess, addRelatedMenuItems, addXMLParameter, addXMLParameter, addXMLParameter, addXMLParameter, canClose, canPlayViewerSound, createDetectionMenu, createDisplayMenu, createFileMenu, createHelpMenu, fillXMLElement, flushDataBlockBuffers, getFrameNumber, getGuiFrame, getModuleSummary, getNumOfflineTaskGroups, getNumPamProcesses, getOfflineTaskGroup, getPamController, getPamModuleInfo, getPamProcess, getPamView, getShortUnitType, getSidePanel, getTabClipCopier, getTabPanel, getToolbarComponent, getUnitName, gotoTab, isViewer, pamClose, pamHasStopped, pamToStart, playViewerSound, removePamProcess, removeUnit, rename, saveViewerData, setFrameNumber, setPamController, setPamModuleInfo, setPamView, setSidePanel, setTabPanel, setupControlledUnit, stopViewerSound, terminalPrint, terminalPrintln, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getUnitName
public static final int RUN_ALGORITHMS
public static final int TD_SEL_CHANGED
public static final int SEL_DETECTION_CHANGED
public static final int SEL_DETECTION_CHANGED_BATCH
public static final int SETTINGS_CHANGE
public static final int TD_START_CALC
public static final int TD_PROGRESS_UPDATE
public static final int TD_FINISHED_CALC
public static final int CONTROL_PANEL_PAUSED
public static final int START_REAL_TIME
public static final int STOP_REAL_TIME
public boolean isViewer
public javax.swing.JMenu createDetectionMenu()
public void save(SLResult slResult)
slResult-
- result to save.public void saveBest()
public void saveAll()
public javax.swing.JMenuBar getTabSpecificMenuBar(java.awt.Frame parentFrame, javax.swing.JMenuBar standardMenu, PamGui pamGui)
PamControlledUnit
Default is to throw back the standard menu to be used. This function should clone the standard menu and then modify the clone (usually by replacing the Display sub menu)
getTabSpecificMenuBar
in class PamControlledUnit
standardMenu
- the standard menu for the Pam GUI.public java.awt.Frame getFrame()
public void setCurrentDatablock(PamDataBlock dataBlock)
public PamDataBlock getCurrentDatablock()
public java.util.ArrayList<PamDataBlock> getCurrentDataBlocks()
public void setCurrentDataBlocks(java.util.ArrayList<PamDataBlock> currentDataBlocks)
public java.util.ArrayList<java.util.ArrayList<PamDataBlock>> getDataBlocksAll()
public java.util.ArrayList<java.util.ArrayList<PamDataBlock>> getDataBlocks()
public java.util.ArrayList<java.util.ArrayList<PamDataBlock>> getDataBlocksUnsync()
public void dataBlockChanged()
public StaticLocalisationMainPanel getStaticMainPanel()
public void findDataBlocks()
public void run()
public void runAll()
public void runBatch()
public void notifyModelChanged(int changeType)
PamControlledUnit
notifyModelChanged
in class PamControlledUnit
changeType
- type of changepublic StaticLocalise getStaticLocaliser()
public StaticLocaliserParams getParams()
public void setParams(StaticLocaliserParams newParams)
public StaticLocaliserOfflineFunctions getOfflineFunctions()
public TDManager getTDManager()
public void setStaticTDManager(TDManager staticTDManager)
staticTDManager
- - TDManager class or subclasspublic int[] getHydrophoneList()
public java.io.Serializable getSettingsReference()
getSettingsReference
in interface PamSettings
public long getSettingsVersion()
getSettingsVersion
in interface PamSettings
public java.lang.String getUnitType()
getUnitType
in interface PamSettings
getUnitType
in class PamControlledUnit
public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
restoreSettings
in interface PamSettings
public boolean canLocalise(PamDetection pamDetection)
public void tdManagerThreadUpdate(int threadUpdate)
threadUpdate
- - type of updatepublic StaticLocaliserSQLLogging getStaticLocaliserSQLLogging()
public StaticLocaliserSQLLogging setStaticLocaliserSQLLogging(StaticLocaliserSQLLogging staticLocaliserSQLLogging)
public ResultsFilterManager getResultsFilter()
public SLMapping getSlMapping()
public AlarmCounterProvider getAlarmCounterProvider()
public int getVerboseLevel()
getVerboseLevel
in class PamControlledUnit