|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectPamController.PamController
public class PamController
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.)
PamControlledUnit,
PamTabPanel| Nested Class Summary | |
|---|---|
(package private) class |
PamController.DataInitialised
|
(package private) class |
PamController.DiagnosticTimer
|
(package private) class |
PamController.DialogOKButtonPressed
Invoked later every time a dialog OK button is pressed. |
private class |
PamController.StartLater
Runnable for use with startLater. |
(package private) class |
PamController.ViewTimesSettings
Class to do some extra saving of view times. |
| Field Summary | |
|---|---|
private javax.swing.Timer |
diagnosticTimer
|
private GuiFrameManager |
guiFrameManager
|
private boolean |
initializationComplete
|
(package private) boolean |
loadingOldSettings
|
private NetworkController |
networkController
|
static int |
PAM_IDLE
|
static int |
PAM_LOADINGDATA
|
static int |
PAM_RUNNING
|
private java.util.ArrayList<PamControlledUnit> |
pamControlledUnits
|
private PamModelInterface |
pamModelInterface
|
private int |
pamStatus
|
PamViewParameters |
pamViewParameters
|
static int |
RUN_MIXEDMODE
|
static int |
RUN_NORMAL
|
static int |
RUN_NOTHING
|
static int |
RUN_PAMVIEW
|
static int |
RUN_REMOTE
|
private int |
runMode
|
private static PamController |
uniqueController
|
| Constructor Summary | |
|---|---|
private |
PamController(int runMode)
|
| Method Summary | |
|---|---|
void |
addControlledUnit(PamControlledUnit controlledUnit)
Adds a PamControlledUnit to the controller. |
boolean |
addModule(java.awt.Frame parentFrame,
PamModuleInfo moduleInfo)
Add a new PamControlledUnit |
private boolean |
addModule(PamModuleInfo moduleInfo,
java.lang.String moduleName)
|
void |
addView(PamViewInterface newView)
Adds a new view to the system |
boolean |
canClose()
Can PAMGUARD shut down. |
private void |
changedThreading()
loop over all units and processes, telling them to re-subscribe to their principal data source |
static void |
create(int runMode)
|
private void |
createAnnotations()
Loop through all controllers and processes and datablocks and set up all of their annotations. |
void |
destroyModel()
|
void |
dialogOKButtonPressed()
Called from Pamdialog whenver the OK button is pressed. |
void |
enableGUIControl(boolean enable)
Enables / Disables GUI for input. |
java.lang.String |
exportXMLSettings()
Export certain settings into an XML file which will have the current date encoded in its name. |
PamControlledUnit |
findControlledUnit(java.lang.Class unitClass,
java.lang.String unitName)
|
PamControlledUnit |
findControlledUnit(java.lang.String unitType)
Finds a PamControlledUnit of a given type but with any name |
PamControlledUnit |
findControlledUnit(java.lang.String unitType,
java.lang.String unitName)
Finds a PamControlledUnit of a given type and name |
java.util.ArrayList<PamControlledUnit> |
findControlledUnits(java.lang.String unitType)
Get a list of PamControlledUnit units of a given type |
OfflineDataStore |
findOfflineDataStore(java.lang.Class sourceClass)
|
java.util.ArrayList<OfflineDataStore> |
findOfflineDataStores()
|
java.util.ArrayList<PamSettingsSource> |
findSettingsSources()
|
PamControlledUnit |
getControlledUnit(int iUnit)
Returns a reference to a PamControlledUnit within the COntroller |
PamDataBlock |
getDataBlock(java.lang.Class blockType,
int id)
Find a block of a given type with the id number, or null if the number is out of range. |
PamDataBlock |
getDataBlock(java.lang.Class blockType,
java.lang.String name)
Find a block of a given type with the given name, or null if it doesn't exist. |
java.util.ArrayList<PamDataBlock> |
getDataBlocks()
|
java.util.ArrayList<PamDataBlock> |
getDataBlocks(java.lang.Class blockType,
boolean includeSubClasses)
|
PamDataBlock |
getDetectorDataBlock(int id)
Gets a specific data block from the list, or null. |
PamDataBlock |
getDetectorDataBlock(java.lang.String name)
Gets a specific data block from the list, or null. |
java.util.ArrayList<PamDataBlock> |
getDetectorDataBlocks()
|
PamDataBlock |
getDetectorEventDataBlock(int id)
|
PamDataBlock |
getDetectorEventDataBlock(java.lang.String name)
|
java.util.ArrayList<PamDataBlock> |
getDetectorEventDataBlocks()
|
PamDataBlock |
getFFTDataBlock(int id)
Gets a specific data block from the list, or null. |
PamDataBlock |
getFFTDataBlock(java.lang.String name)
Gets a specific data block from the list, or null. |
java.util.ArrayList<PamDataBlock> |
getFFTDataBlocks()
|
GuiFrameManager |
getGuiFrameManager()
Get the GUI Frame manager. |
static PamController |
getInstance()
|
static java.awt.Frame |
getMainFrame()
GEt the main frame if there is one. |
PamModelInterface |
getModelInterface()
Gets a reference to the PamModel (where all the data are stored and the algorithms are running) |
int |
getNumControlledUnits()
Gets the total number of PamControlledUnits |
int |
getPamStatus()
returns the status of Pamguard. |
java.util.ArrayList<PamDataBlock> |
getPlottableDataBlocks(GeneralProjector generalProjector)
|
java.lang.String |
getPSFName()
Get the name of the psf or database used to contain settings for this run. |
PamRawDataBlock |
getRawDataBlock(int id)
Gets a specific data block from the list, or null. |
PamRawDataBlock |
getRawDataBlock(java.lang.String name)
Gets a specific data block from the list, or null. |
java.util.ArrayList<PamDataBlock> |
getRawDataBlocks()
|
int |
getRunMode()
Gets the Pamguard running mode. |
java.lang.String |
getRunModeName()
|
java.io.Serializable |
getSettingsReference()
|
long |
getSettingsVersion()
|
java.lang.String |
getUnitName()
|
java.lang.String |
getUnitType()
|
boolean |
isInitializationComplete()
|
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. |
private java.util.ArrayList<PamDataBlock> |
makeDataBlockList(java.lang.Class classType,
boolean includSubClasses)
Makes a list of data blocks for all processes in all controllers for a given DataType or for all DataTypes |
boolean |
modelSettings(javax.swing.JFrame frame)
Menu command to open dialog to adjust model settings |
void |
notifyArrayChange()
|
void |
notifyModelChanged(int changeType)
Tell the controller that the model may have changed (i.e. |
boolean |
orderModules(java.awt.Frame parentFrame)
Take actions to alow the user to change the order modules apear in. |
private void |
organiseGUIFrames()
Organise the GUI frames on start up or after a module was added or after the frames menus have changed. |
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 controller |
boolean |
pamStart()
Start PAMGUARD. |
boolean |
pamStart(boolean saveSettings)
|
void |
pamStarted()
Notification recieved from the model that data collection has started. |
void |
pamStop()
Instruction to the controller (probably from a menu command inthe view) that data collection should stop. |
void |
removeControlledUnt(PamControlledUnit controlledUnit)
Removes a PamControlledUnit from the controller |
private boolean |
reOrderModules(int[] newOrder)
|
boolean |
restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
|
private 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 |
saveViewerData()
Go through all data blocks in all modules and tell them to save. |
private void |
sayMemory()
|
private boolean |
setModulePosition(PamControlledUnit pcu,
int position)
Sets the position of a particular PamControlledUnit in the list. |
void |
setPamStatus(int pamStatus)
|
private void |
setupPamguard()
|
(package private) void |
setupProcesses()
|
void |
showControlledUnit(PamControlledUnit unit)
|
void |
startLater()
calls pamStart using the SingUtilities invokeLater command to start PAMGAURD later in the AWT event que. |
private void |
switchModules(PamControlledUnit m1,
PamControlledUnit m2)
Swaps the positions of two modules in the main list of modules and also swaps their tabs (if they have them). |
void |
totalModelRebuild()
Do a total rebuild of the Pam model based on the contents of the set settings file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int PAM_IDLE
public static final int PAM_RUNNING
public static final int PAM_LOADINGDATA
public static final int RUN_NORMAL
public static final int RUN_PAMVIEW
public static final int RUN_MIXEDMODE
public static final int RUN_REMOTE
public static final int RUN_NOTHING
private int runMode
private PamModelInterface pamModelInterface
private java.util.ArrayList<PamControlledUnit> pamControlledUnits
private int pamStatus
public PamViewParameters pamViewParameters
private GuiFrameManager guiFrameManager
private boolean initializationComplete
private static PamController uniqueController
private javax.swing.Timer diagnosticTimer
private NetworkController networkController
boolean loadingOldSettings
| Constructor Detail |
|---|
private PamController(int runMode)
| Method Detail |
|---|
private void sayMemory()
public static void create(int runMode)
private void setupPamguard()
private void createAnnotations()
private void organiseGUIFrames()
void setupProcesses()
public boolean canClose()
public void saveViewerData()
public void addControlledUnit(PamControlledUnit controlledUnit)
PamControllerInterface
addControlledUnit in interface PamControllerInterfacecontrolledUnit - -
Reference to a PamcontrolledUnit
public boolean addModule(java.awt.Frame parentFrame,
PamModuleInfo moduleInfo)
PamControllerInterface
addModule in interface PamControllerInterfacemoduleInfo - Information about the PamControlled unit to add
private boolean addModule(PamModuleInfo moduleInfo,
java.lang.String moduleName)
public void removeControlledUnt(PamControlledUnit controlledUnit)
PamControllerInterface
removeControlledUnt in interface PamControllerInterfacepublic boolean orderModules(java.awt.Frame parentFrame)
PamControllerInterface
orderModules in interface PamControllerInterfaceprivate boolean reOrderModules(int[] newOrder)
private void switchModules(PamControlledUnit m1,
PamControlledUnit m2)
m1 - First PamControlledUnit to swapm2 - Second PamControlledUnit to swap.
private boolean setModulePosition(PamControlledUnit pcu,
int position)
pcu - position -
public PamControlledUnit getControlledUnit(int iUnit)
PamControllerInterface
getControlledUnit in interface PamControllerInterfaceiUnit - Index of the unit
public PamControlledUnit findControlledUnit(java.lang.String unitType)
PamControllerInterface
findControlledUnit in interface PamControllerInterfaceunitType - Type of PamControlledUnit
public java.util.ArrayList<PamControlledUnit> findControlledUnits(java.lang.String unitType)
unitType - Controlled unit type
public PamControlledUnit findControlledUnit(java.lang.String unitType,
java.lang.String unitName)
PamControllerInterface
findControlledUnit in interface PamControllerInterfaceunitType - Type of PamControlledUnitunitName - Name of PamControlledUnit
public PamControlledUnit findControlledUnit(java.lang.Class unitClass,
java.lang.String unitName)
public int getNumControlledUnits()
PamControllerInterface
getNumControlledUnits in interface PamControllerInterfacepublic static PamController getInstance()
public PamModelInterface getModelInterface()
PamControllerInterface
getModelInterface in interface PamControllerInterfacepublic void addView(PamViewInterface newView)
PamControllerInterface
addView in interface PamControllerInterfacepublic void showControlledUnit(PamControlledUnit unit)
public boolean pamStart()
As well as actually starting PAMGUARD it will write settings to the database and to the binary data store.
pamStart in interface PamControllerInterfacepublic void startLater()
public boolean pamStart(boolean saveSettings)
public void pamStop()
PamControllerInterface
pamStop in interface PamControllerInterfaceprivate void saveSettings(long timeNow)
public java.lang.String exportXMLSettings()
public java.util.ArrayList<PamSettingsSource> findSettingsSources()
PamSettingsSourcepublic boolean modelSettings(javax.swing.JFrame frame)
PamControllerInterface
modelSettings in interface PamControllerInterfacepublic void pamStarted()
PamControllerInterface
pamStarted in interface PamControllerInterfacepublic void pamEnded()
PamControllerInterface
pamEnded in interface PamControllerInterfacepublic java.util.ArrayList<PamDataBlock> getFFTDataBlocks()
getFFTDataBlocks in interface PamControllerInterfacepublic PamDataBlock getFFTDataBlock(int id)
PamControllerInterface
getFFTDataBlock in interface PamControllerInterfacepublic PamDataBlock getFFTDataBlock(java.lang.String name)
PamControllerInterface
getFFTDataBlock in interface PamControllerInterfacepublic java.util.ArrayList<PamDataBlock> getRawDataBlocks()
getRawDataBlocks in interface PamControllerInterfacepublic PamRawDataBlock getRawDataBlock(int id)
PamControllerInterface
getRawDataBlock in interface PamControllerInterfacepublic PamRawDataBlock getRawDataBlock(java.lang.String name)
PamControllerInterface
getRawDataBlock in interface PamControllerInterfacepublic java.util.ArrayList<PamDataBlock> getDetectorDataBlocks()
getDetectorDataBlocks in interface PamControllerInterfacepublic PamDataBlock getDetectorDataBlock(int id)
PamControllerInterface
getDetectorDataBlock in interface PamControllerInterfacepublic PamDataBlock getDetectorDataBlock(java.lang.String name)
PamControllerInterface
getDetectorDataBlock in interface PamControllerInterfacepublic java.util.ArrayList<PamDataBlock> getDetectorEventDataBlocks()
getDetectorEventDataBlocks in interface PamControllerInterfacepublic PamDataBlock getDetectorEventDataBlock(int id)
getDetectorEventDataBlock in interface PamControllerInterfacepublic PamDataBlock getDetectorEventDataBlock(java.lang.String name)
getDetectorEventDataBlock in interface PamControllerInterface
public java.util.ArrayList<PamDataBlock> getDataBlocks(java.lang.Class blockType,
boolean includeSubClasses)
getDataBlocks in interface PamControllerInterfaceblockType - DataType of PamDatablock
public java.util.ArrayList<PamDataBlock> getDataBlocks()
getDataBlocks in interface PamControllerInterfacepublic java.util.ArrayList<PamDataBlock> getPlottableDataBlocks(GeneralProjector generalProjector)
private java.util.ArrayList<PamDataBlock> makeDataBlockList(java.lang.Class classType,
boolean includSubClasses)
blockType - -- PamguardMVC.DataType.FFT, .RAW, etc., or null to
get all extant blocks
public PamDataBlock getDataBlock(java.lang.Class blockType,
int id)
getDataBlock in interface PamControllerInterfaceblockType - id - -- the block id number
public PamDataBlock getDataBlock(java.lang.Class blockType,
java.lang.String name)
getDataBlock in interface PamControllerInterfaceblockType - -- RAW, FFT, DETECTOR, null, etc.name - -- the block name
public java.util.ArrayList<OfflineDataStore> findOfflineDataStores()
public OfflineDataStore findOfflineDataStore(java.lang.Class sourceClass)
public void notifyModelChanged(int changeType)
PamControllerInterface
notifyModelChanged in interface PamControllerInterfacevalues 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
public void notifyArrayChange()
private void changedThreading()
public java.io.Serializable getSettingsReference()
getSettingsReference in interface PamSettingspublic long getSettingsVersion()
getSettingsVersion in interface PamSettingspublic java.lang.String getUnitName()
getUnitName in interface PamSettingspublic java.lang.String getUnitType()
getUnitType in interface PamSettingspublic boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
restoreSettings in interface PamSettingspublic void destroyModel()
public void totalModelRebuild()
PamControllerInterface
totalModelRebuild in interface PamControllerInterfacepublic int getPamStatus()
public void setPamStatus(int pamStatus)
public int getRunMode()
public java.lang.String getRunModeName()
public boolean isInitializationComplete()
public GuiFrameManager getGuiFrameManager()
PamControllerInterface
getGuiFrameManager in interface PamControllerInterfacepublic static java.awt.Frame getMainFrame()
public void dialogOKButtonPressed()
public void enableGUIControl(boolean enable)
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
enable - enable or disable the GUI.public void loadOldSettings(PamSettingsGroup settingsGroup)
settingsGroup - settings informationpublic java.lang.String getPSFName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||