org.ka2ddo.aprs
Enum WeatherEnum

java.lang.Object
  extended by java.lang.Enum<WeatherEnum>
      extended by org.ka2ddo.aprs.WeatherEnum
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<WeatherEnum>, EnumWithImageName, EnumWithUnits

public enum WeatherEnum
extends java.lang.Enum<WeatherEnum>
implements EnumWithImageName, EnumWithUnits

Symbolic codes for different types of weather information. The letter codes correspond to the weather comments in APRS position reports and positionless weather reports, as defined in the APRS protocol specification, chapter 12.

See Also:
PositionReport, PositionlessWeatherReport

Enum Constant Summary
APRS_SA_STATION
          Indicates APRS+SA station sent the weather report.
APRSDOS_STATION
          Indicates APRSdos station sent the weather report.
COURSE
          The wind direction relative to True North (or travel direction for non-weather-stations).
DATE_TIME
          The date and time of a PositionlessWeatherReport.
FLOOD_LEVEL
          Flood level in inches above nominal.
GUST
          Wind peak gust speed in statute miles per hour in the last 5 minutes.
HUMIDITY
          Relative humidity in percent.
LAST_MINUTE_OF_RAIN_DAY
           
LAST_RAIN_OF_DAY
           
LUMINOSITY
          Light intensity in watts per square meter.
MACAPRS_STATION
          Indicates MacAPRS station sent the weather report.
PRESSURE_0_1MBAR
          Barometric pressure in tenths of a millibar.
RAIN_HISTORY
          Internal use only: rain history data structure to infer 24 hours from midnight or vice versa.
RAIN_LAST24HR
          Rain in the last 24 hours in hundredths of an inch.
RAIN_LASTHOUR
          Rain in the last hour in hundredths of an inch.
RAIN_SINCE_MIDNIGHT
          Rain since local midnight in hundredths of an inch.
SNOWFALL
          Snowfall in the last 24 hours in inches.
SPEED
          The wind speed in statute miles per hour (or travel speed for non-weather-stations).
TEMP
          The current temperature in degrees Fahrenheit.
VOLTAGE
          Power voltage in volts.
WINAPRS_STATION
          Indicates that WinAPRS station sent the weather report.
XAPRS_STATION
          Indicates that an X-APRS station (or Xastir?) sent the weather report.
 
Field Summary
 int paramLen
          Number of characters for parameter identified by this enum.
 
Method Summary
 int getDigitsAfterDecimalPoint()
          Get the number of digits after the decimal point that should be displayed for values for this enum.
static WeatherEnum getEnumForLetter(char ch)
          Get the enumeration associated with the weather message letter code.
 java.lang.String getImagePath()
          Return the relative path name of the image file for this enum value.
 char getLetter()
          Get the weather message parameter prefix letter for this parameter type.
 java.lang.Enum<?> getUnit()
          Get the unit (if any) for values for this WeatherEnum,
 float getUnitScaling()
          Get the scaling factor to apply to the unit for values for this WeatherEnum.
 boolean isRequired()
          Report whether an APRS weather message is required to include this parameter.
static WeatherEnum[] nonClonedValues()
          Returns a single copy of the list of WeatherEnums.
 java.lang.String toString()
          Returns the name of this enum constant, as contained in the declaration.
