PamController
Class PamController

java.lang.Object
  extended by PamController.PamController
All Implemented Interfaces:
PamControllerInterface, PamSettings

public class PamController
extends java.lang.Object
implements PamControllerInterface, PamSettings

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:
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
           
 
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, INITIALIZATION_COMPLETE, INITIALIZE_LOADDATA, NEW_SCROLL_TIME, OFFLINE_DATA_LOADED, REMOVE_CONTROLLEDUNIT, REMOVE_DATABLOCK, REMOVE_PROCESS, RENAME_CONTROLLED_UNIT, REORDER_CONTROLLEDUNITS
 
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

PAM_IDLE

public static final int PAM_IDLE
See Also:
Constant Field Values

PAM_RUNNING

public static final int PAM_RUNNING
See Also:
Constant Field Values

PAM_LOADINGDATA

public static final int PAM_LOADINGDATA
See Also:
Constant Field Values

RUN_NORMAL

public static final int RUN_NORMAL
See Also:
Constant Field Values

RUN_PAMVIEW

public static final int RUN_PAMVIEW
See Also:
Constant Field Values

RUN_MIXEDMODE

public static final int RUN_MIXEDMODE
See Also:
Constant Field Values

RUN_REMOTE

public static final int RUN_REMOTE
See Also:
Constant Field Values

RUN_NOTHING

public static final int RUN_NOTHING
See Also:
Constant Field Values

runMode

private int runMode

pamModelInterface

private PamModelInterface pamModelInterface

pamControlledUnits

private java.util.ArrayList<PamControlledUnit> pamControlledUnits

pamStatus

private int pamStatus

pamViewParameters

public PamViewParameters pamViewParameters

guiFrameManager

private GuiFrameManager guiFrameManager

initializationComplete

private boolean initializationComplete

uniqueController

private static PamController uniqueController

diagnosticTimer

private javax.swing.Timer diagnosticTimer

networkController

private NetworkController networkController

loadingOldSettings

boolean loadingOldSettings
Constructor Detail

PamController

private PamController(int runMode)
Method Detail

sayMemory

private void sayMemory()

create

public static void create(int runMode)

setupPamguard

private void setupPamguard()

createAnnotations

private void createAnnotations()
Loop through all controllers and processes and datablocks and set up all of their annotations.


organiseGUIFrames

private void organiseGUIFrames()
Organise the GUI frames on start up or after a module was added or after the frames menus have changed.


setupProcesses

void setupProcesses()

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.

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

public void addControlledUnit(PamControlledUnit controlledUnit)
Description copied from interface: PamControllerInterface
Adds a PamControlledUnit to the controller.

Specified by:
addControlledUnit in interface PamControllerInterface
Parameters:
controlledUnit - - Reference to a PamcontrolledUnit

addModule

public boolean addModule(java.awt.Frame parentFrame,
                         PamModuleInfo moduleInfo)
Description copied from interface: PamControllerInterface
Add a new PamControlledUnit

Specified by:
addModule in interface PamControllerInterface
moduleInfo - Information about the PamControlled unit to add
Returns:
true if created sucessfully

addModule

private boolean addModule(PamModuleInfo moduleInfo,
                          java.lang.String moduleName)

removeControlledUnt

public void removeControlledUnt(PamControlledUnit controlledUnit)
Description copied from interface: PamControllerInterface
Removes a PamControlledUnit from the controller

Specified by:
removeControlledUnt in interface PamControllerInterface

orderModules

public boolean orderModules(java.awt.Frame parentFrame)
Description copied from interface: PamControllerInterface
Take actions to alow the user to change the order modules apear in.

Specified by:
orderModules in interface PamControllerInterface

reOrderModules

private boolean reOrderModules(int[] newOrder)

switchModules

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).

Parameters:
m1 - First PamControlledUnit to swap
m2 - Second PamControlledUnit to swap.

setModulePosition

private boolean setModulePosition(PamControlledUnit pcu,
                                  int position)
Sets the position of a particular PamControlledUnit in the list. Also sets the right tab position, to match that order.

Parameters:
pcu -
position -
Returns:

getControlledUnit

public PamControlledUnit getControlledUnit(int iUnit)
Description copied from interface: PamControllerInterface
Returns a reference to a PamControlledUnit within the COntroller

Specified by:
getControlledUnit in interface PamControllerInterface
Parameters:
iUnit - Index of the unit
Returns:
reference to a PamControlledUnit

findControlledUnit

public PamControlledUnit findControlledUnit(java.lang.String unitType)
Description copied from interface: PamControllerInterface
Finds a PamControlledUnit of a given type but with any name

Specified by:
findControlledUnit in interface PamControllerInterface
Parameters:
unitType - Type of PamControlledUnit
Returns:
reference to PamControlledUnit

findControlledUnits

public java.util.ArrayList<PamControlledUnit> findControlledUnits(java.lang.String unitType)
Get a list of PamControlledUnit units of a given type

Parameters:
unitType - Controlled unit type
Returns:
list of units.

findControlledUnit

