wonderly.jeaprs.aprs.packet
Class APRSPosition

java.lang.Object
  |
  +--wonderly.jeaprs.aprs.packet.APRSData
        |
        +--wonderly.jeaprs.aprs.packet.APRSPosition
All Implemented Interfaces:
APRSEventDataProcessor, APRSPositionData, java.io.Serializable

public class APRSPosition
extends APRSData
implements APRSPositionData

Version:
1.0
Author:
Gregg Wonderly - The information contained in this document is Copyright 2001-2003, Gregg Wonderly, all rights reserved.
See Also:
Serialized Form

Field Summary
static int OBJ_COLOR_BLACK
           
static int OBJ_COLOR_BLUE
           
static int OBJ_COLOR_CYAN
           
static int OBJ_COLOR_GRAY
           
static int OBJ_COLOR_GREEN
           
static int OBJ_COLOR_RED
           
static int OBJ_COLOR_VIOLET
           
static int OBJ_COLOR_YELLOW
           
static int OBJ_INTENS_HIGH
           
static int OBJ_INTENS_LOW
           
static int OBJ_TYPE_BOX
           
static int OBJ_TYPE_CIRCLE
           
static int OBJ_TYPE_ELLIPSE
           
static int OBJ_TYPE_FILLED_BOX
           
static int OBJ_TYPE_FILLED_CIRCLE
           
static int OBJ_TYPE_FILLED_ELLIPSE
           
static int OBJ_TYPE_FILLED_TRIANGLE
           
static int OBJ_TYPE_LINE_DOWN_LEFT
           
static int OBJ_TYPE_LINE_DOWN_RIGHT
           
static int OBJ_TYPE_TRIANGLE
           
static int TYPE_COMPRESSED
           
static int TYPE_MICE
           
static int TYPE_UNCOMPRESSED_WMSG
          Normal posit type
static int TYPE_UNCOMPRESSED_WOMSG
           
 
Fields inherited from class wonderly.jeaprs.aprs.packet.APRSData
altIcons, data, hasOverlaya, hasOverlayn, icon, overlay, packetType
 
Constructor Summary
APRSPosition()
           
APRSPosition(wonderly.jeaprs.ByteString data)
          Parse an APRS position packet.
 
Method Summary
 byte[] formatReportData()
          This method must be implemented by the various packet types to construct the APRS packet data that follows the PATH in a UI frame.
 int getAltitude()
           
 int getAmbiguousDistance()
           
 int[] getAreaObject()
           
 int getCourse()
           
 int[] getDFS()
          Return DFS info or null if not present.
 wonderly.jeaprs.ByteString getGridInfo()
           
 long getLatHundredthsSeconds()
           
 long getLonHundredthsSeconds()
           
 wonderly.jeaprs.ByteString getMessage()
           
 wonderly.jeaprs.ByteString getName()
           
 int[] getNRQ()
           
 int[] getPHG()
          Return PHG info or null if not present.
 int getRange()
           
 int[] getRNG()
          Return RNG info or null if not present.
 int getSpeedInHundredthsMPH()
           
 byte getSymChar()
           
 byte getSymTab()
           
 long getTime()
          Get the time that was provided in the packet (if any).
 boolean hasTime()
           
 boolean isAmbiguous()
           
 boolean isGridOnly()
           
 void processData(wonderly.jeaprs.aprs.packet.APRSPacket pkt, wonderly.jeaprs.aprs.packet.APRSEventListener lis)
          Provide the data in this packet to the passed listener.
 void setAreaObject(int objectType, int objectColor, int objectIntensity)
           
 void setCourse(int v)
           
 void setDFBearingQuality(int bearingQuality)
           
 void setDFNRQ(int numberHits, int bearingQuality, int dfRange)
           
 void setDFNumberHits(int numberHits)
           
 void setDFRange(int dfRange)
           
 void setDirection(int degrees)
          Sets the antenna's coverage/maximum gain direction 0 means omni-directional.
 void setGain(int dbGain)
           
 void setGridOnly(boolean how)
           
 void setHeight(int feet)
           
 void setLatHundredthsSeconds(long latitude)
           
 void setLonHundredthsSeconds(long longitude)
           
 void setPHG(int watts, int feet, int dbGain)
           
 void setPower(int watts)
           
 void setRadioRange(int rangeMiles)
           
 void setSpeedInHundredthsMPH(int val)
           
 void setStrength(int sLevel)
           
 void setSymChar(byte sym)
           
 void setSymTab(byte tab)
           
 void setTime(long time)
          Sets java time value to use in packet.
 void setType(int type)
          Sets the type of packet format for position data that this packet represents.
 java.lang.String toString()
           
 