static WeatherEnum valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static WeatherEnum[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

DATE_TIME

public static final WeatherEnum DATE_TIME
The date and time of a PositionlessWeatherReport.

See Also:
PositionlessWeatherReport

COURSE

public static final WeatherEnum COURSE
The wind direction relative to True North (or travel direction for non-weather-stations).


SPEED

public static final WeatherEnum SPEED
The wind speed in statute miles per hour (or travel speed for non-weather-stations).


GUST

public static final WeatherEnum GUST
Wind peak gust speed in statute miles per hour in the last 5 minutes.


TEMP

public static final WeatherEnum TEMP
The current temperature in degrees Fahrenheit.

See Also:
TemperatureUnit

RAIN_LASTHOUR

public static final WeatherEnum RAIN_LASTHOUR
Rain in the last hour in hundredths of an inch.


RAIN_LAST24HR

public static final WeatherEnum RAIN_LAST24HR
Rain in the last 24 hours in hundredths of an inch.


RAIN_SINCE_MIDNIGHT

public static final WeatherEnum RAIN_SINCE_MIDNIGHT
Rain since local midnight in hundredths of an inch.


HUMIDITY

public static final WeatherEnum HUMIDITY
Relative humidity in percent.


PRESSURE_0_1MBAR

public static final WeatherEnum PRESSURE_0_1MBAR
Barometric pressure in tenths of a millibar.


LUMINOSITY

public static final WeatherEnum LUMINOSITY
Light intensity in watts per square meter.


SNOWFALL

public static final WeatherEnum SNOWFALL
Snowfall in the last 24 hours in inches.


FLOOD_LEVEL

public static final WeatherEnum FLOOD_LEVEL
Flood level in inches above nominal.


VOLTAGE

public static final WeatherEnum VOLTAGE
Power voltage in volts.


APRSDOS_STATION

public static final WeatherEnum APRSDOS_STATION
Indicates APRSdos station sent the weather report.


MACAPRS_STATION

public static final WeatherEnum MACAPRS_STATION
Indicates MacAPRS station sent the weather report.


APRS_SA_STATION

public static final WeatherEnum APRS_SA_STATION
Indicates APRS+SA station sent the weather report.


WINAPRS_STATION

public static final WeatherEnum WINAPRS_STATION
Indicates that WinAPRS station sent the weather report.


XAPRS_STATION

public static final WeatherEnum XAPRS_STATION
Indicates that an X-APRS station (or Xastir?) sent the weather report.


RAIN_HISTORY

public static final WeatherEnum RAIN_HISTORY
Internal use only: rain history data structure to infer 24 hours from midnight or vice versa.


LAST_RAIN_OF_DAY

public static final WeatherEnum LAST_RAIN_OF_DAY

LAST_MINUTE_OF_RAIN_DAY

public static final WeatherEnum LAST_MINUTE_OF_RAIN_DAY
Field Detail

paramLen

public final int paramLen
Number of characters for parameter identified by this enum.

Method Detail

values

public static WeatherEnum[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (WeatherEnum c : WeatherEnum.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static WeatherEnum valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getEnumForLetter

public static WeatherEnum getEnumForLetter(char ch)
Get the enumeration associated with the weather message letter code.

Parameters:
ch - letter to match against the known enums
Returns:
WeatherEnum corresponding to the letter, or null if not matching any known weather parameter

getLetter

public char getLetter()
Get the weather message parameter prefix letter for this parameter type.

Returns:
char representing this type of weather information in an APRS weather message

isRequired

public boolean isRequired()
Report whether an APRS weather message is required to include this parameter.

Returns:
boolean true if this parameter is mandatory in an APRS weather message

toString

public java.lang.String toString()
Returns the name of this enum constant, as contained in the declaration. This method may be overridden, though it typically isn't necessary or desirable. An enum type should override this method when a more "programmer-friendly" string form exists.

Overrides:
toString in class java.lang.Enum<WeatherEnum>
Returns:
the name of this enum constant

getImagePath

public java.lang.String getImagePath()
Return the relative path name of the image file for this enum value.

Specified by:
getImagePath in interface EnumWithImageName
Returns:
path name String

getUnit

public java.lang.Enum<?> getUnit()
Get the unit (if any) for values for this WeatherEnum,

Specified by:
getUnit in interface EnumWithUnits
Returns:
unit Enum, or null if no unit known

getUnitScaling

public float getUnitScaling()
Get the scaling factor to apply to the unit for values for this WeatherEnum.

Returns:
float scale factor to apply to unit for displaying value, or Float.NaN if no unit

getDigitsAfterDecimalPoint

public int getDigitsAfterDecimalPoint()
Get the number of digits after the decimal point that should be displayed for values for this enum.

Returns:
digits after the decimal point

nonClonedValues

public static WeatherEnum[] nonClonedValues()
Returns a single copy of the list of WeatherEnums. Callers should ensure they do not modify the returned array, as this could have unpredictable consequences to other users of the array.

Returns:
array of defined WeatherEnum values in enumerated order