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
Modifier and TypeFieldDescriptionstatic final int
Line array of two or more elementsstatic final int
No array specifiedstatic final int
Three or more Hydrophones all in the same planestatic final int
Point array (single phone or multiple phones at same point)static final int
Four or more hydrophones not in the same plane.static String
The array manager.static final double
static final double
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addData
(PamObservable o, PamDataUnit arg) Informs the PamObserver that new data have been added to the Observable classint
getArrayDirection
(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 String
static ArrayManager
int
getArrayShape
(PamArray array) int
getArrayShape
(PamArray array, int phones) int
int
getArrayType
(int phones) static String
getArrayTypeString
(int arrayType) getArrayVectors
(PamArray array, int phones) static GPSDataBlock
Gets 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.long
long
getSnapshotGeometry
(int hydrophoneMap, long timeMillis) Make an ordered set of geometry data for the given hydrophones.int
getSpatiallyUniquePhones
(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 PamArray
loadArrayFromFile
(String fileName) void
masterClockUpdate
(long milliSeconds, long sampleNumber) void
void
notifyModelChanged
(int changeType) General notification when the PAMGAURD model changes.void
receiveSourceNotification
(int type, Object object) Receive a notification from the data source - typically a change in DAQ status.boolean
removeArray
(PamArray newArray) void
called when an Observable (PamDataBlock) is removed from the systemboolean
restoreSettings
(PamControlledUnitSettings pamControlledUnitSettings) static boolean
saveArrayToFile
(PamArray array) void
setCurrentArray
(PamArray array) void
setSampleRate
(float sampleRate, boolean notify) New sample ratevoid
showArrayDialog
(Frame parentFrame) void
showHydrophoneImportDialog
(JFrame guiFrame) void
showStreamerImportDialog
(JFrame guiFrame) void
updateData
(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, getVerboseLevel, gotoTab, isInMainConfiguration, isNetRx, isViewer, pamClose, pamHasStopped, pamToStart, playViewerSound, removePamProcess, removeUnit, rename, saveViewerData, setFrameNumber, setModuleStatusManager, setPamConfiguration, setPamController, setPamModuleInfo, setPamView, setSidePanel, setTabPanel, setToolbarComponent, 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:
getObserverObject
in 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:PamControlledUnit
General notification when the PAMGAURD model changes.- Overrides:
notifyModelChanged
in 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:
getSettingsReference
in interfacePamSettings
- Returns:
- The serialisable object that will be stored
-
getSettingsVersion
public long getSettingsVersion()- Specified by:
getSettingsVersion
in interfacePamSettings
- Returns:
- An integer version number for the settings
-
getUnitName
Description copied from class:PamControlledUnit
Returns the name of the unit- Specified by:
getUnitName
in interfaceSettingsNameProvider
- Overrides:
getUnitName
in classPamControlledUnit
- Returns:
- the name of the unit
-
getUnitType
- Specified by:
getUnitType
in interfacePamSettings
- Overrides:
getUnitType
in classPamControlledUnit
- Returns:
- A Name specific to the type, e.g. Click detector
-
restoreSettings
- Specified by:
restoreSettings
in interfacePamSettings
- 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:
getObserverName
in interfacePamObserver
-
getRequiredDataHistory
- Specified by:
getRequiredDataHistory
in interfacePamObserver
- Parameters:
arg
- optional argument from PamObservable- Returns:
- time in milliseconds required by data held in PamObservable
-
noteNewSettings
public void noteNewSettings()- Specified by:
noteNewSettings
in interfacePamObserver
-
removeObservable
Description copied from interface:PamObserver
called when an Observable (PamDataBlock) is removed from the system- Specified by:
removeObservable
in interfacePamObserver
-
setSampleRate
public void setSampleRate(float sampleRate, boolean notify) Description copied from interface:PamObserver
New sample rate- Specified by:
setSampleRate
in interfacePamObserver
- Parameters:
notify
- Notify other PamObservers and PamObservables in the chain.
-
masterClockUpdate
public void masterClockUpdate(long milliSeconds, long sampleNumber) - Specified by:
masterClockUpdate
in interfacePamObserver
-
addData
Description copied from interface:PamObserver
Informs the PamObserver that new data have been added to the Observable class- Specified by:
addData
in interfacePamObserver
-
updateData
Description copied from interface:PamObserver
Informs the PamObserver that existing data have been updated- Specified by:
updateData
in 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:PamControlledUnit
Get the GUI for the PAMControlled unit. This has multiple GUI options which are instantiated depending on the view type.- Overrides:
getGUI
in classPamControlledUnit
- Parameters:
flag
- . The GUI type flag defined in PAMGuiManager.- Returns:
- the GUI for the PamControlledUnit unit.
-
getReferencePosition
Description copied from interface:PositionReference
Get position data, with heading information if possible.- Specified by:
getReferencePosition
in interfacePositionReference
- Parameters:
timeMillis
- time for position (will usually be latest)- Returns:
- GPS position with heading
-
getReferenceName
Description copied from interface:PositionReference
Name of the reference.- Specified by:
getReferenceName
in interfacePositionReference
- Returns:
-
receiveSourceNotification
Description copied from interface:PamObserver
Receive a notification from the data source - typically a change in DAQ status. See the constants listed in AcquisitionProcess for potential change types.- Specified by:
receiveSourceNotification
in interfacePamObserver
- Parameters:
type
- the type of changeobject
- generic object added here so that we can include anything in the future
-