Package org.ka2ddo.aprs
Enum Class WeatherEnum
- All Implemented Interfaces:
Serializable
,Comparable<WeatherEnum>
,Constable
,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.
- Author:
- Andrew Pavlin, KA2DDO
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionIndicates APRS+SA station sent the weather report.Indicates APRSdos station sent the weather report.The wind direction (or travel direction for non-weather-stations) in degrees from True North.The date and time of a PositionlessWeatherReport.Flood level in tenths of inches above nominal.Wind peak gust speed in statute miles per hour in the last 5 minutes.Relative humidity in percent.Light intensity in watts per square meter.Indicates MacAPRS station sent the weather report.Barometric pressure in tenths of millibars (hecto-Pascals).Radiation level using resistor-code formatting (2 digits of precision plus 10s power exponent) of radiation intensity in nanosieverts per hour.Internal use only: rain history data structure to infer 24 hours from midnight or vice versa.Rain in the last 24 hours in hundredths of an inch.Rain in the last hour in hundredths of an inch.Rain since local midnight in hundredths of an inch.Snowfall in the last 24 hours in inches.The wind speed in statute miles per hour (or travel speed for non-weather-stations).The current temperature in degrees Fahrenheit.Power voltage in volts.Indicates that WinAPRS station sent the weather report. -
Field Summary
Modifier and TypeFieldDescriptionfinal int
Number of characters for parameter identified by this enum. -
Method Summary
Modifier and TypeMethodDescriptionfloat
decodeValue
(int encodedValue) Convert a numeric value from APRS encoding format to actual numeric value.int
encodeValue
(float rawValue) Convert a raw numeric value into the encoding that would be used for APRS packet creation.int
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.Return the relative path name of the image file for this enum value.char
Get the weather message parameter prefix letter for this parameter type.Enum<?>
getUnit()
Get the unit (if any) for values for this WeatherEnum,float
Get the scaling factor to apply to the unit for values for this WeatherEnum.boolean
Report whether an APRS weather message is required to include this parameter.boolean
Indicate whether values and units should be interpreted as a rate over an appropriate time unit rather than a fixed quantity.static WeatherEnum[]
Returns a single copy of the list of WeatherEnums.toString()
Returns the name of this enum constant, as contained in the declaration.static WeatherEnum
Returns the enum constant of this class with the specified name.static WeatherEnum[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DATE_TIME
The date and time of a PositionlessWeatherReport. In a Long object in milliseconds since Unix epoch.- See Also:
-
COURSE
The wind direction (or travel direction for non-weather-stations) in degrees from True North. -
SPEED
The wind speed in statute miles per hour (or travel speed for non-weather-stations).- See Also:
-
GUST
Wind peak gust speed in statute miles per hour in the last 5 minutes.- See Also:
-
TEMP
The current temperature in degrees Fahrenheit.- See Also:
-
RAIN_LASTHOUR
Rain in the last hour in hundredths of an inch.- See Also:
-
RAIN_LAST24HR
Rain in the last 24 hours in hundredths of an inch.- See Also:
-
RAIN_SINCE_MIDNIGHT
Rain since local midnight in hundredths of an inch.- See Also:
-
HUMIDITY
Relative humidity in percent. -
PRESSURE_0_1MBAR
Barometric pressure in tenths of millibars (hecto-Pascals).- See Also:
-
LUMINOSITY
Light intensity in watts per square meter. -
SNOWFALL
Snowfall in the last 24 hours in inches.- See Also:
-
FLOOD_LEVEL
Flood level in tenths of inches above nominal. Note this value can be negative for a drought (low water) condition.- See Also:
-
VOLTAGE
Power voltage in volts. -
RADIATION
Radiation level using resistor-code formatting (2 digits of precision plus 10s power exponent) of radiation intensity in nanosieverts per hour. -
APRSDOS_STATION
Indicates APRSdos station sent the weather report. -
MACAPRS_STATION
Indicates MacAPRS station sent the weather report. -
APRS_SA_STATION
Indicates APRS+SA station sent the weather report. -
WINAPRS_STATION
Indicates that WinAPRS station sent the weather report. -
RAIN_HISTORY
Internal use only: rain history data structure to infer 24 hours from midnight or vice versa. -
LAST_RAIN_OF_DAY
-
LAST_MINUTE_OF_RAIN_DAY
-
-
Field Details
-
paramLen
public final int paramLenNumber of characters for parameter identified by this enum.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getEnumForLetter
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
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 classEnum<WeatherEnum>
- Returns:
- the name of this enum constant
-
getImagePath
Return the relative path name of the image file for this enum value.- Specified by:
getImagePath
in interfaceEnumWithImageName
- Returns:
- path name String
-
getUnit
Get the unit (if any) for values for this WeatherEnum,- Specified by:
getUnit
in interfaceEnumWithUnits
- Returns:
- unit Enum, or null if no unit known
-
isUnitARate
public boolean isUnitARate()Indicate whether values and units should be interpreted as a rate over an appropriate time unit rather than a fixed quantity.- Specified by:
isUnitARate
in interfaceEnumWithUnits
- Returns:
- boolean true if unit is a rate rather than a scalar
-
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
-
decodeValue
public float decodeValue(int encodedValue) Convert a numeric value from APRS encoding format to actual numeric value.- Parameters:
encodedValue
- int value of encoded digits- Returns:
- decoded value as a float
-
encodeValue
public int encodeValue(float rawValue) Convert a raw numeric value into the encoding that would be used for APRS packet creation.- Parameters:
rawValue
- float raw value- Returns:
- encoded value as an int that can be formatted into an APRS packet
-
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
-