Class BuoyStatusDataUnit

java.lang.Object
PamguardMVC.PamDataUnit
networkTransfer.receive.BuoyStatusDataUnit
All Implemented Interfaces:
Comparable

public class BuoyStatusDataUnit extends PamDataUnit
Class for collecting data to do with individual buoys receiving data over the network.
Author:
Doug Gillespie
  • Constructor Details

    • BuoyStatusDataUnit

      public BuoyStatusDataUnit(NetworkReceiver networkReceiver, int buoyId1, int buoyId2, int channelMap)
    • BuoyStatusDataUnit

      public BuoyStatusDataUnit(NetworkReceiver networkReceiver, BuoyStatusData buoyStatusData)
  • Method Details

    • newDataObject

      public void newDataObject(PamDataBlock dataBlock, PamDataUnit dataUnit, int blockSeq, int receivedBytes)
    • findLastDataUnit

      public PamDataUnit findLastDataUnit(Class unitClass)
      Find the last data unit from this buoy that belongs to the given data block.
      Parameters:
      unitClass - last data block.
      Returns:
      last data unit from that block.
    • unknownPacket

      public void unknownPacket()
      Increment counter of unknown packets.
    • getBuoyName

      public String getBuoyName()
      Get a standard string name for a buoy.
      Returns:
      a standard name in the form 'buoy xxx';
    • getBuoyId1

      public int getBuoyId1()
      Returns:
      the buoyId1
    • getBuoyId2

      public int getBuoyId2()
      Returns:
      the buoyId2
    • getLowestChannel

      public int getLowestChannel()
      The number of the first channel for data from this buoy - since all buoys will have the first channel as zero (I hope) this is basically used as a shift operator on the incoming channel numbers from the network.
      Returns:
      the channel
    • getCreationTime

      public long getCreationTime()
      Returns:
      the creationTime
    • getLastDataTime

      public long getLastDataTime()
      Returns:
      the lastDataTime
    • getTotalPackets

      public int getTotalPackets()
      Returns:
      the totalPackets
    • getBlockPacketCount

      public int getBlockPacketCount(PamDataBlock dataBlock)
    • getBlockPacketRXbytes

      public int getBlockPacketRXbytes(PamDataBlock dataBlock)
    • initialise

      public void initialise()
    • setSocket

      public void setSocket(Socket socket)
    • getSocket

      public Socket getSocket()
      Returns:
      the socket
    • getIPAddr

      public String getIPAddr()
    • getPort

      public String getPort()
    • getGpsData

      public GpsData getGpsData()
      Returns:
      the gpsData
    • setGpsData

      public void setGpsData(long timeMilliseconds, GpsData gpsData)
      Parameters:
      gpsData - the gpsData to set
    • setCompassData

      public void setCompassData(long timeInMillis, double[] compassData)
    • getCompassData

      public double[] getCompassData()
    • getGpsCount

      public int getGpsCount()
    • getPositionString

      public Object getPositionString()
    • setCommandStatus

      public void setCommandStatus(int commandStatus)
      Parameters:
      commandStatus - the commandStatus to set
    • getCommandStatus

      public int getCommandStatus()
      Returns:
      the commandStatus
    • getNetworkReceiver

      public NetworkReceiver getNetworkReceiver()
      Returns:
      the networkReceiver
    • setNetworkReceiver

      public void setNetworkReceiver(NetworkReceiver networkReceiver)
      Parameters:
      networkReceiver - the networkReceiver to set
    • setHydrophoneStreamer

      public void setHydrophoneStreamer(Streamer hydrophoneStreamer)
      Set the hydrophone streamer for the buoy. Also sets a reference to the buoy stats in the streamer.
      Parameters:
      hydrophoneStreamer - the hydrophoneStreamer to set
    • getHydrophoneStreamer

      public Streamer getHydrophoneStreamer()
      Returns:
      the hydrophoneStreamer
    • getUnknownPackets

      public int getUnknownPackets()
      Returns:
      the unknownPackets
    • setPairData

      public void setPairData(String substring, Serializable dataObj)
      Parameters:
      substring -
      substring2 -
    • getPairDataAll

      public Hashtable<String,BuoyStatusValue> getPairDataAll()
    • getPairKeys

      public Set<String> getPairKeys()
    • getPairVal

      public BuoyStatusValue getPairVal(String key)
    • setChannelBitmap

      public void setChannelBitmap(int channelBitmap)
      Description copied from class: PamDataUnit
      Set the channel bitmap (software channels)
      Overrides:
      setChannelBitmap in class PamDataUnit
    • getBuoyStatusData

      public BuoyStatusData getBuoyStatusData()
      Returns:
      the buoyStatusData
    • toString

      public String toString()
      Overrides:
      toString in class Object