Package clickDetector
Class ClickControl
java.lang.Object
PamController.PamControlledUnit
clickDetector.ClickControl
- All Implemented Interfaces:
 LocalisationAlgorithm,PamSettings,SettingsNameProvider
- Direct Known Subclasses:
 STClickControl
Main Controller for click detection.
 
ClickControl contains both the detector and the display panel. It also contains information on Detection and Display menus which will get added to the main PamGuard menu.
- Author:
 - Doug Gillespie
 
- 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AngleVetoesprotected ClickAlarmManagerprotected ClickControlprotected ClickDetectorprotected ClickTabPanelprotected ClickParametersprotected ClickSidePanelprotected ClickTrainDetectorprotected EchoDetectionSystemprotected JMenuprotected ClickTabPanelControlprotected TrackedClickLocaliserstatic final StringFields inherited from class PamController.PamControlledUnit
isMixed, isViewer - 
Constructor Summary
ConstructorsConstructorDescriptionClickControl(String name) Old style constructor which only gets a nameClickControl(PamConfiguration pamConfiguration, String name) New style constructor which get a configuraiton and a name. - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddOtherRelatedMenuItems(Frame parentFrame, JMenu menu, String name) voidbatchConvertClickDatabase(Frame parentFrame) booleancanClose()Called before Pamguard shuts down.booleanbooleanOpens the offline click dialog.protected voidclickedOnClick(ClickDetection click) createDetectionMenu(Frame parentFrame) Create a JMenu object containing MenuItems associated with PamProcessescreateDisplayMenu(Frame parentFrame) Create a JMenu object containing MenuItems associated with the viewvoiddeleteEvent(OfflineEventDataUnit event) Delete an offline event.voiddisplayActivated(ClickDisplay clickDisplay) voiddisplayTriggerHistogram(TriggerHistogram[] triggerHistogram) Returns the raw data blockGet the counting system for the click alarm.Get information about the localisation algorithm.Get the datablock containing click dataGet the click train detector.Get the click type master manager.Solve problems with all click data blocks being called the same thing if multiple click detectors are in the system.getGUI(int flag) Get the GUI for the PAMControlled unit.Get a module summary text string for shorthand output to anyting wanting a short summary of data state / numbers of detections.longgetTabSpecificMenuBar(Frame parentFrame, JMenuBar standardMenu, PamGui pamGui) Create a tab specific menu to go with this PamControlledUnit.Get something that can make LocalisationType objects of a form a bit bespoke to the type of localiser.intgetTrueChannelNumber(int iCh) voidgotoEvent(OfflineEventDataUnit event, int beforeTime) Scrolls the display to a specific event.booleanSpeedier way of knowing if it's viewer mode than going back to the controller every timeprotected voidnewRawData(PamObservable source, PamDataUnit data) voidnotifyModelChanged(int changeType) General notification when the PAMGAURD model changes.voidnotifyNewStorage(String storageName) voidCalled from clicksOffline when data have changed (eg from re doing click id).voidpamStart()voidpamStop()voidvoidStart playing sound in reponse to a call from the viewer top toolbar.voidreassignEventClicks(OfflineEventDataUnit clickEvent, OfflineEventDataUnit reassignEvent) Reassign all the clicks on one event to a different eventvoidremoveFromEvents(List<PamDataUnit> markedClicks) Remove clicks from existing events, if they have any.booleanCalled to remove a unit.booleanrestoreSettings(PamControlledUnitSettings pamControlledUnitSettings) voidsecondTimer(long sampleNumber) voidsetClassifierManager(ClickClassifierManager classifierManager) voidsetClickIdentifier(ClickIdentifier clickIdentifier) voidsetClickParameters(ClickParameters clickParameters) voidsetEchoDetectionSystem(EchoDetectionSystem echoDetectionSystem) voidsetLatestOfflineEvent(OfflineEventDataUnit latestOfflineEvent) voidcalled for all PamControlledUnits after all units have been created.voidshowOfflineEvents(Frame frame) Show a list of offline events.Methods inherited from class PamController.PamControlledUnit
addOfflineTaskGroup, addPamProcess, addPamProcess, addRelatedMenuItems, createFileMenu, createHelpMenu, flushDataBlockBuffers, getBackupInformation, getFrameNumber, getGuiFrame, getInstanceIndex, getModuleStatus, getModuleStatusManager, getModuleSummary, getNumOfflineTaskGroups, getNumPamProcesses, getOfflineState, getOfflineTaskGroup, getPamConfiguration, getPamController, getPamModuleInfo, getPamProcess, getPamView, getPlugin, getSidePanel, getTabClipCopier, getTabPanel, getToolbarComponent, getUnitName, getUnitTaskManager, getUnitTaskManager, getUnitType, getVerboseLevel, gotoTab, isInMainConfiguration, isNetRx, isViewer, pamClose, pamHasStopped, pamToStart, removePamProcess, rename, saveViewerData, setFrameNumber, setModuleStatusManager, setPamConfiguration, setPamController, setPamModuleInfo, setPamView, setSidePanel, setTabPanel, setToolbarComponent, setUnitTaskManager, stopViewerSound, tellModule, terminalPrint, terminalPrintln, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface PamController.PamSettings
getUnitTypeMethods inherited from interface PamController.SettingsNameProvider
getUnitName 
- 
Field Details
- 
clickDetector
 - 
clickTrainDetector
 - 
echoDetectionSystem
 - 
trackedClickLocaliser
 - 
tabPanelControl
 - 
clickParameters
 - 
rightMouseMenu
 - 
clickPanel
 - 
clickControl
 - 
clickSidePanel
 - 
angleVetoes
 - 
clickAlarmManager
 - 
UNITTYPE
- See Also:
 
 
 - 
 - 
Constructor Details
- 
ClickControl
Old style constructor which only gets a name- Parameters:
 name-
 - 
ClickControl
New style constructor which get a configuraiton and a name.- Parameters:
 pamConfiguration-name-
 
 - 
 - 
Method Details
- 
getClickTypeMasterManager
Get the click type master manager. This manages all possible click species type, including those of downstream processes.- Returns:
 - the clickTypeMasterManager
 
 - 
removeUnit
public boolean removeUnit()Description copied from class:PamControlledUnitCalled to remove a unit.- Overrides:
 removeUnitin classPamControlledUnit- Returns:
 - try (not used)
 
 - 
getClickDataBlock
Get the datablock containing click data- Returns:
 - Click data block
 
 - 
isViewerMode
public boolean isViewerMode()Speedier way of knowing if it's viewer mode than going back to the controller every time- Returns:
 
 - 
secondTimer
public void secondTimer(long sampleNumber)  - 
getTrueChannelNumber
public int getTrueChannelNumber(int iCh)  - 
displayTriggerHistogram
 - 
notifyNewStorage
 - 
createDetectionMenu
Description copied from class:PamControlledUnitCreate a JMenu object containing MenuItems associated with PamProcesses- Overrides:
 createDetectionMenuin classPamControlledUnit- Parameters:
 parentFrame- The owner frame of the menu- Returns:
 - reference to a JMenu which can be added to an existing menu or
         menu bar
         
Note that if multiple views are to use the same menu, then they should each create a new menu (by setting Create to true) the first time they call this method.
 
 - 
createDisplayMenu
Description copied from class:PamControlledUnitCreate a JMenu object containing MenuItems associated with the view- Overrides:
 createDisplayMenuin classPamControlledUnit- Returns:
 - reference to a JMenu which can be added to an existing menu or
         menu bar
         
Note that if multiple views are to use the same menu, then they should each create a new menu (by setting Create to true) the first time they call this method.
 
 - 
notifyModelChanged
public void notifyModelChanged(int changeType) Description copied from class:PamControlledUnitGeneral notification when the PAMGAURD model changes.- Overrides:
 notifyModelChangedin classPamControlledUnit- Parameters:
 changeType- type of change
 - 
classificationDialog
Opens the offline click dialog.- Parameters:
 pf- frame- Returns:
 - Returns true if settings have changed
 
 - 
batchConvertClickDatabase
 - 
getClickDetector
 - 
newRawData
 - 
pamStart
public void pamStart() - 
pamStop
public void pamStop() - 
canClose
public boolean canClose()Description copied from class:PamControlledUnitCalled before Pamguard shuts down. Rather than returning false, this function can be used as a final oportunity to save settings, write to the database, etc.- Overrides:
 canClosein classPamControlledUnit- Returns:
 - true if OK for Pamguard to shut down, false otherwise.
 
 - 
getSettingsVersion
public long getSettingsVersion()- Specified by:
 getSettingsVersionin interfacePamSettings- Returns:
 - An integer version number for the settings
 
 - 
getSettingsReference
- Specified by:
 getSettingsReferencein interfacePamSettings- Returns:
 - The serialisable object that will be stored
 
 - 
restoreSettings
- Specified by:
 restoreSettingsin interfacePamSettings- Parameters:
 pamControlledUnitSettings-- 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
 
 - 
getTabSpecificMenuBar
Description copied from class:PamControlledUnitCreate a tab specific menu to go with this 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)
- Overrides:
 getTabSpecificMenuBarin classPamControlledUnit- Parameters:
 standardMenu- the standard menu for the Pam GUI.- Returns:
 - a complete menu bar to be shown while a particular tab is selected
 
 - 
addOtherRelatedMenuItems
- Overrides:
 addOtherRelatedMenuItemsin classPamControlledUnit
 - 
clickedOnClick
 - 
