Package Array
Class ArrayManager
java.lang.Object
PamController.PamControlledUnit
Array.ArrayManager
- All Implemented Interfaces:
 PamSettings,PositionReference,SettingsNameProvider,PamObserver
public class ArrayManager
extends PamControlledUnit
implements PamSettings, PamObserver, PositionReference
Manager for different array configurations. Each array configuration is 
 stored in it's own serialised file, which is separate from other Pam Settings
 so that they can be stored, emailed around, etc. In it' main serialised file
 controlled by PamSettingsManager, Pamguard keeps a list of recently used arrays.
 
The dialog ArrayDialog allows the user to load arrays from file, create new arrays, edit arrays, etc.
- Author:
 - Doug Gillespie
 - See Also:
 
- 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intLine array of two or more elementsstatic final intNo array specifiedstatic final intThree or more Hydrophones all in the same planestatic final intPoint array (single phone or multiple phones at same point)static final intFour or more hydrophones not in the same plane.static StringThe array manager.static final doublestatic final doubleFields inherited from class PamController.PamControlledUnit
isMixed, isViewer - 
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddData(PamObservable o, PamDataUnit arg) Informs the PamObserver that new data have been added to the Observable classintgetArrayDirection(int phones) Get the principle direction vectors for a sub set of hydrophones within the current arrayGet the principle direction vectors for the current arraygetArrayDirections(PamArray array) Get a set of vectors which define the principle coordinates of an arraygetArrayDirections(PamArray array, int phones) Get a set of vectors which define the principle components of an array.static Stringstatic ArrayManagerintgetArrayShape(PamArray array) intgetArrayShape(PamArray array, int phones) intintgetArrayType(int phones) static StringgetArrayTypeString(int arrayType) getArrayVectors(PamArray array, int phones) static GPSDataBlockGets the GPS data block, if there is one.getGUI(int flag) Get the GUI for the PAMControlled unit.Called from the network receiver to create and assign some specific hydrophone streamer within an array and to clone a streamer to make a new one if necessaryName of the reference.getReferencePosition(long timeMillis) Get position data, with heading information if possible.longlonggetSnapshotGeometry(int hydrophoneMap, long timeMillis) Make an ordered set of geometry data for the given hydrophones.intgetSpatiallyUniquePhones(PamArray array, int phones) Take a list of phones and return a list of ones which are at unique positions.Returns the name of the unitstatic PamArrayloadArrayFromFile(String fileName) voidmasterClockUpdate(long milliSeconds, long sampleNumber) voidvoidnotifyModelChanged(int changeType) General notification when the PAMGAURD model changes.voidreceiveSourceNotification(int type, Object object) Receive a notification from the data source - typically a change in DAQ status.booleanremoveArray(PamArray newArray) voidcalled when an Observable (PamDataBlock) is removed from the systembooleanrestoreSettings(PamControlledUnitSettings pamControlledUnitSettings) static booleansaveArrayToFile(PamArray array) voidsetCurrentArray(PamArray array) voidsetSampleRate(float sampleRate, boolean notify) New sample ratevoidshowArrayDialog(Frame parentFrame) voidshowHydrophoneImportDialog(JFrame guiFrame) voidshowStreamerImportDialog(JFrame guiFrame) voidupdateData(PamObservable o, PamDataUnit arg) Informs the PamObserver that existing data have been updatedMethods inherited from class PamController.PamControlledUnit
addOfflineTaskGroup, addOtherRelatedMenuItems, addPamProcess, addPamProcess, addRelatedMenuItems, canClose, canPlayViewerSound, createDetectionMenu, createDisplayMenu, createFileMenu, createHelpMenu, flushDataBlockBuffers, getBackupInformation, getFrameNumber, getGuiFrame, getInstanceIndex, getModuleStatus, getModuleStatusManager, getModuleSummary, getModuleSummary, getNumOfflineTaskGroups, getNumPamProcesses, getOfflineState, getOfflineTaskGroup, getPamConfiguration, getPamController, getPamModuleInfo, getPamProcess, getPamView, getPlugin, getShortUnitType, getSidePanel, getTabClipCopier, getTabPanel, getTabSpecificMenuBar, getToolbarComponent, getUnitTaskManager, getUnitTaskManager, getVerboseLevel, gotoTab, isInMainConfiguration, isNetRx, isViewer, pamClose, pamHasStopped, pamToStart, playViewerSound, removePamProcess, removeUnit, rename, saveViewerData, setFrameNumber, setModuleStatusManager, setPamConfiguration, setPamController, setPamModuleInfo, setPamView, setSidePanel, setTabPanel, setToolbarComponent, setUnitTaskManager, setupControlledUnit, stopViewerSound, tellModule, terminalPrint, terminalPrintln, toString 
- 
Field Details
- 
ARRAY_TYPE_NONE
public static final int ARRAY_TYPE_NONENo array specified- See Also:
 
 - 
