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
-
Constructor Summary
ConstructorDescriptionClickControl
(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 TypeMethodDescriptionvoid
addOtherRelatedMenuItems
(Frame parentFrame, JMenu menu, String name) void
batchConvertClickDatabase
(Frame parentFrame) boolean
canClose()
Called before Pamguard shuts down.boolean
boolean
Opens the offline click dialog.createDetectionMenu
(Frame parentFrame) Create a JMenu object containing MenuItems associated with PamProcessescreateDisplayMenu
(Frame parentFrame) Create a JMenu object containing MenuItems associated with the viewvoid
deleteEvent
(OfflineEventDataUnit event) Delete an offline event.void
displayActivated
(ClickDisplay clickDisplay) void
displayTriggerHistogram
(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.long
getTabSpecificMenuBar
(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.int
getTrueChannelNumber
(int iCh) void
gotoEvent
(OfflineEventDataUnit event, int beforeTime) Scrolls the display to a specific event.boolean
Speedier way of knowing if it's viewer mode than going back to the controller every timevoid
notifyModelChanged
(int changeType) General notification when the PAMGAURD model changes.void
notifyNewStorage
(String storageName) void
Called from clicksOffline when data have changed (eg from re doing click id).void
pamStart()
void
pamStop()
void
void
Start playing sound in reponse to a call from the viewer top toolbar.void
reassignEventClicks
(OfflineEventDataUnit clickEvent, OfflineEventDataUnit reassignEvent) Reassign all the clicks on one event to a different eventvoid
removeFromEvents
(List<PamDataUnit> markedClicks) Remove clicks from existing events, if they have any.boolean
Called to remove a unit.boolean
restoreSettings
(PamControlledUnitSettings pamControlledUnitSettings) void
secondTimer
(long sampleNumber) void
setClassifierManager
(ClickClassifierManager classifierManager) void
setClickIdentifier
(ClickIdentifier clickIdentifier) void
setClickParameters
(ClickParameters clickParameters) void
setEchoDetectionSystem
(EchoDetectionSystem echoDetectionSystem) void
setLatestOfflineEvent
(OfflineEventDataUnit latestOfflineEvent) void
called for all PamControlledUnits after all units have been created.void
showOfflineEvents
(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, getUnitType, getVerboseLevel, gotoTab, isInMainConfiguration, isNetRx, isViewer, pamClose, pamHasStopped, pamToStart, removePamProcess, rename, saveViewerData, setFrameNumber, setModuleStatusManager, setPamConfiguration, setPamController, setPamModuleInfo, setPamView, setSidePanel, setTabPanel, setToolbarComponent, stopViewerSound, tellModule, terminalPrint, terminalPrintln, toString
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface PamController.PamSettings
getUnitType
Methods inherited from interface PamController.SettingsNameProvider
getUnitName
-
Field Details
-
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:PamControlledUnit
Called to remove a unit.- Overrides:
removeUnit
in 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:PamControlledUnit
Create a JMenu object containing MenuItems associated with PamProcesses- Overrides:
createDetectionMenu
in 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:PamControlledUnit
Create a JMenu object containing MenuItems associated with the view- Overrides:
createDisplayMenu
in 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:PamControlledUnit
General notification when the PAMGAURD model changes.- Overrides:
notifyModelChanged
in classPamControlledUnit
- Parameters:
changeType
- type of change
-
classificationDialog
Opens the offline click dialog.- Parameters:
pf
- frame- Returns:
- Returns true if settings have changed
-
batchConvertClickDatabase
-
getClickDetector
-
pamStart
public void pamStart() -
pamStop
public void pamStop() -
canClose
public boolean canClose()Description copied from class:PamControlledUnit
Called 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:
canClose
in classPamControlledUnit
- Returns:
- true if OK for Pamguard to shut down, false otherwise.
-
getSettingsVersion
public long getSettingsVersion()- Specified by:
getSettingsVersion
in interfacePamSettings
- Returns:
- An integer version number for the settings
-
getSettingsReference
- Specified by:
getSettingsReference
in interfacePamSettings
- Returns:
- The serialisable object that will be stored
-
restoreSettings
- Specified by:
restoreSettings
in interfacePamSettings
- 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:PamControlledUnit
Create 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:
getTabSpecificMenuBar
in 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:
addOtherRelatedMenuItems
in classPamControlledUnit
-
setupControlledUnit
public void setupControlledUnit()Description copied from class:PamControlledUnit
called 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:
setupControlledUnit
in 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:
canPlayViewerSound
in 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:PamControlledUnit
Start playing sound in reponse to a call from the viewer top toolbar.- Overrides:
playViewerSound
in 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:PamControlledUnit
Get 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:
getModuleSummary
in classPamControlledUnit
- Returns:
- module summary string - goings on since the last call to this function
-
getShortUnitType
- Overrides:
getShortUnitType
in 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:
getGUI
in 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:LocalisationAlgorithm
Get information about the localisation algorithm.- Specified by:
getAlgorithmInfo
in interfaceLocalisationAlgorithm
- Returns:
- algorithm information.
-
getTethysCreator
Description copied from interface:LocalisationAlgorithm
Get 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:
getTethysCreator
in interfaceLocalisationAlgorithm
- Returns:
- can be null in which case standard functions will do the best they can.
-