WPILibC++ 2024.3.2
frc::sim::AnalogOutputSim Class Reference

Class to control a simulated analog output. More...

#include <frc/simulation/AnalogOutputSim.h>

Public Member Functions

 AnalogOutputSim (const AnalogOutput &analogOutput)
 Constructs from an AnalogOutput object. More...
 
 AnalogOutputSim (int channel)
 Constructs from an analog output channel number. More...
 
std::unique_ptr< CallbackStoreRegisterVoltageCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run whenever the voltage changes. More...
 
double GetVoltage () const
 Read the analog output voltage. More...
 
void SetVoltage (double voltage)
 Set the analog output voltage. More...
 
std::unique_ptr< CallbackStoreRegisterInitializedCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run when this analog output is initialized. More...
 
bool GetInitialized () const
 Check whether this analog output has been initialized. More...
 
void SetInitialized (bool initialized)
 Define whether this analog output has been initialized. More...
 
void ResetData ()
 Reset all simulation data on this object. More...
 

Detailed Description

Class to control a simulated analog output.

Constructor & Destructor Documentation

◆ AnalogOutputSim() [1/2]

frc::sim::AnalogOutputSim::AnalogOutputSim ( const AnalogOutput analogOutput)
explicit

Constructs from an AnalogOutput object.

Parameters
analogOutputAnalogOutput to simulate

◆ AnalogOutputSim() [2/2]

frc::sim::AnalogOutputSim::AnalogOutputSim ( int  channel)
explicit

Constructs from an analog output channel number.

Parameters
channelChannel number

Member Function Documentation

◆ GetInitialized()

bool frc::sim::AnalogOutputSim::GetInitialized ( ) const

Check whether this analog output has been initialized.

Returns
true if initialized

◆ GetVoltage()

double frc::sim::AnalogOutputSim::GetVoltage ( ) const

Read the analog output voltage.

Returns
the voltage on this analog output

◆ RegisterInitializedCallback()

std::unique_ptr< CallbackStore > frc::sim::AnalogOutputSim::RegisterInitializedCallback ( NotifyCallback  callback,
bool  initialNotify 
)

Register a callback to be run when this analog output is initialized.

Parameters
callbackthe callback
initialNotifywhether to run the callback with the initial state
Returns
the CallbackStore object associated with this callback

◆ RegisterVoltageCallback()

std::unique_ptr< CallbackStore > frc::sim::AnalogOutputSim::RegisterVoltageCallback ( NotifyCallback  callback,
bool  initialNotify 
)

Register a callback to be run whenever the voltage changes.

Parameters
callbackthe callback
initialNotifywhether to call the callback with the initial state
Returns
the CallbackStore object associated with this callback

◆ ResetData()

void frc::sim::AnalogOutputSim::ResetData ( )

Reset all simulation data on this object.

◆ SetInitialized()

void frc::sim::AnalogOutputSim::SetInitialized ( bool  initialized)

Define whether this analog output has been initialized.

Parameters
initializedwhether this object is initialized

◆ SetVoltage()

void frc::sim::AnalogOutputSim::SetVoltage ( double  voltage)

Set the analog output voltage.

Parameters
voltagethe new voltage on this analog output

The documentation for this class was generated from the following file: