Array
Class StraightHydrophoneLocator

java.lang.Object
  extended by Array.SimpleHydrophoneLocator
      extended by Array.StraightHydrophoneLocator
All Implemented Interfaces:
HydrophoneLocator, PamObserver
Direct Known Subclasses:
ThreadingHydrophoneLocator

public class StraightHydrophoneLocator
extends SimpleHydrophoneLocator
implements PamObserver

Straight Hydrophone Locator, uses GPS heading information from GPS and assumes that the hydrophones are just sticking straight out the back of the boat as though on a rigid stick.

If depth readout is installed, then the depth will be taken from the depth data for the appropriate time and also, more interestingly, the y coordinate of each hydrophone will be reduced according to cable angle based on a simple (straight) model of how the hydrophone is lying.

Author:
Doug Gillespie

Field Summary
(package private)  PamDataBlock<GpsDataUnit> gpsDataBlock
           
(package private)  PamDataBlock hydrophoneDataBlock
           
private  GpsDataUnit lastFoundUnit
           
(package private)  GpsDataUnit lastGpsUnit
           
private  long lastSearchTime
           
 
Fields inherited from class Array.SimpleHydrophoneLocator
pamArray
 
Fields inherited from interface Array.HydrophoneLocator
ANGLE_RE_ARRAY, ANGLE_RE_NORTH, ANGLE_RE_SHIP
 
Constructor Summary
StraightHydrophoneLocator(PamArray pamArray)
           
 
Method Summary
private  DepthDataBlock findDepthDataBlock()
           
protected  DepthDataUnit findDepthDataUnit(long timeMillis)
           
(package private)  GpsDataUnit findGpsDataUnit(long timeMilliseconds)
           
 double getCorrectedYPos(long timeMilliseconds, int phoneNo)
          Get a corrected distance astern of the vessel based on the hydrophone being at some depth and the hydrophone cable being basically straight.
 java.lang.String getObserverName()
           
 PamObserver getObserverObject()
           
 double getPairAngle(long timeMilliseconds, int phone1, int phone2, int angleType)
          Get's the angle between a pair of hydrophones
 double getPhoneDepth(long timeMilliseconds, int phoneNo)
          Get's the depth of a specific hydrophone at a given time.
 LatLong getPhoneLatLong(long timeMilliseconds, int phoneNo)
          Get's the LatLong of a specific hydrophone at a given time.
 LatLong getReferenceLatLong(long timeMilliseconds)
          Gets a reference LatLong for the locator at a given time.
 long getRequiredDataHistory(PamObservable o, java.lang.Object arg)
           
 void masterClockUpdate(long milliSeconds, long sampleNumber)
           
 void noteNewSettings()
           
 void notifyModelChanged(int changeType)
           
 void removeObservable(PamObservable o)
          called when an Observable (PamDataBlock) is removed from the system
 void setSampleRate(float sampleRate, boolean notify)
          New sample rate
 void setupGpsMonitor()
           
 java.lang.String toString()
           
 void update(PamObservable o, PamDataUnit arg)
          Informs the PamObserver that new data have been added to the Observable class
 
Methods inherited from class Array.SimpleHydrophoneLocator
getPairSeparation, getPhoneHeading, getPhoneTilt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

gpsDataBlock

PamDataBlock<GpsDataUnit> gpsDataBlock

hydrophoneDataBlock

PamDataBlock hydrophoneDataBlock

lastGpsUnit

GpsDataUnit lastGpsUnit

lastFoundUnit

private GpsDataUnit lastFoundUnit

lastSearchTime

private long lastSearchTime
Constructor Detail

StraightHydrophoneLocator

public StraightHydrophoneLocator(PamArray pamArray)
Method Detail

getObserverObject

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.

getPairAngle

public double getPairAngle(long timeMilliseconds,
                           int phone1,
                           int phone2,
                           int angleType)
Description copied from interface: HydrophoneLocator
Get's the angle between a pair of hydrophones