public PamControlledUnit findControlledUnit(java.lang.String unitType,
                                            java.lang.String unitName)
Description copied from interface: PamControllerInterface
Finds a PamControlledUnit of a given type and name

Specified by:
findControlledUnit in interface PamControllerInterface
Parameters:
unitType - Type of PamControlledUnit
unitName - Name of PamControlledUnit
Returns:
reference to PamControlledUnit

findControlledUnit

public PamControlledUnit findControlledUnit(java.lang.Class unitClass,
                                            java.lang.String unitName)

getNumControlledUnits

public int getNumControlledUnits()
Description copied from interface: PamControllerInterface
Gets the total number of PamControlledUnits

Specified by:
getNumControlledUnits in interface PamControllerInterface
Returns:
the number of PamControlledUnits

getInstance

public static PamController getInstance()

getModelInterface

public PamModelInterface 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 interface PamControllerInterface
Returns:
Reference to the PamGuard model

addView

public void addView(PamViewInterface newView)
Description copied from interface: PamControllerInterface
Adds a new view to the system

Specified by:
addView in interface PamControllerInterface

showControlledUnit

public void showControlledUnit(PamControlledUnit unit)

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 interface PamControllerInterface
Returns:
true if successful

startLater

public void startLater()
calls pamStart using the SingUtilities invokeLater command to start PAMGAURD later in the AWT event que.


pamStart

public boolean pamStart(boolean saveSettings)

pamStop

public void pamStop()
Description copied from interface: PamControllerInterface
Instruction to the controller (probably from a menu command inthe view) that data collection should stop.

Specified by:
pamStop in interface PamControllerInterface

saveSettings

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.


exportXMLSettings

public java.lang.String exportXMLSettings()
Export certain settings into an XML file which will have the current date encoded in its name. Return the file name since it may be needed by the calling function.

Returns:
full path to output file.

findSettingsSources

public java.util.ArrayList<PamSettingsSource> findSettingsSources()
Returns:
a list of PamControlledUnits which implements the PamSettingsSource interface
See Also:
PamSettingsSource

modelSettings

public boolean modelSettings(javax.swing.JFrame frame)
Description copied from interface: PamControllerInterface
Menu command to open dialog to adjust model settings

Specified by:
modelSettings in interface PamControllerInterface
Returns:
true if dialog returned Ok.

pamStarted

public void pamStarted()
Description copied from interface: PamControllerInterface
Notification recieved from the model that data collection has started.

Specified by:
pamStarted in interface PamControllerInterface

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 interface PamControllerInterface

getFFTDataBlocks

public java.util.ArrayList<PamDataBlock> getFFTDataBlocks()
Specified by:
getFFTDataBlocks in interface PamControllerInterface
Returns:
List of PamDataBlocks in all PamProcesses in all PamControlledUnits that contain FFT data.

getFFTDataBlock

public PamDataBlock getFFTDataBlock(int id)
Description copied from interface: PamControllerInterface
Gets a specific data block from the list, or null.

Specified by:
getFFTDataBlock in interface PamControllerInterface
Returns:
an FFT data block at index id within Pamguards list of FFT type data blocks

getFFTDataBlock

public PamDataBlock getFFTDataBlock(java.lang.String name)
Description copied from interface: PamControllerInterface
Gets a specific data block from the list, or null.

Specified by:
getFFTDataBlock in interface PamControllerInterface
Returns:
the first FFT data block at with the given name within Pamguards list of FFT type data blocks

getRawDataBlocks

public java.util.ArrayList<PamDataBlock> getRawDataBlocks()
Specified by:
getRawDataBlocks in interface PamControllerInterface
Returns:
List of PamDataBlocks in all PamProcesses in all PamControlledUnits that contain raw audio data.

getRawDataBlock

public PamRawDataBlock getRawDataBlock(int id)
Description copied from interface: PamControllerInterface
Gets a specific data block from the list, or null.

Specified by:
getRawDataBlock in interface PamControllerInterface
Returns:
a raw data block at index id within Pamguards list of RAW type data blocks

getRawDataBlock

public PamRawDataBlock getRawDataBlock(java.lang.String name)
Description copied from interface: PamControllerInterface
Gets a specific data block from the list, or null.

Specified by:
getRawDataBlock in interface PamControllerInterface
Returns:
the first raw data block at with the given name within Pamguards list of RAW type data blocks

getDetectorDataBlocks

public java.util.ArrayList<PamDataBlock> getDetectorDataBlocks()
Specified by:
getDetectorDataBlocks in interface PamControllerInterface
Returns:
List of PamDataBlocks in all PamProcesses in all PamControlledUnits that contain detector output data.

getDetectorDataBlock

public PamDataBlock getDetectorDataBlock(int id)
Description copied from interface: PamControllerInterface
Gets a specific data block from the list, or null.

Specified by:
getDetectorDataBlock in interface PamControllerInterface
Returns:
PamDataBlock -- a detector data block at index id within Pamguard's list of RAW type data blocks.

getDetectorDataBlock

