java.lang.Object
java.lang.Enum<CruiseControlEnum>
io.github.lunasaw.gb28181.common.entity.control.instruction.enums.CruiseControlEnum
All Implemented Interfaces:
Serializable, Comparable<CruiseControlEnum>, java.lang.constant.Constable

public enum CruiseControlEnum extends Enum<CruiseControlEnum>
巡航指令枚举 根据 A.3.5 巡航指令 规范实现
  • Enum Constant Details

  • Method Details

    • values

      public static CruiseControlEnum[] 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 CruiseControlEnum 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
    • getByCode

      public static CruiseControlEnum getByCode(byte code)
      根据指令码查找枚举
    • getByName

      public static CruiseControlEnum getByName(String name)
      根据名称查找枚举
    • isValidGroupNumber

      public static boolean isValidGroupNumber(int groupNumber)
      验证巡航组号是否有效
      Parameters:
      groupNumber - 巡航组号 (0-255)
      Returns:
      是否有效
    • isValidPresetNumber

      public static boolean isValidPresetNumber(int presetNumber)
      验证预置位号是否有效
      Parameters:
      presetNumber - 预置位号 (1-255)
      Returns:
      是否有效
    • isValidSpeed

      public static boolean isValidSpeed(int speed)
      验证速度值是否有效
      Parameters:
      speed - 速度 (数据的低8位在字节6,高4位在字节7的高4位)
      Returns:
      是否有效
    • isValidStayTime

      public static boolean isValidStayTime(int stayTime)
      验证停留时间是否有效
      Parameters:
      stayTime - 停留时间(秒) (数据的低8位在字节6,高4位在字节7的高4位)
      Returns:
      是否有效