Class DiscreteInput


  • public abstract class DiscreteInput
    extends Input
    First abstraction of Input representing "discrete" Inputs such as hall effect and LIDAR sensors.
    • Constructor Detail

      • DiscreteInput

        public DiscreteInput​(java.lang.String p_name)
        Constructor simply passes on name.
        Parameters:
        p_name - Name of the Input.
      • DiscreteInput

        public DiscreteInput​(java.lang.String p_name,
                             int p_default)
        Constructor with default value.
        Parameters:
        p_name - Name of the Input.
        p_default - Default value of the Input.
    • Method Detail

      • readDataFromInput

        public void readDataFromInput()
        Processes raw value read from Input's hardware.
        Specified by:
        readDataFromInput in class Input
      • setValue

        public void setValue​(int p_newValue)
        Takes a new value stores it and notifys listeners. This is a public version of setNewValue() for manual value updating.
        Parameters:
        p_newValue - New value read for the Input.
      • readRawValue

        protected abstract int readRawValue()
        Abstract function to request and return the raw value from hardware.
        Returns:
        The latest value read from hardware.
      • getValue

        public int getValue()
        Returns the latest stored value from the Input.
        Returns:
        Latest value store in the Input.