Class PamController
- All Implemented Interfaces:
PamControllerInterface
,PamSettings
,SettingsNameProvider
- Author:
- Doug Gillespie
Main Pam Controller class which will communicate with the PamModelInterface and with the PamViewInterface
PamController contains a list of PamControlledUnit's each of which has it's own process, simpleMapRef.gpsTextPanel.setPixelsPerMetre(getPixelsPerMetre()); input and output data and display (Tab Panel, Menus, etc.)
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final int
static final int
static double
The java version being run.static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
PamGuard view params.static final int
static final int
static final int
static final int
static final int
static final int
static final String
Never changed.static final String
Fields inherited from interface PamController.PamControllerInterface
ADD_CONTROLLEDUNIT, ADD_DATABLOCK, ADD_PROCESS, CHANGED_DISPLAY_SETTINGS, CHANGED_MULTI_THREADING, CHANGED_OFFLINE_DATASTORE, CHANGED_PROCESS_SETTINGS, DATA_LOAD_COMPLETE, DESTROY_EVERYTHING, EXTERNAL_DATA_IMPORTED, GLOBAL_MEDIUM_UPDATE, GLOBAL_TIME_UPDATE, HYDROPHONE_ARRAY_CHANGED, INITIALIZATION_COMPLETE, INITIALIZE_LOADDATA, MASTER_REFERENCE_CHANGED, NEW_SCROLL_TIME, OFFLINE_DATA_LOADED, OFFLINE_PROCESS_COMPLETE, READY_TO_RUN, REMOVE_CONTROLLEDUNIT, REMOVE_DATABLOCK, REMOVE_PROCESS, RENAME_CONTROLLED_UNIT, REORDER_CONTROLLEDUNITS
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addControlledUnit
(PamControlledUnit controlledUnit) Adds a PamControlledUnit to the controller.addModule
(Frame parentFrame, PamModuleInfo moduleInfo) Add a new PamControlledUnitaddModule
(PamModuleInfo moduleInfo, String moduleName) Add a module to the controller.void
addView
(PamViewInterface newView) Adds a new view to the systemvoid
boolean
canClose()
Can PAMGUARD shut down.static boolean
Check if PAMGuard is being controlled through the networkvoid
Clears the variable holding info about the unit currently being loadedboolean
continueStart
(boolean saveSettings, long startTime) Second half of the start process.static void
create
(int runMode) Create an instance of the PAMController.static void
Create an instance of the PAMcController.void
Create the datamap from the databasevoid
Create a watchdog which will run independently and keep this thing going !void
void
Called from PamDialog whenever the OK button is pressed.void
dumpBufferStatus
(String message, boolean sayEmpties) Look in every data block, particularly threaded ones, and dump the buffer status.void
enableGUIControl
(boolean enable) Enables / Disables GUI for input.void
exportData
(JFrame parentFrame) Show export options tp export data to other formatsvoid
exportGeneralXMLSettings
(JFrame parentFrame, long timeMillis) Export configuration into an XML filevoid
exportSettingsAsXML
(PamSettingsGroup settingsGroup) Load settings for all modules in this group, then export as XML.Find the path to the binary store ....findControlledUnit
(Class unitClass, String unitName) Find the first instance of a module with a given class type and name.findControlledUnit
(String unitType) Finds a PamControlledUnit of a given type but with any namefindControlledUnit
(String unitType, String unitName) Finds a PamControlledUnit of a given type and namefindControlledUnits
(Class unitClass) Get an Array list of PamControlledUnits of a particular class (exact matches only).findControlledUnits
(Class unitClass, boolean includeSubClasses) Get an Array list of PamControlledUnits of a particular class (exact matches only).findControlledUnits
(String unitType) Get a list of PamControlledUnit units of a given typefindControlledUnits
(String unitType, String unitName) Get a list of PamControlledUnit units of a given type and name, allowing for nulls.findOfflineDataStore
(Class sourceClass) getControlledUnit
(int iUnit) Returns a reference to a PamControlledUnit within the COntrollergetDataBlock
(Class blockType, int id) Find a block of a given type with the id number, or null if the number is out of range.getDataBlock
(Class blockType, String name) Find a block of a given type with the given name, or null if it doesn't exist.getDataBlockByLongName
(String longName) Find a block with the given long name, or null if it doesn't exist.getDataBlocks
(Class blockType, boolean includeSubClasses) Returns an ArrayList of PamDataBlocks from all PamProcesses in all PamControlledUnits that contain data of a specific type.getDetectorDataBlock
(int id) Gets a specific data block from the list, or null.getDetectorDataBlock
(String name) Gets a specific data block from the list, or null.getDetectorEventDataBlock
(int id) getFFTDataBlock
(int id) Gets a specific data block from the list, or null.getFFTDataBlock
(String name) Gets a specific data block from the list, or null.Get the global medium manager.Get the GUI Frame manager.Deprecated.Returns the current installation folder, or null if there was a problem determining the folder location.static PamController
double
Get the Java compliance, i.e.static Frame
Get the main frame if there is one.static javafx.stage.Stage
Gets a reference to the PamModel (where all the data are stored and the algorithms are running)int
Gets the total number of PamControlledUnitsGt the main PAMGuard configuration (list of connected modules).int
returns the status of Pamguard.getPlottableDataBlocks
(GeneralProjector generalProjector) Get the name of the psf or database used to contain settings for this run.Get the name of the psf or database used to contain settings for this run.getRawDataBlock
(int id) Gets a specific data block from the list, or null.getRawDataBlock
(String name) Gets a specific data block from the list, or null.int
This was within the StatusCommand class, but useful to have it here since it's needed in more than one place.int
Gets the Pamguard running mode.long
Returns the module that is currently being loaded.int
Return a verbose level for debug outputboolean
isControlledUnit
(String controlName) Check whether a controlled unit exists based on it's name.boolean
boolean
void
loadOldSettings
(PamSettingsGroup settingsGroup) Called to load a specific set of PAMGUARD settings in viewer mode, which were previously loaded in from a database or binary store.void
loadOldSettings
(PamSettingsGroup settingsGroup, boolean initialiseNow) Called to load a specific set of PAMGUARD settings in viewer mode, which were previously loaded in from a database or binary store.boolean
Called from the start button.void
Called from the stop button.boolean
modelSettings
(JFrame frame) Menu command to open dialog to adjust model settingsboolean
moduleChange
(int changeType) Has there been a module change AFTER initial module loading.void
netReceiveStatus
(long timeMilliseconds, int nPrepared, int nStarted, int nStopped) Called when the number of Networked remote stations changes so that the receiver can make a decision as to what to do in terms of preparing detectors, opening files, etc.void
notifyModelChanged
(int changeType) Tell the controller that the model may have changed (i.e.void
notifyTaskProgress
(PamTaskUpdate progress) Notify the PamController that progress has been made in loading something.boolean
orderModules
(Frame parentFrame) Take actions to alow the user to change the order modules apear in.void
pamClose()
Called after canClose has returned true to finally tell all modules that PAMGUARD is definitely closing down.so they can free any resources, etc.void
pamEnded()
Sent from the model when Pam ends - this can happen when a file finishes or after Pam ends following a PamStop command sent by the controllerboolean
pamStart()
Start PAMGUARD.boolean
pamStart
(boolean saveSettings) Start PAMGuard with an option on saving settings.boolean
pamStart
(boolean saveSettings, long startTime) Starts PAMGuard, but with the option to save settings (to binary and to database) and also to give a specific start time for the session.void
Notification received from the model that data collection has started.void
pamStop()
Stopping PAMGUARD.void
removeControlledUnt
(PamControlledUnit controlledUnit) Removes a PamControlledUnit from the controllervoid
Restart PAMguard.boolean
restoreSettings
(PamControlledUnitSettings pamControlledUnitSettings) void
Go through all data blocks in all modules and tell them to save.void
setInstallFolder
(String installFolder) Set the install folder.void
setManualStop
(boolean manualStop) void
setPamStatus
(int pamStatus) void
void
Setup the PAMController.void
void
Shut down Pamguardvoid
void
calls pamStart using the SwingUtilities invokeLater command to start PAMGAURD later in the AWT event queue.void
startLater
(boolean saveSettings) void
calls pamStop using the SwingUtilities invokeLater command to stop PAMGAURD later in the AWT event queue.void
storageOptions
(JFrame parentFrame) invalid input: '<'invalid input: '<'invalid input: '<'invalid input: '<'invalid input: '<'invalid input: '<'invalid input: '<' Updated upstream Respond to storage options dialog.void
toolBarStartButton
(PamControlledUnit currentControlledUnit) void
toolBarStopButton
(PamControlledUnit currentControlledUnit) void
Do a total rebuild of the Pam model based on the contents of the set settings file.void
Updates the entire datamap.void
updateMasterClock
(long timeInMillis) Gets called on a timer when NOT processing from files.
-
Field Details
-
PAM_IDLE
public static final int PAM_IDLE- See Also:
-
PAM_RUNNING
public static final int PAM_RUNNING- See Also:
-
PAM_STALLED
public static final int PAM_STALLED- See Also:
-
PAM_INITIALISING
public static final int PAM_INITIALISING- See Also:
-
PAM_STOPPING
public static final int PAM_STOPPING- See Also:
-
PAM_COMPLETE
public static final int PAM_COMPLETE- See Also:
-
PAM_MAPMAKING
public static final int PAM_MAPMAKING- See Also:
-
PAM_OFFLINETASK
public static final int PAM_OFFLINETASK- See Also:
-
BUTTON_START
public static final int BUTTON_START- See Also:
-
BUTTON_STOP
public static final int BUTTON_STOP- See Also:
-
PAM_LOADINGDATA
public static final int PAM_LOADINGDATA- See Also:
-
RUN_NORMAL
public static final int RUN_NORMAL- See Also:
-
RUN_PAMVIEW
public static final int RUN_PAMVIEW- See Also:
-
RUN_MIXEDMODE
public static final int RUN_MIXEDMODE- See Also:
-
RUN_REMOTE
public static final int RUN_REMOTE- See Also:
-
RUN_NOTHING
public static final int RUN_NOTHING- See Also:
-
RUN_NETWORKRECEIVER
public static final int RUN_NETWORKRECEIVER- See Also:
-
AUTOSTART
- See Also:
-
AUTOEXIT
- See Also:
-
unitName
Never changed. Needed to identify settings for list of modules in prfx files.- See Also:
-
unitType
- See Also:
-
pamViewParameters
PamGuard view params. -
JAVA_VERSION
public static double JAVA_VERSIONThe java version being run. e.g. Java 8u111 will be 8.111;
-
-
Method Details
-
create
public static void create(int runMode) Create an instance of the PAMController.- Parameters:
runMode
- - the run mode
-
create
Create an instance of the PAMcController.- Parameters:
runMode
- - the run modeobject
- - extra information. Can be null.
-
setupPamguard
public void setupPamguard()Setup the PAMController. -
netReceiveStatus
public void netReceiveStatus(long timeMilliseconds, int nPrepared, int nStarted, int nStopped) Called when the number of Networked remote stations changes so that the receiver can make a decision as to what to do in terms of preparing detectors, opening files, etc.- Parameters:
timeMilliseconds
-nPrepared
- number of remote stations currently prepared (called just before start)nStarted
- number of remote stations currently startednStopped
- number of remote stations currently stopped
-
canClose
public boolean canClose()Can PAMGUARD shut down. This question is asked in turn to every module. Each module should attempt to make sure it can answer true, e.g. by closing files, but if any module returns false, then canClose() will return false;- Returns:
- whether it's possible to close PAMGUARD without corrupting or losing data.
-
pamClose
public void pamClose()Called after canClose has returned true to finally tell all modules that PAMGUARD is definitely closing down.so they can free any resources, etc.- Specified by:
pamClose
in interfacePamControllerInterface
-
shutDownPamguard
public void shutDownPamguard()Shut down Pamguard -
saveViewerData
public void saveViewerData()Go through all data blocks in all modules and tell them to save. This has been built into PamProcess and PamDataBlock since we want it to be easy to override this for specific modules / processes / data blocks. -
addControlledUnit
Description copied from interface:PamControllerInterface
Adds a PamControlledUnit to the controller.- Specified by:
addControlledUnit
in interfacePamControllerInterface
- Parameters:
controlledUnit
- - Reference to a PamcontrolledUnit
-
addModule
Description copied from interface:PamControllerInterface
Add a new PamControlledUnit- Specified by:
addModule
in interfacePamControllerInterface
- Parameters:
moduleInfo
- Information about the PamControlled unit to add- Returns:
- true if created sucessfully
-
addModule
Add a module to the controller.- Parameters:
moduleInfo
- - the module info i.e. the type of module to addmoduleName
- - the module name.- Returns:
-
removeControlledUnt
Description copied from interface:PamControllerInterface
Removes a PamControlledUnit from the controller- Specified by:
removeControlledUnt
in interfacePamControllerInterface
-
orderModules
Description copied from interface:PamControllerInterface
Take actions to alow the user to change the order modules apear in.- Specified by:
orderModules
in interfacePamControllerInterface
-
getControlledUnit
Description copied from interface:PamControllerInterface
Returns a reference to a PamControlledUnit within the COntroller- Specified by:
getControlledUnit
in interfacePamControllerInterface
- Parameters:
iUnit
- Index of the unit- Returns:
- reference to a PamControlledUnit
-
findControlledUnit
Description copied from interface:PamControllerInterface
Finds a PamControlledUnit of a given type but with any name- Specified by:
findControlledUnit
in interfacePamControllerInterface
- Parameters:
unitType
- Type of PamControlledUnit- Returns:
- reference to PamControlledUnit
-
findControlledUnits
Get a list of PamControlledUnit units of a given type- Parameters:
unitType
- Controlled unit type- Returns:
- list of units.
-
findControlledUnits
Get a list of PamControlledUnit units of a given type and name, allowing for nulls.- Parameters:
unitType
- Controlled unit type, can be null for all units of nameunitName
- Controlled unit name, can be null for all units of type- Returns:
- list of units.
-
findControlledUnit
Description copied from interface:PamControllerInterface
Finds a PamControlledUnit of a given type and name- Specified by:
findControlledUnit
in interfacePamControllerInterface
- Parameters:
unitType
- Type of PamControlledUnitunitName
- Name of PamControlledUnit- Returns:
- reference to PamControlledUnit
-
findControlledUnit
Find the first instance of a module with a given class type and name.Name can be null in which case the first module with the correct class will be returned
- Parameters:
unitClass
- Module class (sub class of PamControlledUnit)unitName
- Module Name- Returns:
- Existing module with that class and name.
-
findControlledUnits
Get an Array list of PamControlledUnits of a particular class (exact matches only).- Parameters:
unitClass
- PamControlledUnit class- Returns:
- List of current instances of this class.
-
findControlledUnits
Get an Array list of PamControlledUnits of a particular class (exact matches only).- Parameters:
unitClass
- PamControlledUnit class- Returns:
- List of current instances of this class.
-
isControlledUnit
Check whether a controlled unit exists based on it's name.- Parameters:
the
- controlled unit name e.g. "my crazy click detector", not the default name.
-
getNumControlledUnits
public int getNumControlledUnits()Description copied from interface:PamControllerInterface
Gets the total number of PamControlledUnits- Specified by:
getNumControlledUnits
in interfacePamControllerInterface
- Returns:
- the number of PamControlledUnits
-
getInstance
-
getModelInterface
Description copied from interface:PamControllerInterface
Gets a reference to the PamModel (where all the data are stored and the algorithms are running)- Specified by:
getModelInterface
in interfacePamControllerInterface
- Returns:
- Reference to the PamGuard model
-
addView
Description copied from interface:PamControllerInterface
Adds a new view to the system- Specified by:
addView
in interfacePamControllerInterface
-
showControlledUnit
-
restartPamguard
public void restartPamguard()Restart PAMguard. Can be called when something is mildly wrong such as a DAQ glitch, so that acquisition is stopped and restarted. -
startLater
public void startLater()calls pamStart using the SwingUtilities invokeLater command to start PAMGAURD later in the AWT event queue. -
startLater
public void startLater(boolean saveSettings) -
stopLater
public void stopLater()calls pamStop using the SwingUtilities invokeLater command to stop PAMGAURD later in the AWT event queue. -
manualStart
public boolean manualStart()Called from the start button. A little book keeping to distinguish this from automatic starts / restarts- Specified by:
manualStart
in interfacePamControllerInterface
- Returns:
- true if started.
-
manualStop
public void manualStop()Called from the stop button. A little book keeping to distinguish this from automatic starts / restarts- Specified by:
manualStop
in interfacePamControllerInterface
-
pamStart
public boolean pamStart()Start PAMGUARD. This function also gets called from the GUI menu start button and from the Network control system.As well as actually starting PAMGUARD it will write settings to the database and to the binary data store.
- Specified by:
pamStart
in interfacePamControllerInterface
- Returns:
- true if all modules start successfully
-
pamStart
public boolean pamStart(boolean saveSettings) Start PAMGuard with an option on saving settings.- Parameters:
saveSettings
- flag to save settings to database and binary store- Returns:
- true if all modules start successfully
-
pamStart
public boolean pamStart(boolean saveSettings, long startTime) Starts PAMGuard, but with the option to save settings (to binary and to database) and also to give a specific start time for the session. When data are being received over the network, this may be in the past !- Parameters:
saveSettings
- flag to say whether or not settings should be saved.startTime
- start time in millis- Returns:
- true if all modules start successfully
-
continueStart
public boolean continueStart(boolean saveSettings, long startTime) Second half of the start process. This was originally in pamStart, but had to be split out, so that the reprocessManager checks can run in a separate thread in order to display a progress bar as files are catalogued.- Parameters:
saveSettings
-startTime
-- Returns:
-
pamStop
public void pamStop()Stopping PAMGUARD. Harder than you might think ! First a pamStop() is sent to all processes, then once that's done, a pamHasStopped is sent to all Controllers.This is necessary when running in a multi-thread mode since some processes may still be receiving data and may still pass if on to other downstream processes, storage, etc.
- Specified by:
pamStop
in interfacePamControllerInterface
-
dumpBufferStatus
Look in every data block, particularly threaded ones, and dump the buffer status. This will have to go via PamProcess so that additional information can be added from any processes that hold additional data in other internal buffers.- Parameters:
message
- Message to print prior to dumping buffers for debug.sayEmpties
- dump info even if a buffer is empty (otherwise, only ones that have stuff still)
-
batchProcessingComplete
public void batchProcessingComplete() -
exportGeneralXMLSettings
Export configuration into an XML file- Parameters:
parentFrame
-timeMillis
- time stamp that will get added to file name and content.
-
findBinaryStorePath
Find the path to the binary store ....- Returns:
- path to the binary store.
-
findSettingsSources
- Returns:
- a list of PamControlledUnits which implements the PamSettingsSource interface
- See Also:
-
modelSettings
Description copied from interface:PamControllerInterface
Menu command to open dialog to adjust model settings- Specified by:
modelSettings
in interfacePamControllerInterface
- Returns:
- true if dialog returned Ok.
-
pamStarted
public void pamStarted()Description copied from interface:PamControllerInterface
Notification received from the model that data collection has started.- Specified by:
pamStarted
in interfacePamControllerInterface
-
pamEnded
public void pamEnded()Description copied from interface:PamControllerInterface
Sent from the model when Pam ends - this can happen when a file finishes or after Pam ends following a PamStop command sent by the controller- Specified by:
pamEnded
in interfacePamControllerInterface
-
getFFTDataBlocks
- Specified by:
getFFTDataBlocks
in interfacePamControllerInterface
- Returns:
- List of PamDataBlocks in all PamProcesses in all PamControlledUnits that contain FFT data.
-
getFFTDataBlock
Description copied from interface:PamControllerInterface
Gets a specific data block from the list, or null.- Specified by:
getFFTDataBlock
in interfacePamControllerInterface
- Returns:
- an FFT data block at index id within Pamguards list of FFT type data blocks
-
getFFTDataBlock
Description copied from interface:PamControllerInterface
Gets a specific data block from the list, or null.- Specified by:
getFFTDataBlock
in interfacePamControllerInterface
- Returns:
- the first FFT data block at with the given name within Pamguards list of FFT type data blocks
-
getRawDataBlocks
- Specified by:
getRawDataBlocks
in interfacePamControllerInterface
- Returns:
- List of PamDataBlocks in all PamProcesses in all PamControlledUnits that contain raw audio data.
-
getRawDataBlock
Description copied from interface:PamControllerInterface
Gets a specific data block from the list, or null.- Specified by:
getRawDataBlock
in interfacePamControllerInterface
- Returns:
- a raw data block at index id within Pamguards list of RAW type data blocks
-
getRawDataBlock
Description copied from interface:PamControllerInterface
Gets a specific data block from the list, or null.- Specified by:
getRawDataBlock
in interfacePamControllerInterface
- Returns:
- the first raw data block at with the given name within Pamguards list of RAW type data blocks
-
getDetectorDataBlocks
- Specified by:
getDetectorDataBlocks
in interfacePamControllerInterface
- Returns:
- List of PamDataBlocks in all PamProcesses in all PamControlledUnits that contain detector output data.
-
getDetectorDataBlock
Description copied from interface:PamControllerInterface
Gets a specific data block from the list, or null.- Specified by:
getDetectorDataBlock
in interfacePamControllerInterface
- Returns:
- PamDataBlock -- a detector data block at index id within Pamguard's list of RAW type data blocks.
-
getDetectorDataBlock
Description copied from interface:PamControllerInterface
Gets a specific data block from the list, or null.- Specified by:
getDetectorDataBlock
in interfacePamControllerInterface
- Returns:
- PamDataBlock -- the first detector data block with the given name within Pamguard's list of DETECTOR type data blocks.
-
getDetectorEventDataBlocks
- Specified by:
getDetectorEventDataBlocks
in interfacePamControllerInterface
- Returns:
- List of PamDataBlocks in all PamProcesses in all PamControlledUnits that contain data of a specific type.
-
getDetectorEventDataBlock
- Specified by:
getDetectorEventDataBlock
in interfacePamControllerInterface
-
getDetectorEventDataBlock
- Specified by:
getDetectorEventDataBlock
in interfacePamControllerInterface
-
getDataBlocks
Description copied from interface:PamControllerInterface
Returns an ArrayList of PamDataBlocks from all PamProcesses in all PamControlledUnits that contain data of a specific type. In order to return a list of PamDataBlocks that contain objects implementing a certain interface (such as AcousticDataUnit or PamDetection), the includeSubClasses boolean must be TRUE- Specified by:
getDataBlocks
in interfacePamControllerInterface
- Parameters:
blockType
- DataType of PamDatablockincludeSubClasses
- whether or not to include classes that extend/implement the blockType parameter.- Returns:
- List of PamDataBlocks in all PamProcesses in all PamControlledUnits that contain data of a specific type.
-
getDataBlocks
- Specified by:
getDataBlocks
in interfacePamControllerInterface
- Returns:
- All data blocks
-
getPlottableDataBlocks
-
getDataBlock
Find a block of a given type with the id number, or null if the number is out of range.- Specified by:
getDataBlock
in interfacePamControllerInterface
- Parameters:
blockType
-id
- -- the block id number- Returns:
- block, which you may want to cast to a subtype
-
getDataBlock
Find a block of a given type with the given name, or null if it doesn't exist.- Specified by:
getDataBlock
in interfacePamControllerInterface
- Parameters:
blockType
- -- RAW, FFT, DETECTOR, null, etc.name
- -- the block name- Returns:
- block, which you may want to cast to a subtype
-
getDataBlockByLongName
Find a block with the given long name, or null if it doesn't exist.- Parameters:
longName
- the long name of the PamDataBlock- Returns:
- block
-
findOfflineDataStores
- Returns:
- a list of offline data sources.
-
findOfflineDataStore
-
updateDataMap
public void updateDataMap()Updates the entire datamap. -
createDataMap
public void createDataMap()Create the datamap from the database -
notifyModelChanged
public void notifyModelChanged(int changeType) Description copied from interface:PamControllerInterface
Tell the controller that the model may have changed (i.e. a process connection changed, or a process added, etc.) This will be passes on to the view and used by the controller as necessary.- Specified by:
notifyModelChanged
in interfacePamControllerInterface
- See Also:
-
-
invalid @see
values are
- CHANGED_PROCESS_SETTINGS
- ADD_PROCESS
- REMOVE_PROCESS
- ADD_DATABLOCK
- REMOVE_DATABLOCK
- ADD_CONTROLLEDUNIT
- REMOVE_CONTROLLEDUNIT
- REORDER_CONTROLLEDUNITS
- INITIALIZATION_COMPLETE
- DESTROY_EVERYTHING
- RENAME_CONTROLLED_UNIT
- NEW_VIEW_TIMES
- NEW_VIEW_TIME
- CHANGED_DISPLAY_SETTINGS
- CHANGED_MULTI_THREADING
- HYDROPHONE_ARRAY_CHANGED
- EXTERNAL_DATA_LOADED
-
-
moduleChange
public boolean moduleChange(int changeType) Has there been a module change AFTER initial module loading.- Parameters:
changeType
-- Returns:
- true if modules added or removed after initialisation complete
-
setupGarbageCollector
public void setupGarbageCollector() -
getSettingsReference
- Specified by:
getSettingsReference
in interfacePamSettings
- Returns:
- The serialisable object that will be stored
-
getSettingsVersion
public long getSettingsVersion()- Specified by:
getSettingsVersion
in interfacePamSettings
- Returns:
- An integer version number for the settings
-
getUnitName
- Specified by:
getUnitName
in interfaceSettingsNameProvider
- Returns:
- A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
-
getUnitType
- Specified by:
getUnitType
in interfacePamSettings
- Returns:
- A Name specific to the type, e.g. Click detector
-
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
-
destroyModel
public void destroyModel() -
totalModelRebuild
public void totalModelRebuild()Description copied from interface:PamControllerInterface
Do a total rebuild of the Pam model based on the contents of the set settings file.- Specified by:
totalModelRebuild
in interfacePamControllerInterface
-
getPamStatus
public int getPamStatus()returns the status of Pamguard. The available status' will depend on the run mode. For instance, if run mode is RUN_NORMAL then status can be either PAM_IDLE or PAM_RUNNING.- Returns:
- Pamguard status
-
setPamStatus
public void setPamStatus(int pamStatus) -
getRealStatus
public int getRealStatus()This was within the StatusCommand class, but useful to have it here since it's needed in more than one place. In viewer mode at startup there are a number of things going on in different threads, such as the creation of datamaps, and this can (hopefully) handle those bespoke goings on.- Returns:
- program status for multithreaded statup tasks.
-
getRunMode
public int getRunMode()Gets the Pamguard running mode. This is set at startup (generally through slightly different versions of the main class). It will be one of RUN_NORMAL RUN_PAMVIEW RUN_MIXEDMODE- Returns:
- Pamguards run mode
-
getRunModeName
-
isInitializationComplete
public boolean isInitializationComplete() -
dialogOKButtonPressed
public void dialogOKButtonPressed()Called from PamDialog whenever the OK button is pressed. Don't do anything immediately to give the module that opened the dialog time to respond to it's closing (e.g. make the new settings from the dialog it's default). Use invokeLater to send out a message as soon as the awt que is clear. -
enableGUIControl
public void enableGUIControl(boolean enable) Enables / Disables GUI for input. This is used when data are being loaded in viewer mode to prevetn impatient users from clicking on extra things while long background processes take place.Many of the processes loading data are run in the background in SwingWorker threads scheduled with the AWTScheduler so that they are able to update progress on teh screen
- Parameters:
enable
- enable or disable the GUI.
-
loadOldSettings
Called to load a specific set of PAMGUARD settings in viewer mode, which were previously loaded in from a database or binary store.- Parameters:
settingsGroup
- settings informationinitialiseNow
- Immediately data are loaded, initialise which will load data from storages.
-
loadOldSettings
Called to load a specific set of PAMGUARD settings in viewer mode, which were previously loaded in from a database or binary store.- Parameters:
settingsGroup
- settings informationinitialiseNow
- Immediately data are loaded, initialise which will load data from storages.
-
exportSettingsAsXML
Load settings for all modules in this group, then export as XML.- Parameters:
settingsGroup
-
-
getPSFName
Get the name of the psf or database used to contain settings for this run.- Returns:
- name of psf or database
-
getPSFNameWithPath
Get the name of the psf or database used to contain settings for this run.- Returns:
- name of psf or database
-
toolBarStartButton
-
toolBarStopButton
-
storageOptions
invalid input: '<'invalid input: '<'invalid input: '<'invalid input: '<'invalid input: '<'invalid input: '<'invalid input: '<' Updated upstream Respond to storage options dialog. Selects whether data are stored in binary, database or both- Parameters:
parentFrame
- ======= Respond to storage options dialog. Selects whethere data are stored in binary, database or bothparentFrame
- >>>>>>> Stashed changes
-
exportData
Show export options tp export data to other formats- Parameters:
parentFrame
-
-
getVerboseLevel
public int getVerboseLevel()Return a verbose level for debug output- Returns:
- a verbose level for debug output.
-
createWatchDog
public void createWatchDog()Create a watchdog which will run independently and keep this thing going ! -
getUidManager
- Returns:
- the uidManager
-
getUnitBeingLoaded
Returns the module that is currently being loaded. If null, it means we aren't loading anything right now- Returns:
-
clearLoadedUnit
public void clearLoadedUnit()Clears the variable holding info about the unit currently being loaded -
getJCompliance
public double getJCompliance()Get the Java compliance, i.e. what Java version is running.- Returns:
- integer value of java version e.g. Java 8 is return 1.8
-
notifyTaskProgress
Notify the PamController that progress has been made in loading something.- Parameters:
progress
- - holds progress info.
-
checkIfNetworkControlled
public static boolean checkIfNetworkControlled()Check if PAMGuard is being controlled through the network- Returns:
- true if network controlled, false otherwise
-
getInstallFolder
Returns the current installation folder, or null if there was a problem determining the folder location. Note that the default file separator is included at the end of the string.- Returns:
-
getMainFrame
Get the main frame if there is one. Can be used by dialogs when no one else has sorted out a frame reference to pass to them.- Returns:
- reference to main GUI frame.
-
getGuiFrameManager
Description copied from interface:PamControllerInterface
Get the GUI Frame manager.- Specified by:
getGuiFrameManager
in interfacePamControllerInterface
- Returns:
- GUIFrameManager
-
sortFrameTitles
public void sortFrameTitles() -
getGuiManagerFX
Deprecated.FX Gui -
getMainStage
public static javafx.stage.Stage getMainStage() -
setInstallFolder
Set the install folder.- Parameters:
installFolder
-
-
getGlobalTimeManager
- Returns:
- the globalTimeManager
-
isManualStop
public boolean isManualStop()- Returns:
- the manualStop
-
setManualStop
public void setManualStop(boolean manualStop) - Parameters:
manualStop
- the manualStop to set
-
getWatchdogComms
- Returns:
- the watchdogComms
-
getGlobalMediumManager
Get the global medium manager. This indicates whether PG is being used in air or water and handles things like dB references, default sound speed etc.- Returns:
- the global medium manager;
-
getPamConfiguration
Gt the main PAMGuard configuration (list of connected modules).- Returns:
- the pamConfiguration
-
updateMasterClock
public void updateMasterClock(long timeInMillis) Gets called on a timer when NOT processing from files. OR if processing files, gets called whenever the Calendar session start time or file time millis gets updated.- Parameters:
timeInMillis
-
-