setupControlledUnit
public void setupControlledUnit()Description copied from class:PamControlledUnitcalled for all PamControlledUnits after all units have been created. This is a good time for the controlled units and processes to find and check their source data and the configuration generally since most onjects (i.e. output data blocks) should be in place- Overrides:
 setupControlledUnitin classPamControlledUnit
 - 
getClickIdentifier
 - 
setClickIdentifier
 - 
setClassifierManager
- Parameters:
 classifierManager- the classifierManager to set
 - 
getClassifierManager
- Returns:
 - the classifierManager
 
 - 
getClickParameters
 - 
setClickParameters
 - 
offlineDataChanged
public void offlineDataChanged()Called from clicksOffline when data have changed (eg from re doing click id). Needs to notify the display and maybe some other classes. - 
getOfflineToolbar
 - 
getClicksOffline
- Returns:
 - the clicksOffline
 
 - 
getLatestOfflineEvent
- Returns:
 - the latestOfflineEvent
 
 - 
setLatestOfflineEvent
- Parameters:
 latestOfflineEvent- the latestOfflineEvent to set
 - 
showOfflineEvents
Show a list of offline events. Later on will add more functionality to it.- Parameters:
 frame-
 - 
gotoEvent
Scrolls the display to a specific event.- Parameters:
 event- event to scroll tobeforeTime-
 - 
deleteEvent
Delete an offline event. Un-assign all clicks and delete from datablock, ready for deletion from database.- Parameters:
 event- event to delete.
 - 
canPlayViewerSound
public boolean canPlayViewerSound()- Overrides:
 canPlayViewerSoundin classPamControlledUnit- Returns:
 - true if this module can play sound in response to a play command from the top toolbar.
 
 - 
playViewerSound
public void playViewerSound()Description copied from class:PamControlledUnitStart playing sound in reponse to a call from the viewer top toolbar.- Overrides:
 playViewerSoundin classPamControlledUnit
 - 
playClicks
public void playClicks() - 
getEchoDetectionSystem
- Returns:
 - the echoDetectionSystem
 
 - 
setEchoDetectionSystem
- Parameters:
 echoDetectionSystem- the echoDetectionSystem to set
 - 
displayActivated
 - 
getDisplayManager
 - 
getDataBlockPrefix
Solve problems with all click data blocks being called the same thing if multiple click detectors are in the system.- Returns:
 - a name, defaulting to "" if it's the first created click detector.
 
 - 
getModuleSummary
Description copied from class:PamControlledUnitGet a module summary text string for shorthand output to anyting wanting a short summary of data state / numbers of detections.
You should not override this version of the function, but instead override getModuleSummary(boolean clear) which allows for optional clearing of summary data.- Overrides:
 getModuleSummaryin classPamControlledUnit- Returns:
 - module summary string - goings on since the last call to this function
 
 - 
getShortUnitType
- Overrides:
 getShortUnitTypein classPamControlledUnit- Returns:
 - a shortened version of the unit type for use in module summary strings.
 
 - 
getAlarmCounterProvider
Get the counting system for the click alarm.- Parameters:
 alarmControl-- Returns:
 
 - 
getTargetMotionLocaliser
 - 
removeFromEvents
Remove clicks from existing events, if they have any. They may not. This is called whenever clicks are assigned to a new event to make sure that they don't end up in two events.- Parameters:
 markedClicks-
 - 
reassignEventClicks
public void reassignEventClicks(OfflineEventDataUnit clickEvent, OfflineEventDataUnit reassignEvent) Reassign all the clicks on one event to a different event- Parameters:
 clickEvent- event to take the clicks fromreassignEvent- event to add the clicks to.
 - 
findRawDataBlock
Returns the raw data block- Returns:
 
 - 
getClickTrainDetector
Get the click train detector.- Returns:
 - the clickTrainDetector
 
 - 
getGUI
Get the GUI for the PAMControlled unit. This has multiple GUI options which are instantiated depending on the view type.- Overrides:
 getGUIin classPamControlledUnit- Parameters:
 flag- . The GUI type flag defined in PAMGuiManager.- Returns:
 - the GUI for the PamControlledUnit unit.
 
 - 
getFFTDataOrganiser
- Returns:
 - a master data organiser.
 
 - 
getAlgorithmInfo
Description copied from interface:LocalisationAlgorithmGet information about the localisation algorithm.- Specified by:
 getAlgorithmInfoin interfaceLocalisationAlgorithm- Returns:
 - algorithm information.
 
 - 
getTethysCreator
Description copied from interface:LocalisationAlgorithmGet something that can make LocalisationType objects of a form a bit bespoke to the type of localiser. This may be better than having the standard functions in LocalizationBuilder guess what's best.- Specified by:
 getTethysCreatorin interfaceLocalisationAlgorithm- Returns:
 - can be null in which case standard functions will do the best they can.
 
 
 -