Class FrcUserChoices

java.lang.Object
frclib.driverio.FrcUserChoices

public class FrcUserChoices extends Object
This class implements the FrcUserChoices object in which you can add named fields to the smart dashboard allowing the drive team to select various choices for the match. The choices could be related to autonomous, subsystem options, auto-assist or anything you want to alter how the robot program is run.
  • Constructor Details

    • FrcUserChoices

      public FrcUserChoices()
      Constructor: Create an instance of the object.
  • Method Details

    • addChoiceMenu

      public void addChoiceMenu(String key, FrcChoiceMenu<?> choiceMenu)
      This method adds a choice menu to the dmart dashboard. This allows the drive team to pick options such as autonomous strategies, or starting position.
      Parameters:
      key - specifies the dashboard key associated with the choice menu. This also determines which tab the choice menu will be placed on the smart dashboard.
      choiceMenu - specifies the choice menu to be added.
    • addString

      public void addString(String key, String value)
      This method adds a string field to the smart dashboard.
      Parameters:
      key - specifies the dashboard key associated with the string field. This also determines which tab the string field will be placed on the smart dashboard.
      value - specifies the initial string value.
    • addNumber

      public void addNumber(String key, double value)
      This method adds a number field to the smart dashboard.
      Parameters:
      key - specifies the dashboard key associated with the number field. This also determines which tab the number field will be placed on the smart dashboard.
      value - specifies the initial number value.
    • addBoolean

      public void addBoolean(String key, boolean value)
      This method adds a boolean field to the smart dashboard.
      Parameters:
      key - specifies the dashboard key associated with the boolean field. This also determines which tab the boolean will be placed on the smart dashboard.
      value - specifies the initial boolean value.
    • getUserChoice

      public Object getUserChoice(String key)
      This method retrieves the current user choice object associated with the choice menu with the given name.
      Parameters:
      key - specifies the dashboard key associated with the choice menu.
      Returns:
      current choice object from the assoicated choice menu.
    • getUserString

      public String getUserString(String key)
      This method retrieves the current string associated with the string field with the given name.
      Parameters:
      key - specifies the dashboard key associated with the string field.
      Returns:
      current string value from the assoicated string field.
    • getUserNumber

      public double getUserNumber(String key)
      This method retrieves the current number associated with the number field with the given name.
      Parameters:
      key - specifies the dashboard key associated with the number field.
      Returns:
      current number value from the assoicated number field.
    • getUserBoolean

      public boolean getUserBoolean(String key)
      This method retrieves the current boolean associated with the boolean field with the given name.
      Parameters:
      key - specifies the dashboard key associated with the boolean field.
      Returns:
      current boolean value from the assoicated boolean field.