Methods inherited from class wonderly.jeaprs.aprs.packet.APRSData
addOtherAPRSData, ambiguousDistance, calcIconFrom, fixedToString, formatTime, getIcon, getLatHundredthsSecondsToString, getLatHundrethsSecondsParts, getLatSecondsToString, getLonHundredthsSecondsToString, getLonHundrethsSecondsParts, getLonSecondsToString, getOtherAPRSData, getOverlayIndex, getPrintable, isAltIcon, isNum, isOverlayAlpha, isOverlayNumeric, latHundredthsSecondsAsString, latLonParts, latSecondsAsString, log, lonHundredthsSecondsAsString, lonSecondsAsString, main, numToString, numToString, numToString, parseLat, parseLon, parseTime, sendPacket, toNum, zeroPad, zeroPad, zFill
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface wonderly.jeaprs.aprs.packet.APRSPositionData
getIcon, getLatHundredthsSecondsToString, getLonHundredthsSecondsToString, getOverlayIndex, isAltIcon, isOverlayAlpha, isOverlayNumeric
 

Field Detail

TYPE_UNCOMPRESSED_WMSG

public static final int TYPE_UNCOMPRESSED_WMSG
Normal posit type

See Also:
Constant Field Values

TYPE_UNCOMPRESSED_WOMSG

public static final int TYPE_UNCOMPRESSED_WOMSG
See Also:
Constant Field Values

TYPE_COMPRESSED

public static final int TYPE_COMPRESSED
See Also:
Constant Field Values

TYPE_MICE

public static final int TYPE_MICE
See Also:
Constant Field Values

OBJ_TYPE_CIRCLE

public static final int OBJ_TYPE_CIRCLE
See Also:
Constant Field Values

OBJ_TYPE_LINE_DOWN_RIGHT

public static final int OBJ_TYPE_LINE_DOWN_RIGHT
See Also:
Constant Field Values

OBJ_TYPE_ELLIPSE

public static final int OBJ_TYPE_ELLIPSE
See Also:
Constant Field Values

OBJ_TYPE_TRIANGLE

public static final int OBJ_TYPE_TRIANGLE
See Also:
Constant Field Values

OBJ_TYPE_BOX

public static final int OBJ_TYPE_BOX
See Also:
Constant Field Values

OBJ_TYPE_FILLED_CIRCLE

public static final int OBJ_TYPE_FILLED_CIRCLE
See Also:
Constant Field Values

OBJ_TYPE_LINE_DOWN_LEFT

public static final int OBJ_TYPE_LINE_DOWN_LEFT
See Also:
Constant Field Values

OBJ_TYPE_FILLED_ELLIPSE

public static final int OBJ_TYPE_FILLED_ELLIPSE
See Also:
Constant Field Values

OBJ_TYPE_FILLED_TRIANGLE

public static final int OBJ_TYPE_FILLED_TRIANGLE
See Also:
Constant Field Values

OBJ_TYPE_FILLED_BOX

public static final int OBJ_TYPE_FILLED_BOX
See Also:
Constant Field Values

OBJ_COLOR_BLACK

public static final int OBJ_COLOR_BLACK
See Also:
Constant Field Values

OBJ_COLOR_BLUE

public static final int OBJ_COLOR_BLUE
See Also:
Constant Field Values

OBJ_COLOR_GREEN

public static final int OBJ_COLOR_GREEN
See Also:
Constant Field Values

OBJ_COLOR_CYAN

public static final int OBJ_COLOR_CYAN
See Also:
Constant Field Values

OBJ_COLOR_RED

public static final int OBJ_COLOR_RED
See Also:
Constant Field Values

OBJ_COLOR_VIOLET

public static final int OBJ_COLOR_VIOLET
See Also:
Constant Field Values

OBJ_COLOR_YELLOW

public static final int OBJ_COLOR_YELLOW
See Also:
Constant Field Values

OBJ_COLOR_GRAY

public static final int OBJ_COLOR_GRAY
See Also:
Constant Field Values

OBJ_INTENS_HIGH

public static final int OBJ_INTENS_HIGH
See Also:
Constant Field Values

OBJ_INTENS_LOW

public static final int OBJ_INTENS_LOW
See Also:
Constant Field Values
Constructor Detail

APRSPosition

public APRSPosition()

APRSPosition

