Package jmri

Interface AnalogIO

All Superinterfaces:
Comparable<NamedBean>, NamedBean, PropertyChangeProvider
All Known Subinterfaces:
AverageMeter, CurrentMeter, Meter, VariableLight, VoltageMeter
All Known Implementing Classes:
AbstractAnalogIO, AbstractVariableLight, AnymaDMX_UsbLight, BiDiBLight, DefaultAverageMeter, DefaultMeter, DefaultMeter.DefaultCurrentMeter, DefaultMeter.DefaultVoltageMeter, MqttLight, SerialLight, SerialX10Light, SpecificDmxLight, SpecificInsteonLight, SpecificInsteonLight, SpecificLight, SpecificLight, SpecificLight, SpecificX10Light, SpecificX10Light

public interface AnalogIO extends NamedBean
Represent an analog I/O on the layout.
  • Method Details

    • isConsistentValue

      Show whether the analog value is stable.
      Returns:
      true if the analog value is stable
    • setCommandedAnalogValue

      void setCommandedAnalogValue(double value) throws JmriException
      Change the commanded value, which results in the relevant command(s) being sent to the hardware. The exception is thrown if there are problems communicating with the layout hardware.

      The value must be a valid number, not a NaN or infinity number.

      Parameters:
      value - the desired analog value
      Throws:
      JmriException - general error when setting the value fails
      IllegalArgumentException - if the value is Double.NaN, Double.NEGATIVE_INFINITY or Double.POSITIVE_INFINITY
    • getCommandedAnalogValue

      Query the commanded value. This is a bound parameter, so you can also register a listener to be informed of changes.

      The result must be a valid number, not a NaN or infinity number.

      Returns:
      the analog value
    • getKnownAnalogValue

      Query the known analog value. This is a bound parameter, so you can also register a listener to be informed of changes. A result is always returned; if no other feedback method is available, the commanded value will be used.

      The result must be a valid number, not a NaN or infinity number.

      Returns:
      the known analog value
    • setState

      @InvokeOnLayoutThread void setState(double value) throws JmriException
      Provide generic access to internal state.

      This generally shouldn't be used by Java code; use the class-specific form instead (setCommandedAnalogValue). This is provided to make scripts access easier to read.

      Parameters:
      value - the analog value
      Throws:
      JmriException - general error when setting the state fails
    • getState

      @CheckReturnValue double getState(double v)
      Provide generic access to internal state.

      This generally shouldn't be used by Java code; use the class-specific form instead (getCommandedAnalogValue). This is provided to make scripts easier to read.

      Parameters:
      v - only used to select this method which returns an analog value. It's recommended to use 0.0 as the parameter.
      Returns:
      the state
    • getMin

      Get the minimum value of this AnalogIO.
      Returns:
      minimum value.
    • getMax

      Get the maximum value of this AnalogIO.
      Returns:
      maximum value.
    • getResolution

      Get the resolution of this AnalogIO.
      Returns:
      analog resolution.
    • getAbsoluteOrRelative

      Is this AnalogIO absolute or relative?
      Returns:
      if absolute or relative.
    • requestUpdateFromLayout

      default void requestUpdateFromLayout()
      Request an update from the layout soft/hardware. May not even happen, and if it does it will happen later; listen for the result.