PamModel
Class PamModel

java.lang.Object
  extended by PamModel.PamModel
All Implemented Interfaces:
PamSettings, PamModelInterface

public final class PamModel
extends java.lang.Object
implements PamModelInterface, PamSettings

Author:
Doug Gillespie Simple creation of a PAM model, but using the correct interface for the PamController.

Field Summary
private  DependencyManager dependencyManager
           
private  PamDataBlock gpsDataBlock
           
private  PamController pamController
           
(package private) static PamModel pamModel
           
private  PamModelSettings pamModelSettings
           
 
Constructor Summary
PamModel(PamController pamController)
           
 
Method Summary
protected  void createPamModel()
          Creates a list of available Pamguard modules and sets dependencies between them
 DependencyManager getDependencyManager()
           
 PamDataBlock<GpsDataUnit> getGpsDataBlock()
           
static PamModel getPamModel()
           
 PamModelSettings getPamModelSettings()
           
 java.io.Serializable getSettingsReference()
           
 long getSettingsVersion()
           
 java.lang.String getUnitName()
           
 java.lang.String getUnitType()
           
 boolean isMultiThread()
           
 boolean modelSettings(javax.swing.JFrame frame)
          Menu command to open dialog to adjust model settings
 boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
           
 void setGpsDataBlock(PamDataBlock gpsDataBlock)
           
 void setMultithreading(boolean multithreading)
          Set multithreading for all of PAMGUARD.
 boolean startModel()
          Starts the Pam detection process
 void stopModel()
          Stops Pam detection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pamController

private PamController pamController

gpsDataBlock

private PamDataBlock gpsDataBlock

dependencyManager

private DependencyManager dependencyManager

pamModelSettings

private PamModelSettings pamModelSettings

pamModel

static PamModel pamModel
Constructor Detail

PamModel

public PamModel(PamController pamController)
Parameters:
pamController - Needs to be parsed a valid reference to a PamController
Method Detail

getPamModel

public static PamModel getPamModel()

getGpsDataBlock

public PamDataBlock<GpsDataUnit> getGpsDataBlock()

setGpsDataBlock

public void setGpsDataBlock(PamDataBlock gpsDataBlock)

createPamModel

protected void createPamModel()
Creates a list of available Pamguard modules and sets dependencies between them

Also sets grouping which are used for menu construction and the minimum and maximum numbers of each type of module that may get created.


startModel

public boolean startModel()
Description copied from interface: PamModelInterface
Starts the Pam detection process

Specified by:
startModel in interface PamModelInterface
Returns:
true if detection started correctly

stopModel

public void stopModel()
Description copied from interface: PamModelInterface
Stops Pam detection

Specified by:
stopModel in interface PamModelInterface

modelSettings

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

Specified by:
modelSettings in interface PamModelInterface
Returns:
tru if dialog returned Ok.

setMultithreading

public void setMultithreading(boolean multithreading)
Set multithreading for all of PAMGUARD.

Be warned that this function should very rarely ever be called and has been included only so that the Likelihood detector can turn off multithreading. Once multithreading has been debugged in the Likelihood detector, this function will be removed or deprecated.

Parameters:
multithreading -

getDependencyManager

public DependencyManager getDependencyManager()
Returns:
Returns the dependencyManager.

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

isMultiThread

public boolean isMultiThread()

getPamModelSettings

public PamModelSettings getPamModelSettings()