public APRSPosition(wonderly.jeaprs.ByteString data)
Parse an APRS position packet. data is the packet portion following the ':' that follows the path component of the packet. e.g. if the packet is W5GGW-7:APJEAP,WIDE3-3:=3604.25N/09753.21Wv, then data would be the =3604.25N/09753.21Wv string.

Method Detail

getGridInfo

public wonderly.jeaprs.ByteString getGridInfo()
Specified by:
getGridInfo in interface APRSPositionData
Overrides:
getGridInfo in class APRSData

isGridOnly

public boolean isGridOnly()
Specified by:
isGridOnly in interface APRSPositionData
Overrides:
isGridOnly in class APRSData

setGridOnly

public void setGridOnly(boolean how)

isAmbiguous

public boolean isAmbiguous()

getAmbiguousDistance

public int getAmbiguousDistance()

getName

public wonderly.jeaprs.ByteString getName()
Specified by:
getName in interface APRSPositionData

getSymTab

public byte getSymTab()

getSymChar

public byte getSymChar()

getAreaObject

public int[] getAreaObject()

setAreaObject

public void setAreaObject(int objectType,
                          int objectColor,
                          int objectIntensity)

setPower

public void setPower(int watts)

setHeight

public void setHeight(int feet)

setGain

public void setGain(int dbGain)

setPHG

public void setPHG(int watts,
                   int feet,
                   int dbGain)

getPHG

public int[] getPHG()
Return PHG info or null if not present.


setStrength

public void setStrength(int sLevel)

setDirection

public void setDirection(int degrees)
Sets the antenna's coverage/maximum gain direction 0 means omni-directional.


getDFS

public int[] getDFS()
Return DFS info or null if not present.


setRadioRange

public void setRadioRange(int rangeMiles)

getRNG

public int[] getRNG()
Return RNG info or null if not present.


setDFNumberHits

public void setDFNumberHits(int numberHits)

setDFBearingQuality

public void setDFBearingQuality(int bearingQuality)

setDFRange

public void setDFRange(int dfRange)

setDFNRQ

public void setDFNRQ(int numberHits,
                     int bearingQuality,
                     int dfRange)

getNRQ

public int[] getNRQ()

getMessage

public wonderly.jeaprs.ByteString getMessage()
Specified by:
getMessage in interface APRSPositionData

toString

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

getLonHundredthsSeconds

public long getLonHundredthsSeconds()
Specified by:
getLonHundredthsSeconds in interface APRSPositionData

getLatHundredthsSeconds

public long getLatHundredthsSeconds()
Specified by:
getLatHundredthsSeconds in interface APRSPositionData

setType

public void setType(int type)
             throws java.lang.IllegalArgumentException
Sets the type of packet format for position data that this packet represents. This is one of the TYPE_* values

java.lang.IllegalArgumentException

getCourse

public int getCourse()
Specified by:
getCourse in interface APRSPositionData

setCourse

public void setCourse(int v)

setSpeedInHundredthsMPH

public void setSpeedInHundredthsMPH(int val)

getSpeedInHundredthsMPH

public int getSpeedInHundredthsMPH()
Specified by:
getSpeedInHundredthsMPH in interface APRSPositionData

getRange

public int getRange()

setSymTab

public void setSymTab(byte tab)

setSymChar

public void setSymChar(byte sym)

getAltitude

public int getAltitude()

setLatHundredthsSeconds

public void setLatHundredthsSeconds(long latitude)

setLonHundredthsSeconds

public void setLonHundredthsSeconds(long longitude)

getTime

public long getTime()
Get the time that was provided in the packet (if any). Call hasTime() first to see if time was provided.

See Also:
hasTime(), setTime(long)

setTime

public void setTime(long time)
Sets java time value to use in packet. 0 is no time, non-zero is exact time. GregorianCalendar can be used to create this correct long given a date and time.

Parameters:
time - the number of milliseconds since midnight 1970 GMT
See Also:
GregorianCalendar

hasTime

public boolean hasTime()

formatReportData

public byte[] formatReportData()
Description copied from class: APRSData
This method must be implemented by the various packet types to construct the APRS packet data that follows the PATH in a UI frame. Thus, if a status packet was to be sent out, this method should return something such as ">My status".getBytes().

Specified by:
formatReportData in class APRSData

processData

public void processData(wonderly.jeaprs.aprs.packet.APRSPacket pkt,
                        wonderly.jeaprs.aprs.packet.APRSEventListener lis)
Provide the data in this packet to the passed listener. This implementation calls lis.position( pkt, this );

Specified by:
processData in interface APRSEventDataProcessor
Overrides:
processData in class APRSData
See Also:
APRSPosition.processData(APRSPacket,APRSEventListener)