Specified by:
getPairAngle in interface HydrophoneLocator
Overrides:
getPairAngle in class SimpleHydrophoneLocator
Parameters:
timeMilliseconds - time angle is needed for
phone1 - First hydrophone
phone2 - Second Hydrophone
angleType - Type of angle - ANGLE_RE_NORTH; ANGLE_RE_SHIP; ANGLE_RE_ARRAY;
Returns:
angle in radians

findGpsDataUnit

GpsDataUnit findGpsDataUnit(long timeMilliseconds)

getReferenceLatLong

public LatLong getReferenceLatLong(long timeMilliseconds)
Description copied from interface: HydrophoneLocator
Gets a reference LatLong for the locator at a given time. For towed hydrophones, this will be the ships gps position at that moment. FOr static phones it will be the static array reference position.

Specified by:
getReferenceLatLong in interface HydrophoneLocator
Parameters:
timeMilliseconds - time reference needed for
Returns:
Reference LatLonbg

getPhoneLatLong

public LatLong getPhoneLatLong(long timeMilliseconds,
                               int phoneNo)
Description copied from interface: HydrophoneLocator
Get's the LatLong of a specific hydrophone at a given time.

Specified by:
getPhoneLatLong in interface HydrophoneLocator
Parameters:
timeMilliseconds - time position needed for
phoneNo - Hydrophone number
Returns:
Hydrophone LatLong

notifyModelChanged

public void notifyModelChanged(int changeType)
Specified by:
notifyModelChanged in interface HydrophoneLocator
Overrides:
notifyModelChanged in class SimpleHydrophoneLocator

getPhoneDepth

public double getPhoneDepth(long timeMilliseconds,
                            int phoneNo)
Description copied from interface: HydrophoneLocator
Get's the depth of a specific hydrophone at a given time.

Specified by:
getPhoneDepth in interface HydrophoneLocator
Overrides:
getPhoneDepth in class SimpleHydrophoneLocator
Parameters:
timeMilliseconds - time depth needed for
phoneNo - Hydrophone number
Returns:
Hydrophone depth

findDepthDataUnit

protected DepthDataUnit findDepthDataUnit(long timeMillis)

findDepthDataBlock

private DepthDataBlock findDepthDataBlock()

getCorrectedYPos

public double getCorrectedYPos(long timeMilliseconds,
                               int phoneNo)
Get a corrected distance astern of the vessel based on the hydrophone being at some depth and the hydrophone cable being basically straight. Generally, this correection will be small when towing close to the surface, but will get large when the phone sinks.

Parameters:
timeMilliseconds - time that the Y is required for
phoneNo - hydrophone number.
Returns:
corrected distance astern of vessel.

setupGpsMonitor

public void setupGpsMonitor()

getObserverName

public java.lang.String getObserverName()
Specified by:
getObserverName in interface PamObserver

getRequiredDataHistory

public long getRequiredDataHistory(PamObservable o,
                                   java.lang.Object arg)
Specified by:
getRequiredDataHistory in interface PamObserver
Parameters:
o - PamObservable class requiring the data
arg - optional argument from PamObservable
Returns:
time in milliseconds requried by data held in PamObservable

noteNewSettings

public void noteNewSettings()
Specified by:
noteNewSettings in interface PamObserver

removeObservable

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

public void setSampleRate(float sampleRate,
                          boolean notify)
Description copied from interface: PamObserver
New sample rate

Specified by:
setSampleRate in interface PamObserver
notify - Notify other PamObservers and PamObservables in the chain.

masterClockUpdate

public void masterClockUpdate(long milliSeconds,
                              long sampleNumber)
Specified by:
masterClockUpdate in interface PamObserver

update

public void update(PamObservable o,
                   PamDataUnit arg)
Description copied from interface: PamObserver
Informs the PamObserver that new data have been added to the Observable class

Specified by:
update in interface PamObserver
Parameters:
o - Reference to the Observable (a PamDataBlock)
arg - Reference to the new PamDataUnit

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object