Class AnalogOutputSim

java.lang.Object
edu.wpi.first.wpilibj.simulation.AnalogOutputSim

public class AnalogOutputSim
extends Object
Class to control a simulated analog output.
  • Constructor Details

  • Method Details

    • registerVoltageCallback

      public CallbackStore registerVoltageCallback​(NotifyCallback callback, boolean initialNotify)
      Register a callback to be run whenever the voltage changes.
      Parameters:
      callback - the callback
      initialNotify - whether to call the callback with the initial state
      Returns:
      the CallbackStore object associated with this callback. Save a reference to this object so GC doesn't cancel the callback.
    • getVoltage

      public double getVoltage()
      Read the analog output voltage.
      Returns:
      the voltage on this analog output
    • setVoltage

      public void setVoltage​(double voltage)
      Set the analog output voltage.
      Parameters:
      voltage - the new voltage on this analog output
    • registerInitializedCallback

      public CallbackStore registerInitializedCallback​(NotifyCallback callback, boolean initialNotify)
      Register a callback to be run when this analog output is initialized.
      Parameters:
      callback - the callback
      initialNotify - whether to run the callback with the initial state
      Returns:
      the CallbackStore object associated with this callback. Save a reference to this object so GC doesn't cancel the callback.
    • getInitialized

      public boolean getInitialized()
      Check whether this analog output has been initialized.
      Returns:
      true if initialized
    • setInitialized

      public void setInitialized​(boolean initialized)
      Define whether this analog output has been initialized.
      Parameters:
      initialized - whether this object is initialized
    • resetData

      public void resetData()
      Reset all simulation data on this object.