Package Array

Class 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 Details Link icon

    • ARRAY_TYPE_NONE Link icon

      public static final int ARRAY_TYPE_NONE
      No array specified
      See Also:
    • ARRAY_TYPE_POINT Link icon

      public static final int ARRAY_TYPE_POINT
      Point array (single phone or multiple phones at same point)
      See Also:
    • ARRAY_TYPE_LINE Link icon

      public static final int ARRAY_TYPE_LINE
      Line array of two or more elements
      See Also:
    • ARRAY_TYPE_PLANE Link icon

      public static final int ARRAY_TYPE_PLANE
      Three or more Hydrophones all in the same plane
      See Also:
    • ARRAY_TYPE_VOLUME Link icon

      public static final int ARRAY_TYPE_VOLUME
      Four or more hydrophones not in the same plane.
      See Also:
    • arrayManagerType Link icon

      public static String arrayManagerType
      The array manager.
    • DEFAULT_HYDROPHONE_SENSITIVITY Link icon

      public static final double DEFAULT_HYDROPHONE_SENSITIVITY
      See Also:
    • DEFAULT_PREAMP_GAIN Link icon

      public static final double DEFAULT_PREAMP_GAIN
      See Also:
  • Method Details Link icon

    • getObserverObject Link icon

      public PamObserver getObserverObject()
      Specified by:
      getObserverObject in interface PamObserver
      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 Link icon

      public static ArrayManager getArrayManager()
    • notifyModelChanged Link icon

      public void notifyModelChanged(int changeType)
      Description copied from class: PamControlledUnit
      General notification when the PAMGAURD model changes.
      Overrides:
      notifyModelChanged in class PamControlledUnit
      Parameters:
      changeType - type of change
    • getArrayFileType Link icon

      public static String getArrayFileType()
      Returns:
      Returns the arrayFileType.
    • getRecentArrays Link icon

      public ArrayList<PamArray> getRecentArrays()
      Returns:
      Returns the recentArrays.
    • getArrayCount Link icon

      public int getArrayCount()
    • showArrayDialog Link icon

      public void showArrayDialog(Frame parentFrame)
    • addArray Link icon

      public void addArray(PamArray newArray)
    • setCurrentArray Link icon

      public void setCurrentArray(PamArray array)
    • removeArray Link icon

      public boolean removeArray(PamArray newArray)
    • getSettingsReference Link icon

      public Serializable getSettingsReference()
      Specified by:
      getSettingsReference in interface PamSettings
      Returns:
      The serialisable object that will be stored
    • getSettingsVersion Link icon

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

      public String getUnitName()
      Description copied from class: PamControlledUnit
      Returns the name of the unit
      Specified by:
      getUnitName in interface SettingsNameProvider
      Overrides:
      getUnitName in class PamControlledUnit
      Returns:
      the name of the unit
    • getUnitType Link icon

      public String getUnitType()
      Specified by:
      getUnitType in interface PamSettings
      Overrides:
      getUnitType in class PamControlledUnit
      Returns:
      A Name specific to the type, e.g. Click detector
    • restoreSettings Link icon

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

      public PamArray getCurrentArray()
      Returns:
      Returns the currentArray.
    • loadArrayFromFile Link icon

      public static PamArray loadArrayFromFile(String fileName)
    • saveArrayToFile Link icon

      public static boolean saveArrayToFile(PamArray array)
    • getObserverName Link icon

      public String getObserverName()
      Specified by:
      getObserverName in interface PamObserver
    • getRequiredDataHistory Link icon

      public long getRequiredDataHistory(PamObservable o, Object arg)
      Specified by:
      getRequiredDataHistory in interface PamObserver
      Parameters:
      arg - optional argument from PamObservable
      Returns:
      time in milliseconds required by data held in PamObservable
    • noteNewSettings Link icon

      public void noteNewSettings()
      Specified by:
      noteNewSettings in interface PamObserver
    • removeObservable Link icon

      public void removeObservable(PamObservable o)
      Description copied from interface: PamObserver
      called when an Observable (PamDataBlock) is removed from the system
      Specified by:
      removeObservable in interface PamObserver
    • setSampleRate Link icon

      public void setSampleRate(float sampleRate, boolean notify)
      Description copied from interface: PamObserver
      New sample rate
      Specified by:
      setSampleRate in interface PamObserver
      Parameters:
      sampleRate -
      notify - Notify other PamObservers and PamObservables in the chain.
    • masterClockUpdate Link icon

      public void masterClockUpdate(long milliSeconds, long sampleNumber)
      Specified by:
      masterClockUpdate in interface PamObserver
    • addData Link icon

      public void addData(PamObservable o, PamDataUnit arg)
      Description copied from interface: PamObserver
      Informs the PamObserver that new data have been added to the Observable class
      Specified by:
      addData in interface PamObserver
    • updateData Link icon

      public void updateData(PamObservable o, PamDataUnit arg)
      Description copied from interface: PamObserver
      Informs the PamObserver that existing data have been updated
      Specified by:
      updateData in interface PamObserver
    • getArrayType Link icon

      public int getArrayType()
      Returns:
      the type of the current array (point, planar, line, etc)
    • getArrayType Link icon

      public int getArrayType(int phones)
      Parameters:
      phones -
      Returns:
      the type of a sub array of the current array (point, planar, line, etc)
    • getArrayShape Link icon

      public int getArrayShape(PamArray array)
      Parameters:
      array - a PAMGUARD array
      Returns:
      the type of an array (point, plane, etc)
    • getArrayShape Link icon

      public int getArrayShape(PamArray array, int phones)
      Parameters:
      array - a PAMGUARD array
      phones - a sub array of phones in the pam array.
      Returns:
      the type of an array (point, plane, etc)
    • getSpatiallyUniquePhones Link icon

      public int getSpatiallyUniquePhones(PamArray array, int phones)
      Take a list of phones and return a list of ones which are at unique positions.
      Parameters:
      array - hydrophone array
      phones - bitmap of hydrophone numbers
      Returns:
      bitmap of hydrophones which have a unique position.
    • getArrayDirections Link icon

      public PamVector[] getArrayDirections()
      Get the principle direction vectors for the current array
      Returns:
      Array of vectors pointing along the array principle axes.
    • getArrayDirection Link icon

      public PamVector[] getArrayDirection(int phones)
      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 Link icon

      public PamVector[] getArrayDirections(PamArray array)
      Get a set of vectors which define the principle coordinates of an array
      Parameters:
      array - array
      Returns:
      array of vectors
    • getArrayDirections Link icon

      public PamVector[] getArrayDirections(PamArray array, int phones)
      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 array
      phones - phones included in a sub array.
      Returns:
      up to three vectors defining the components of the array.
    • getArrayVectors Link icon

      public PamVector[] getArrayVectors(PamArray array, int phones)
    • getArrayTypeString Link icon

      public static String getArrayTypeString(int arrayType)
    • getHydrophoneDataBlock Link icon

      public HydrophoneDataBlock 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 Link icon

      public StreamerDataBlock getStreamerDatabBlock()
    • getHydrophoneSQLLogging Link icon

      public HydrophoneSQLLogging getHydrophoneSQLLogging()
    • getGPSDataBlock Link icon

      public static GPSDataBlock 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 Link icon

      public void showHydrophoneImportDialog(JFrame guiFrame)
    • showStreamerImportDialog Link icon

      public void showStreamerImportDialog(JFrame guiFrame)
    • getSnapshotGeometry Link icon

      public SnapshotGeometry getSnapshotGeometry(int hydrophoneMap, long timeMillis)
      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 Link icon

      public PamControlledUnitGUI getGUI(int flag)
      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 class PamControlledUnit
      Parameters:
      flag - . The GUI type flag defined in PAMGuiManager.
      Returns:
      the GUI for the PamControlledUnit unit.
    • getReferencePosition Link icon

      public GpsData getReferencePosition(long timeMillis)
      Description copied from interface: PositionReference
      Get position data, with heading information if possible.
      Specified by:
      getReferencePosition in interface PositionReference
      Parameters:
      timeMillis - time for position (will usually be latest)
      Returns:
      GPS position with heading
    • getReferenceName Link icon

      public String getReferenceName()
      Description copied from interface: PositionReference
      Name of the reference.
      Specified by:
      getReferenceName in interface PositionReference
      Returns:
    • receiveSourceNotification Link icon

      public void receiveSourceNotification(int type, Object object)
      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 interface PamObserver
      Parameters:
      type - the type of change
      object - generic object added here so that we can include anything in the future