Package PamController
Class PamConfiguration
java.lang.Object
PamController.PamConfiguration
Class to take all of the configuration information out of PamController. This
is because PamController is a singleton class, so there can only every be one of
them, but for some of the batch processing control, we need to be able to load and
manipulate a second set of modules, which do nothing within the running
configuration, but are there to allow us to set up a configuration to send to
other batch processes in viewer mode. This is also being used in an improved module import system.
- Author:
- dg50
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addControlledUnit
(PamControlledUnit controlledUnit) Add a PamControlledUnit to the main list.boolean
canClose()
Can PAMGUARD shut down.void
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) findControlledUnit
(String unitType, String unitName) find the first controlled unit with the given type and name.findControlledUnits
(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.Get a list of all offline task groups in this configurationGet a list of all offline tasks in the configurationgetControlledUnit
(int iUnit) int
Get the index of a PamControlledUnitgetDataBlock
(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) getFFTDataBlock
(int id) getFFTDataBlock
(String name) int
getPlottableDataBlocks
(GeneralProjector generalProjector) getRawDataBlock
(int id) getRawDataBlock
(String name) boolean
isControlledUnit
(String controlName) Check whether a controlled unit exists based on it's name.makeDataBlockList
(Class classType, boolean includSubClasses) void
notifyModelChanged
(int changeType) 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.boolean
removeControlledUnt
(PamControlledUnit controlledUnit) boolean
reOrderModules
(int[] newOrder) re-order the modules according to the given list.void
saveSettings
(long timeNow) Gets called in pamStart and may / will attempt to store all PAMGUARD settings via the database and binary storage modules.void
Call setupControlledUnit() on all modules.
-
Constructor Details
-
PamConfiguration
public PamConfiguration()
-
-
Method Details
-
setupProcesses
public void setupProcesses()Call setupControlledUnit() on all modules. -
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. -
getPamControlledUnits
- Returns:
- the pamControlledUnits
-
addControlledUnit
Add a PamControlledUnit to the main list.- Parameters:
controlledUnit
-
-
removeControlledUnt
-
reOrderModules
public boolean reOrderModules(int[] newOrder) re-order the modules according to the given list.- Parameters:
newOrder
-- Returns:
-
getControlledUnit
-
findControlledUnit
-
getNumControlledUnits
public int getNumControlledUnits() -
getRawDataBlock
-
getRawDataBlock
-
getDataBlock
Find a block of a given type with the given name, or null if it doesn't exist.- Parameters:
blockType
- -- RAW, FFT, DETECTOR, null, etc.name
- -- the block name- Returns:
- block, which you may want to cast to a subtype
-
getDataBlocks
-
getDetectorDataBlocks
-
getFFTDataBlocks
-
getFFTDataBlock
-
getFFTDataBlock
-
getDataBlock
Find a block of a given type with the id number, or null if the number is out of range.- Parameters:
blockType
-id
- -- the block id number- Returns:
- block, which you may want to cast to a subtype
-
getRawDataBlocks
-
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
-
getDataBlocks
-
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
find the first controlled unit with the given type and name.- Parameters:
unitType
-unitName
-- Returns:
-
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.
-
saveSettings
public void saveSettings(long timeNow) Gets called in pamStart and may / will attempt to store all PAMGUARD settings via the database and binary storage modules. -
findSettingsSources
- Returns:
- a list of PamControlledUnits which implements the PamSettingsSource interface
- See Also:
-
getPlottableDataBlocks
-
makeDataBlockList
-
notifyModelChanged
public void notifyModelChanged(int changeType) -
getSettingsReference
-
destroyModel
public void destroyModel() -
getControlledUnitIndex
Get the index of a PamControlledUnit- Parameters:
unit
-- Returns:
-
findBinaryStorePath
Find the path to the binary store ....- Returns:
- path to the binary store.
-
getAllOfflineTaskGroups
Get a list of all offline task groups in this configuration- Returns:
- task group list
-
getAllOfflineTasks
Get a list of all offline tasks in the configuration- Returns:
- offline task list
-