![]()  | 
  
    WPILibC++ 2025.3.2
    
   | 
 
Class to control a simulated analog input. More...
#include <frc/simulation/AnalogInputSim.h>
Public Member Functions | |
| AnalogInputSim (const AnalogInput &analogInput) | |
| Constructs from an AnalogInput object.   | |
| AnalogInputSim (int channel) | |
| Constructs from an analog input channel number.   | |
| std::unique_ptr< CallbackStore > | RegisterInitializedCallback (NotifyCallback callback, bool initialNotify) | 
| Register a callback on whether the analog input is initialized.   | |
| bool | GetInitialized () const | 
| Check if this analog input has been initialized.   | |
| void | SetInitialized (bool initialized) | 
| Change whether this analog input has been initialized.   | |
| std::unique_ptr< CallbackStore > | RegisterAverageBitsCallback (NotifyCallback callback, bool initialNotify) | 
| Register a callback on the number of average bits.   | |
| int | GetAverageBits () const | 
| Get the number of average bits.   | |
| void | SetAverageBits (int averageBits) | 
| Change the number of average bits.   | |
| std::unique_ptr< CallbackStore > | RegisterOversampleBitsCallback (NotifyCallback callback, bool initialNotify) | 
| Register a callback on the amount of oversampling bits.   | |
| int | GetOversampleBits () const | 
| Get the amount of oversampling bits.   | |
| void | SetOversampleBits (int oversampleBits) | 
| Change the amount of oversampling bits.   | |
| std::unique_ptr< CallbackStore > | RegisterVoltageCallback (NotifyCallback callback, bool initialNotify) | 
| Register a callback on the voltage.   | |
| double | GetVoltage () const | 
| Get the voltage.   | |
| void | SetVoltage (double voltage) | 
| Change the voltage.   | |
| std::unique_ptr< CallbackStore > | RegisterAccumulatorInitializedCallback (NotifyCallback callback, bool initialNotify) | 
| Register a callback on whether the accumulator is initialized.   | |
| bool | GetAccumulatorInitialized () const | 
| Check if the accumulator has been initialized.   | |
| void | SetAccumulatorInitialized (bool accumulatorInitialized) | 
| Change whether the accumulator has been initialized.   | |
| std::unique_ptr< CallbackStore > | RegisterAccumulatorValueCallback (NotifyCallback callback, bool initialNotify) | 
| Register a callback on the accumulator value.   | |
| int64_t | GetAccumulatorValue () const | 
| Get the accumulator value.   | |
| void | SetAccumulatorValue (int64_t accumulatorValue) | 
| Change the accumulator value.   | |
| std::unique_ptr< CallbackStore > | RegisterAccumulatorCountCallback (NotifyCallback callback, bool initialNotify) | 
| Register a callback on the accumulator count.   | |
| int64_t | GetAccumulatorCount () const | 
| Get the accumulator count.   | |
| void | SetAccumulatorCount (int64_t accumulatorCount) | 
| Change the accumulator count.   | |
| std::unique_ptr< CallbackStore > | RegisterAccumulatorCenterCallback (NotifyCallback callback, bool initialNotify) | 
| Register a callback on the accumulator center.   | |
| int | GetAccumulatorCenter () const | 
| Get the accumulator center.   | |
| void | SetAccumulatorCenter (int accumulatorCenter) | 
| Change the accumulator center.   | |
| std::unique_ptr< CallbackStore > | RegisterAccumulatorDeadbandCallback (NotifyCallback callback, bool initialNotify) | 
| Register a callback on the accumulator deadband.   | |
| int | GetAccumulatorDeadband () const | 
| Get the accumulator deadband.   | |
| void | SetAccumulatorDeadband (int accumulatorDeadband) | 
| Change the accumulator deadband.   | |
| void | ResetData () | 
| Reset all simulation data for this object.   | |
Class to control a simulated analog input.
      
  | 
  explicit | 
Constructs from an AnalogInput object.
| analogInput | AnalogInput to simulate | 
      
  | 
  explicit | 