public PamDataBlock getDetectorDataBlock(java.lang.String name)
Description copied from interface: PamControllerInterface
Gets a specific data block from the list, or null.

Specified by:
getDetectorDataBlock in interface PamControllerInterface
Returns:
PamDataBlock -- the first detector data block with the given name within Pamguard's list of DETECTOR type data blocks.

getDetectorEventDataBlocks

public java.util.ArrayList<PamDataBlock> getDetectorEventDataBlocks()
Specified by:
getDetectorEventDataBlocks in interface PamControllerInterface
Returns:
List of PamDataBlocks in all PamProcesses in all PamControlledUnits that contain data of a specific type.

getDetectorEventDataBlock

public PamDataBlock getDetectorEventDataBlock(int id)
Specified by:
getDetectorEventDataBlock in interface PamControllerInterface

getDetectorEventDataBlock

public PamDataBlock getDetectorEventDataBlock(java.lang.String name)
Specified by:
getDetectorEventDataBlock in interface PamControllerInterface

getDataBlocks

public java.util.ArrayList<PamDataBlock> getDataBlocks(java.lang.Class blockType,
                                                       boolean includeSubClasses)
Specified by:
getDataBlocks in interface PamControllerInterface
Parameters:
blockType - DataType of PamDatablock
Returns:
List of PamDataBlocks in all PamProcesses in all PamControlledUnits that contain data of a specific type.

getDataBlocks

public java.util.ArrayList<PamDataBlock> getDataBlocks()
Specified by:
getDataBlocks in interface PamControllerInterface
Returns:
All data blocks

getPlottableDataBlocks

public java.util.ArrayList<PamDataBlock> getPlottableDataBlocks(GeneralProjector generalProjector)

makeDataBlockList

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

Parameters:
blockType - -- PamguardMVC.DataType.FFT, .RAW, etc., or null to get all extant blocks
Returns:
An ArrayList of data blocks

getDataBlock

public 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.

Specified by:
getDataBlock in interface PamControllerInterface
Parameters:
blockType -
id - -- the block id number
Returns:
block, which you may want to cast to a subtype

getDataBlock

public 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.

Specified by:
getDataBlock in interface PamControllerInterface
Parameters:
blockType - -- RAW, FFT, DETECTOR, null, etc.
name - -- the block name
Returns:
block, which you may want to cast to a subtype

findOfflineDataStores

public java.util.ArrayList<OfflineDataStore> findOfflineDataStores()
Returns:
a list of offline data sources.

findOfflineDataStore

public OfflineDataStore findOfflineDataStore(java.lang.Class sourceClass)

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 interface PamControllerInterface
See Also:
values are
  1. CHANGED_PROCESS_SETTINGS
  2. ADD_PROCESS
  3. REMOVE_PROCESS
  4. ADD_DATABLOCK
  5. REMOVE_DATABLOCK
  6. ADD_CONTROLLEDUNIT
  7. REMOVE_CONTROLLEDUNIT
  8. REORDER_CONTROLLEDUNITS
  9. INITIALIZATION_COMPLETE
  10. DESTROY_EVERYTHING
  11. RENAME_CONTROLLED_UNIT
  12. NEW_VIEW_TIMES
  13. NEW_VIEW_TIME
  14. CHANGED_DISPLAY_SETTINGS
  15. CHANGED_MULTI_THREADING

notifyArrayChange

public void notifyArrayChange()

changedThreading

private void changedThreading()
loop over all units and processes, telling them to re-subscribe to their principal data source


getSettingsReference

public java.io.Serializable getSettingsReference()
Specified by:
getSettingsReference in interface PamSettings
Returns:
The serialisable object that will be stored

getSettingsVersion

public long getSettingsVersion()
Specified by:
getSettingsVersion in interface PamSettings
Returns:
An integer version number for the settings

getUnitName

public java.lang.String getUnitName()
Specified by:
getUnitName in interface PamSettings
Returns:
A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.

getUnitType

public java.lang.String getUnitType()
Specified by:
getUnitType in interface PamSettings
Returns:
A Name specific to the type, e.g. Glick detector

restoreSettings

public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
Specified by:
restoreSettings in interface PamSettings
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 interface PamControllerInterface

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)

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

public java.lang.String getRunModeName()

isInitializationComplete

public boolean isInitializationComplete()

getGuiFrameManager

public GuiFrameManager getGuiFrameManager()
Description copied from interface: PamControllerInterface
Get the GUI Frame manager.

Specified by:
getGuiFrameManager in interface PamControllerInterface
Returns:
GUIFrameManager

getMainFrame

public static java.awt.Frame 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.

dialogOKButtonPressed

public void dialogOKButtonPressed()
Called from Pamdialog whenver the OK button is pressed. Don't do anything immediately to give the module thta opened the dialog tiem to respond to it's closing (eg. 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

public 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.

Parameters:
settingsGroup - settings information

getPSFName

public java.lang.String getPSFName()
Get the name of the psf or database used to contain settings for this run.

Returns:
name of psf or database