Class OpModeOption

java.lang.Object
org.wpilib.hardware.hal.OpModeOption

public class OpModeOption extends Object
An individual opmode option.
  • Field Details

    • id

      public final long id
      Unique id. Encodes robot mode in bits 57-56, LSB 56 bits is hash of name.
    • name

      public final String name
    • group

      public final String group
    • description

      public final String description
    • textColor

      public final int textColor
    • backgroundColor

      public final int backgroundColor
  • Constructor Details

    • OpModeOption

      public OpModeOption(long id, String name, String group, String description, int textColor, int backgroundColor)
      Constructor.
      Parameters:
      id - id
      name - name
      group - group
      description - description
      textColor - text color (0x00RRGGBB or -1 for default)
      backgroundColor - background color (0x00RRGGBB or -1 for default)
  • Method Details

    • getMode

      public RobotMode getMode()
      Gets the robot mode encoded in the ID.
      Returns:
      robot mode
    • makeId

      public static long makeId(RobotMode mode, long hash)
      Makes an ID from a robot mode and a hash.
      Parameters:
      mode - robot mode
      hash - hash of name
      Returns:
      ID