Enum Class WeatherEnum

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

public enum WeatherEnum extends 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.
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 Constants
    Enum Constant
    Description
    Indicates 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

    Fields
    Modifier and Type
    Field
    Description
    final int
    Number of characters for parameter identified by this enum.
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    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.
    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<?>
    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.
    Returns the name of this enum constant, as contained in the declaration.
    Returns the enum constant of this class with the specified name.
    static WeatherEnum[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • DATE_TIME

      public static final WeatherEnum DATE_TIME
      The date and time of a PositionlessWeatherReport. In a Long object in milliseconds since Unix epoch.
      See Also:
    • COURSE

      public static final WeatherEnum COURSE
      The wind direction (or travel direction for non-weather-stations) in degrees from True North.
    • SPEED

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

      public static final WeatherEnum GUST
      Wind peak gust speed in statute miles per hour in the last 5 minutes.
      See Also:
    • TEMP

      public static final WeatherEnum TEMP
      The current temperature in degrees Fahrenheit.
      See Also:
    • RAIN_LASTHOUR

      public static final WeatherEnum RAIN_LASTHOUR
      Rain in the last hour in hundredths of an inch.
      See Also:
    • RAIN_LAST24HR

      public static final WeatherEnum RAIN_LAST24HR
      Rain in the last 24 hours in hundredths of an inch.
      See Also:
    • RAIN_SINCE_MIDNIGHT

      public static final WeatherEnum RAIN_SINCE_MIDNIGHT
      Rain since local midnight in hundredths of an inch.
      See Also:
    • 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 millibars (hecto-Pascals).
      See Also:
    • 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.
      See Also:
    • FLOOD_LEVEL

      public static final WeatherEnum 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

      public static final WeatherEnum VOLTAGE
      Power voltage in volts.
    • RADIATION

      public static final WeatherEnum RADIATION
      Radiation level using resistor-code formatting (2 digits of precision plus 10s power exponent) of radiation intensity in nanosieverts per hour.
    • 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.
    • 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 Details

    • paramLen

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

    • values

      public static WeatherEnum[] 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

      public static WeatherEnum valueOf(String name)
      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 name
      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 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 Enum<WeatherEnum>
      Returns:
      the name of this enum constant
    • getImagePath

      public 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 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
    • 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 interface EnumWithUnits
      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

      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