Constructs from an analog input channel number.
| channel | Channel number | 
| int frc::sim::AnalogInputSim::GetAccumulatorCenter | ( | ) | const | 
Get the accumulator center.
| int64_t frc::sim::AnalogInputSim::GetAccumulatorCount | ( | ) | const | 
Get the accumulator count.
| int frc::sim::AnalogInputSim::GetAccumulatorDeadband | ( | ) | const | 
Get the accumulator deadband.
| bool frc::sim::AnalogInputSim::GetAccumulatorInitialized | ( | ) | const | 
Check if the accumulator has been initialized.
| int64_t frc::sim::AnalogInputSim::GetAccumulatorValue | ( | ) | const | 
Get the accumulator value.
| int frc::sim::AnalogInputSim::GetAverageBits | ( | ) | const | 
Get the number of average bits.
| bool frc::sim::AnalogInputSim::GetInitialized | ( | ) | const | 
Check if this analog input has been initialized.
| int frc::sim::AnalogInputSim::GetOversampleBits | ( | ) | const | 
Get the amount of oversampling bits.
| double frc::sim::AnalogInputSim::GetVoltage | ( | ) | const | 
Get the voltage.
      
  | 
  nodiscard | 
Register a callback on the accumulator center.
| callback | the callback that will be called whenever the accumulator center is changed | 
| initialNotify | if true, the callback will be run on the initial value | 
      
  | 
  nodiscard | 
Register a callback on the accumulator count.
| callback | the callback that will be called whenever the accumulator count is changed | 
| initialNotify | if true, the callback will be run on the initial value | 
      
  | 
  nodiscard | 
Register a callback on the accumulator deadband.
| callback | the callback that will be called whenever the accumulator deadband is changed | 
| initialNotify | if true, the callback will be run on the initial value | 
      
  | 
  nodiscard | 
Register a callback on whether the accumulator is initialized.
| callback | the callback that will be called whenever the accumulator is initialized | 
| initialNotify | if true, the callback will be run on the initial value | 
      
  | 
  nodiscard | 
Register a callback on the accumulator value.
| callback | the callback that will be called whenever the accumulator value is changed | 
| initialNotify | if true, the callback will be run on the initial value | 
      
  | 
  nodiscard | 
Register a callback on the number of average bits.
| callback | the callback that will be called whenever the number of average bits is changed | 
| initialNotify | if true, the callback will be run on the initial value | 
      
  | 
  nodiscard | 
Register a callback on whether the analog input is initialized.
| callback | the callback that will be called whenever the analog input is initialized | 
| initialNotify | if true, the callback will be run on the initial value | 
      
  | 
  nodiscard | 
Register a callback on the amount of oversampling bits.
| callback | the callback that will be called whenever the oversampling bits are changed | 
| initialNotify | if true, the callback will be run on the initial value | 
      
  | 
  nodiscard | 
Register a callback on the voltage.
| callback | the callback that will be called whenever the voltage is changed | 
| initialNotify | if true, the callback will be run on the initial value | 
| void frc::sim::AnalogInputSim::ResetData | ( | ) | 
Reset all simulation data for this object.
| void frc::sim::AnalogInputSim::SetAccumulatorCenter | ( | int | accumulatorCenter | ) | 
Change the accumulator center.
| accumulatorCenter | the new center | 
| void frc::sim::AnalogInputSim::SetAccumulatorCount | ( | int64_t | accumulatorCount | ) | 
Change the accumulator count.
| accumulatorCount | the new count. | 
| void frc::sim::AnalogInputSim::SetAccumulatorDeadband | ( | int | accumulatorDeadband | ) | 
Change the accumulator deadband.
| accumulatorDeadband | the new deadband | 
| void frc::sim::AnalogInputSim::SetAccumulatorInitialized | ( | bool | accumulatorInitialized | ) | 
Change whether the accumulator has been initialized.
| accumulatorInitialized | the new value | 
| void frc::sim::AnalogInputSim::SetAccumulatorValue | ( | int64_t | accumulatorValue | ) | 
Change the accumulator value.
| accumulatorValue | the new value | 
| void frc::sim::AnalogInputSim::SetAverageBits | ( | int | averageBits | ) | 
Change the number of average bits.
| averageBits | the new value | 
| void frc::sim::AnalogInputSim::SetInitialized | ( | bool | initialized | ) | 
Change whether this analog input has been initialized.
| initialized | the new value | 
| void frc::sim::AnalogInputSim::SetOversampleBits | ( | int | oversampleBits | ) | 
Change the amount of oversampling bits.
| oversampleBits | the new value | 
| void frc::sim::AnalogInputSim::SetVoltage | ( | double | voltage | ) | 
Change the voltage.
| voltage | the new value |