ARRAY_TYPE_POINT
public static final int ARRAY_TYPE_POINTPoint array (single phone or multiple phones at same point)- See Also:
 
 - 
ARRAY_TYPE_LINE
public static final int ARRAY_TYPE_LINELine array of two or more elements- See Also:
 
 - 
ARRAY_TYPE_PLANE
public static final int ARRAY_TYPE_PLANEThree or more Hydrophones all in the same plane- See Also:
 
 - 
ARRAY_TYPE_VOLUME
public static final int ARRAY_TYPE_VOLUMEFour or more hydrophones not in the same plane.- See Also:
 
 - 
arrayManagerType
The array manager. - 
DEFAULT_HYDROPHONE_SENSITIVITY
public static final double DEFAULT_HYDROPHONE_SENSITIVITY- See Also:
 
 - 
DEFAULT_PREAMP_GAIN
public static final double DEFAULT_PREAMP_GAIN- See Also:
 
 
 - 
 - 
Method Details
- 
getObserverObject
- Specified by:
 getObserverObjectin interfacePamObserver- Returns:
 - the actual observer. In most cases concrete classes will just return 'this' in response. The exception is the Threaded observer, which will return the single thread observer.
 
 - 
getArrayManager
 - 
notifyModelChanged
public void notifyModelChanged(int changeType) Description copied from class:PamControlledUnitGeneral notification when the PAMGAURD model changes.- Overrides:
 notifyModelChangedin classPamControlledUnit- Parameters:
 changeType- type of change
 - 
getArrayFileType
- Returns:
 - Returns the arrayFileType.
 
 - 
getRecentArrays
- Returns:
 - Returns the recentArrays.
 
 - 
getArrayCount
public int getArrayCount() - 
showArrayDialog
 - 
addArray
 - 
setCurrentArray
 - 
removeArray
 - 
getSettingsReference
- Specified by:
 getSettingsReferencein interfacePamSettings- Returns:
 - The serialisable object that will be stored
 
 - 
getSettingsVersion
public long getSettingsVersion()- Specified by:
 getSettingsVersionin interfacePamSettings- Returns:
 - An integer version number for the settings
 
 - 
getUnitName
Description copied from class:PamControlledUnitReturns the name of the unit- Specified by:
 getUnitNamein interfaceSettingsNameProvider- Overrides:
 getUnitNamein classPamControlledUnit- Returns:
 - the name of the unit
 
 - 
getUnitType
- Specified by:
 getUnitTypein interfacePamSettings- Overrides:
 getUnitTypein classPamControlledUnit- Returns:
 - A Name specific to the type, e.g. Click detector
 
 - 
restoreSettings
- Specified by:
 restoreSettingsin interfacePamSettings- Parameters:
 pamControlledUnitSettings-- 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
 
 - 
getCurrentArray
- Returns:
 - Returns the currentArray.
 
 - 
loadArrayFromFile
 - 
saveArrayToFile
 - 
getObserverName
- Specified by:
 getObserverNamein interfacePamObserver
 - 
getRequiredDataHistory
- Specified by:
 getRequiredDataHistoryin interfacePamObserver- Parameters:
 arg- optional argument from PamObservable- Returns:
 - time in milliseconds required by data held in PamObservable
 
 - 
noteNewSettings
public void noteNewSettings()- Specified by:
 noteNewSettingsin interfacePamObserver
 - 
removeObservable
Description copied from interface:PamObservercalled when an Observable (PamDataBlock) is removed from the system- Specified by:
 removeObservablein interfacePamObserver
 - 
setSampleRate
public void setSampleRate(float sampleRate, boolean notify) Description copied from interface:PamObserverNew sample rate- Specified by:
 setSampleRatein interfacePamObserver- Parameters:
 sampleRate-notify- Notify other PamObservers and PamObservables in the chain.
 - 
masterClockUpdate
public void masterClockUpdate(long milliSeconds, long sampleNumber) - Specified by:
 masterClockUpdatein interfacePamObserver
 - 
addData
Description copied from interface:PamObserverInforms the PamObserver that new data have been added to the Observable class- Specified by:
 addDatain interfacePamObserver
 - 
updateData
Description copied from interface:PamObserverInforms the PamObserver that existing data have been updated- Specified by:
 updateDatain interfacePamObserver
 - 
getArrayType
public int getArrayType()- Returns:
 - the type of the current array (point, planar, line, etc)
 
 - 
getArrayType
public int getArrayType(int phones) - Parameters:
 phones-- Returns:
 - the type of a sub array of the current array (point, planar, line, etc)
 
 - 
getArrayShape
- Parameters:
 array- a PAMGUARD array- Returns:
 - the type of an array (point, plane, etc)
 
 - 
getArrayShape
- Parameters:
 array- a PAMGUARD arrayphones- a sub array of phones in the pam array.- Returns:
 - the type of an array (point, plane, etc)
 
 - 
getSpatiallyUniquePhones
Take a list of phones and return a list of ones which are at unique positions.- Parameters:
 array- hydrophone arrayphones- bitmap of hydrophone numbers- Returns:
 - bitmap of hydrophones which have a unique position.
 
 - 
getArrayDirections
Get the principle direction vectors for the current array- Returns:
 - Array of vectors pointing along the array principle axes.
 
 - 
getArrayDirection
Get the principle direction vectors for a sub set of hydrophones within the current array- Parameters:
 phones- bitmap of hydrophones- Returns:
 - Array of vectors pointing along the array principle axes.
 
 - 
getArrayDirections
Get a set of vectors which define the principle coordinates of an array- Parameters:
 array- array- Returns:
 - array of vectors
 
 - 
getArrayDirections
Get a set of vectors which define the principle components of an array.For a point array, null is returned
For a line array a vector pointing along the array in the direction closest to the y axis
For a planar array a vector pointing as closely as possible to the y axis and a second vector, perpendicular to the first, obeying a right hand rule, in the plane will be returned.
For a volumetric array, the above + the third vector (vec product of the other two).
- Parameters:
 array- Pamguard arrayphones- phones included in a sub array.- Returns:
 - up to three vectors defining the components of the array.
 
 - 
getArrayVectors
 - 
getArrayTypeString
 - 
getHydrophoneDataBlock
Called from the network receiver to create and assign some specific hydrophone streamer within an array and to clone a streamer to make a new one if necessary- Parameters:
 buoyStats-
 - 
getStreamerDatabBlock
 - 
getHydrophoneSQLLogging
 - 
getGPSDataBlock
Gets the GPS data block, if there is one. If no datablock is present then returns null;- Returns:
 - reference to the gps data block (if there is one)
 
 - 
showHydrophoneImportDialog
 - 
showStreamerImportDialog
 - 
getSnapshotGeometry
Make an ordered set of geometry data for the given hydrophones. data rows will be null if a hydrophone isn't used. Geometry is all returned in cartesian coordinates relative to the reference point which is the position of the first hydrophone streamer. All individual hydrophones have their pitch, roll and everything else added within this function.- Parameters:
 hydrophoneMap- bitmap of used hydrophones- Returns:
 - geometry data.
 
 - 
getGUI
Description copied from class:PamControlledUnitGet the GUI for the PAMControlled unit. This has multiple GUI options which are instantiated depending on the view type.- Overrides:
 getGUIin classPamControlledUnit- Parameters:
 flag- . The GUI type flag defined in PAMGuiManager.- Returns:
 - the GUI for the PamControlledUnit unit.
 
 - 
getReferencePosition
Description copied from interface:PositionReferenceGet position data, with heading information if possible.- Specified by:
 getReferencePositionin interfacePositionReference- Parameters:
 timeMillis- time for position (will usually be latest)- Returns:
 - GPS position with heading
 
 - 
getReferenceName
Description copied from interface:PositionReferenceName of the reference.- Specified by:
 getReferenceNamein interfacePositionReference- Returns:
 
 - 
receiveSourceNotification
Description copied from interface:PamObserverReceive a notification from the data source - typically a change in DAQ status. See the constants listed in AcquisitionProcess for potential change types.- Specified by:
 receiveSourceNotificationin interfacePamObserver- Parameters:
 type- the type of changeobject- generic object added here so that we can include anything in the future
 
 -