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

A utility class to control a simulated RoboRIO. More...

#include <frc/simulation/RoboRioSim.h>

Static Public Member Functions

static std::unique_ptr< CallbackStoreRegisterFPGAButtonCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run when the FPGA button state changes. More...
 
static bool GetFPGAButton ()
 Query the state of the FPGA button. More...
 
static void SetFPGAButton (bool fPGAButton)
 Define the state of the FPGA button. More...
 
static std::unique_ptr< CallbackStoreRegisterVInVoltageCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run whenever the Vin voltage changes. More...
 
static units::volt_t GetVInVoltage ()
 Measure the Vin voltage. More...
 
static void SetVInVoltage (units::volt_t vInVoltage)
 Define the Vin voltage. More...
 
static std::unique_ptr< CallbackStoreRegisterVInCurrentCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run whenever the Vin current changes. More...
 
static units::ampere_t GetVInCurrent ()
 Measure the Vin current. More...
 
static void SetVInCurrent (units::ampere_t vInCurrent)
 Define the Vin current. More...
 
static std::unique_ptr< CallbackStoreRegisterUserVoltage6VCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run whenever the 6V rail voltage changes. More...
 
static units::volt_t GetUserVoltage6V ()
 Measure the 6V rail voltage. More...
 
static void SetUserVoltage6V (units::volt_t userVoltage6V)
 Define the 6V rail voltage. More...
 
static std::unique_ptr< CallbackStoreRegisterUserCurrent6VCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run whenever the 6V rail current changes. More...
 
static units::ampere_t GetUserCurrent6V ()
 Measure the 6V rail current. More...
 
static void SetUserCurrent6V (units::ampere_t userCurrent6V)
 Define the 6V rail current. More...
 
static std::unique_ptr< CallbackStoreRegisterUserActive6VCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run whenever the 6V rail active state changes. More...
 
static bool GetUserActive6V ()
 Get the 6V rail active state. More...
 
static void SetUserActive6V (bool userActive6V)
 Set the 6V rail active state. More...
 
static std::unique_ptr< CallbackStoreRegisterUserVoltage5VCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run whenever the 5V rail voltage changes. More...
 
static units::volt_t GetUserVoltage5V ()
 Measure the 5V rail voltage. More...
 
static void SetUserVoltage5V (units::volt_t userVoltage5V)
 Define the 5V rail voltage. More...
 
static std::unique_ptr< CallbackStoreRegisterUserCurrent5VCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run whenever the 5V rail current changes. More...
 
static units::ampere_t GetUserCurrent5V ()
 Measure the 5V rail current. More...
 
static void SetUserCurrent5V (units::ampere_t userCurrent5V)
 Define the 5V rail current. More...
 
static std::unique_ptr< CallbackStoreRegisterUserActive5VCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run whenever the 5V rail active state changes. More...
 
static bool GetUserActive5V ()
 Get the 5V rail active state. More...
 
static void SetUserActive5V (bool userActive5V)
 Set the 5V rail active state. More...
 
static std::unique_ptr< CallbackStoreRegisterUserVoltage3V3Callback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run whenever the 3.3V rail voltage changes. More...
 
static units::volt_t GetUserVoltage3V3 ()
 Measure the 3.3V rail voltage. More...
 
static void SetUserVoltage3V3 (units::volt_t userVoltage3V3)
 Define the 3.3V rail voltage. More...
 
static std::unique_ptr< CallbackStoreRegisterUserCurrent3V3Callback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run whenever the 3.3V rail current changes. More...
 
static units::ampere_t GetUserCurrent3V3 ()
 Measure the 3.3V rail current. More...
 
static void SetUserCurrent3V3 (units::ampere_t userCurrent3V3)
 Define the 3.3V rail current. More...
 
static std::unique_ptr< CallbackStoreRegisterUserActive3V3Callback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run whenever the 3.3V rail active state changes. More...
 
static bool GetUserActive3V3 ()
 Get the 3.3V rail active state. More...
 
static void SetUserActive3V3 (bool userActive3V3)
 Set the 3.3V rail active state. More...
 
static std::unique_ptr< CallbackStoreRegisterUserFaults6VCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run whenever the 6V rail number of faults changes. More...
 
static int GetUserFaults6V ()
 Get the 6V rail number of faults. More...
 
static void SetUserFaults6V (int userFaults6V)
 Set the 6V rail number of faults. More...
 
static std::unique_ptr< CallbackStoreRegisterUserFaults5VCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run whenever the 5V rail number of faults changes. More...
 
static int GetUserFaults5V ()
 Get the 5V rail number of faults. More...
 
static void SetUserFaults5V (int userFaults5V)
 Set the 5V rail number of faults. More...
 
static std::unique_ptr< CallbackStoreRegisterUserFaults3V3Callback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run whenever the 3.3V rail number of faults changes. More...
 
static int GetUserFaults3V3 ()
 Get the 3.3V rail number of faults. More...
 
static void SetUserFaults3V3 (int userFaults3V3)
 Set the 3.3V rail number of faults. More...
 
static std::unique_ptr< CallbackStoreRegisterBrownoutVoltageCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run whenever the brownout voltage changes. More...
 
static units::volt_t GetBrownoutVoltage ()
 Measure the brownout voltage. More...
 
static void SetBrownoutVoltage (units::volt_t brownoutVoltage)
 Define the brownout voltage. More...
 
static std::unique_ptr< CallbackStoreRegisterCPUTempCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run whenever the cpu temp changes. More...
 
static units::celsius_t GetCPUTemp ()
 Get the cpu temp. More...
 
static void SetCPUTemp (units::celsius_t cpuTemp)
 Define the cpu temp. More...
 
static std::unique_ptr< CallbackStoreRegisterTeamNumberCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run whenever the team number changes. More...
 
static int32_t GetTeamNumber ()
 Get the team number. More...
 
static void SetTeamNumber (int32_t teamNumber)
 Set the team number. More...
 
static std::string GetSerialNumber ()
 Get the serial number. More...
 
static void SetSerialNumber (std::string_view serialNumber)
 Set the serial number. More...
 
static std::string GetComments ()
 Get the comments. More...
 
static void SetComments (std::string_view comments)
 Set the comments. More...
 
static std::unique_ptr< CallbackStoreRegisterRadioLEDStateCallback (NotifyCallback callback, bool initialNotify)
 Register a callback to be run whenever the Radio led state changes. More...
 
static RadioLEDState GetRadioLEDState ()
 Get the state of the radio led. More...
 
static void SetRadioLEDState (RadioLEDState state)
 Set the state of the radio led. More...
 
static void ResetData ()
 Reset all simulation data. More...
 

Detailed Description

A utility class to control a simulated RoboRIO.

Member Function Documentation

◆ GetBrownoutVoltage()

static units::volt_t frc::sim::RoboRioSim::GetBrownoutVoltage ( )
static

Measure the brownout voltage.

Returns
the brownout voltage

◆ GetComments()

static std::string frc::sim::RoboRioSim::GetComments ( )
static

Get the comments.

Returns
The comments.

◆ GetCPUTemp()

static units::celsius_t frc::sim::RoboRioSim::GetCPUTemp ( )
static

Get the cpu temp.

Returns
the cpu temp.

◆ GetFPGAButton()

static bool frc::sim::RoboRioSim::GetFPGAButton ( )
static

Query the state of the FPGA button.

Returns
the FPGA button state

◆ GetRadioLEDState()

static RadioLEDState frc::sim::RoboRioSim::GetRadioLEDState ( )
static

Get the state of the radio led.

Returns
The state of the radio led.

◆ GetSerialNumber()

static std::string frc::sim::RoboRioSim::GetSerialNumber ( )
static

Get the serial number.

Returns
The serial number.

◆ GetTeamNumber()

static int32_t frc::sim::RoboRioSim::GetTeamNumber ( )
static

Get the team number.

Returns
the team number.

◆ GetUserActive3V3()

static bool frc::sim::RoboRioSim::GetUserActive3V3 ( )
static

Get the 3.3V rail active state.

Returns
true if the 3.3V rail is active

◆ GetUserActive5V()

static bool frc::sim::RoboRioSim::GetUserActive5V ( )
static

Get the 5V rail active state.

Returns
true if the 5V rail is active

◆ GetUserActive6V()

static bool frc::sim::RoboRioSim::GetUserActive6V ( )
static

Get the 6V rail active state.

Returns
true if the 6V rail is active

◆ GetUserCurrent3V3()

static units::ampere_t frc::sim::RoboRioSim::GetUserCurrent3V3 ( )
static

Measure the 3.3V rail current.

Returns
the 3.3V rail current

◆ GetUserCurrent5V()

static units::ampere_t frc::sim::RoboRioSim::GetUserCurrent5V ( )
static

Measure the 5V rail current.

Returns
the 5V rail current

◆ GetUserCurrent6V()

static units::ampere_t frc::sim::RoboRioSim::GetUserCurrent6V ( )
static

Measure the 6V rail current.

Returns
the 6V rail current

◆ GetUserFaults3V3()

static int frc::sim::RoboRioSim::GetUserFaults3V3 ( )
static

Get the 3.3V rail number of faults.

Returns
number of faults

◆ GetUserFaults5V()

static int frc::sim::RoboRioSim::GetUserFaults5V ( )
static

Get the 5V rail number of faults.

Returns
number of faults

◆ GetUserFaults6V()

static int frc::sim::RoboRioSim::GetUserFaults6V ( )
static

Get the 6V rail number of faults.

Returns
number of faults

◆ GetUserVoltage3V3()

static units::volt_t frc::sim::RoboRioSim::GetUserVoltage3V3 ( )
static

Measure the 3.3V rail voltage.

Returns
the 3.3V rail voltage

◆ GetUserVoltage5V()

static units::volt_t frc::sim::RoboRioSim::GetUserVoltage5V ( )
static

Measure the 5V rail voltage.

Returns
the 5V rail voltage

◆ GetUserVoltage6V()

static units::volt_t frc::sim::RoboRioSim::GetUserVoltage6V ( )
static

Measure the 6V rail voltage.

Returns
the 6V rail voltage

◆ GetVInCurrent()

static units::ampere_t frc::sim::RoboRioSim::GetVInCurrent ( )
static

Measure the Vin current.

Returns
the Vin current

◆ GetVInVoltage()

static units::volt_t frc::sim::RoboRioSim::GetVInVoltage ( )
static

Measure the Vin voltage.

Returns
the Vin voltage

◆ RegisterBrownoutVoltageCallback()

static std::unique_ptr< CallbackStore > frc::sim::RoboRioSim::RegisterBrownoutVoltageCallback ( NotifyCallback  callback,
bool  initialNotify 
)
static

Register a callback to be run whenever the brownout voltage changes.

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

◆ RegisterCPUTempCallback()

static std::unique_ptr< CallbackStore > frc::sim::RoboRioSim::RegisterCPUTempCallback ( NotifyCallback  callback,
bool  initialNotify 
)
static

Register a callback to be run whenever the cpu temp changes.

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

◆ RegisterFPGAButtonCallback()

static std::unique_ptr< CallbackStore > frc::sim::RoboRioSim::RegisterFPGAButtonCallback ( NotifyCallback  callback,
bool  initialNotify 
)
static

Register a callback to be run when the FPGA button state changes.

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

◆ RegisterRadioLEDStateCallback()

static std::unique_ptr< CallbackStore > frc::sim::RoboRioSim::RegisterRadioLEDStateCallback ( NotifyCallback  callback,
bool  initialNotify 
)
static

Register a callback to be run whenever the Radio led state changes.

Parameters
callbackthe callback
initialNotifywhether the callback should be called with the initial value
Returns
the CallbackStore object associated with this callback

◆ RegisterTeamNumberCallback()

static std::unique_ptr< CallbackStore > frc::sim::RoboRioSim::RegisterTeamNumberCallback ( NotifyCallback  callback,
bool  initialNotify 
)
static

Register a callback to be run whenever the team number changes.

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

◆ RegisterUserActive3V3Callback()

static std::unique_ptr< CallbackStore > frc::sim::RoboRioSim::RegisterUserActive3V3Callback ( NotifyCallback  callback,
bool  initialNotify 
)
static

Register a callback to be run whenever the 3.3V rail active state changes.

Parameters
callbackthe callback
initialNotifywhether the callback should be called with the initial state
Returns
the CallbackStore object associated with this callback

◆ RegisterUserActive5VCallback()

static std::unique_ptr< CallbackStore > frc::sim::RoboRioSim::RegisterUserActive5VCallback ( NotifyCallback  callback,
bool  initialNotify 
)
static

Register a callback to be run whenever the 5V rail active state changes.

Parameters
callbackthe callback
initialNotifywhether the callback should be called with the initial state
Returns
the CallbackStore object associated with this callback

◆ RegisterUserActive6VCallback()

static std::unique_ptr< CallbackStore > frc::sim::RoboRioSim::RegisterUserActive6VCallback ( NotifyCallback  callback,
bool  initialNotify 
)
static

Register a callback to be run whenever the 6V rail active state changes.

Parameters
callbackthe callback
initialNotifywhether the callback should be called with the initial state
Returns
the CallbackStore object associated with this callback

◆ RegisterUserCurrent3V3Callback()

static std::unique_ptr< CallbackStore > frc::sim::RoboRioSim::RegisterUserCurrent3V3Callback ( NotifyCallback  callback,
bool  initialNotify 
)
static

Register a callback to be run whenever the 3.3V rail current changes.

Parameters
callbackthe callback
initialNotifywhether the callback should be called with the initial value
Returns
the CallbackStore object associated with this callback

◆ RegisterUserCurrent5VCallback()

static std::unique_ptr< CallbackStore > frc::sim::RoboRioSim::RegisterUserCurrent5VCallback ( NotifyCallback  callback,
bool  initialNotify 
)
static

Register a callback to be run whenever the 5V rail current changes.

Parameters
callbackthe callback
initialNotifywhether the callback should be called with the initial value
Returns
the CallbackStore object associated with this callback

◆ RegisterUserCurrent6VCallback()

static std::unique_ptr< CallbackStore > frc::sim::RoboRioSim::RegisterUserCurrent6VCallback ( NotifyCallback  callback,
bool  initialNotify 
)
static

Register a callback to be run whenever the 6V rail current changes.

Parameters
callbackthe callback
initialNotifywhether the callback should be called with the initial value
Returns
the CallbackStore object associated with this callback

◆ RegisterUserFaults3V3Callback()

static std::unique_ptr< CallbackStore > frc::sim::RoboRioSim::RegisterUserFaults3V3Callback ( NotifyCallback  callback,
bool  initialNotify 
)
static

Register a callback to be run whenever the 3.3V rail number of faults changes.

Parameters
callbackthe callback
initialNotifywhether the callback should be called with the initial value
Returns
the CallbackStore object associated with this callback

◆ RegisterUserFaults5VCallback()

static std::unique_ptr< CallbackStore > frc::sim::RoboRioSim::RegisterUserFaults5VCallback ( NotifyCallback  callback,
bool  initialNotify 
)
static

Register a callback to be run whenever the 5V rail number of faults changes.

Parameters
callbackthe callback
initialNotifywhether the callback should be called with the initial value
Returns
the CallbackStore object associated with this callback

◆ RegisterUserFaults6VCallback()

static std::unique_ptr< CallbackStore > frc::sim::RoboRioSim::RegisterUserFaults6VCallback ( NotifyCallback  callback,
bool  initialNotify 
)
static

Register a callback to be run whenever the 6V rail number of faults changes.

Parameters
callbackthe callback
initialNotifywhether the callback should be called with the initial value
Returns
the CallbackStore object associated with this callback

◆ RegisterUserVoltage3V3Callback()

static std::unique_ptr< CallbackStore > frc::sim::RoboRioSim::RegisterUserVoltage3V3Callback ( NotifyCallback  callback,
bool  initialNotify 
)
static

Register a callback to be run whenever the 3.3V rail voltage changes.

Parameters
callbackthe callback
initialNotifywhether the callback should be called with the initial value
Returns
the CallbackStore object associated with this callback

◆ RegisterUserVoltage5VCallback()

static std::unique_ptr< CallbackStore > frc::sim::RoboRioSim::RegisterUserVoltage5VCallback ( NotifyCallback  callback,
bool  initialNotify 
)
static

Register a callback to be run whenever the 5V rail voltage changes.

Parameters
callbackthe callback
initialNotifywhether the callback should be called with the initial value
Returns
the CallbackStore object associated with this callback

◆ RegisterUserVoltage6VCallback()

static std::unique_ptr< CallbackStore > frc::sim::RoboRioSim::RegisterUserVoltage6VCallback ( NotifyCallback  callback,
bool  initialNotify 
)
static

Register a callback to be run whenever the 6V rail voltage changes.

Parameters
callbackthe callback
initialNotifywhether the callback should be called with the initial value
Returns
the CallbackStore object associated with this callback

◆ RegisterVInCurrentCallback()

static std::unique_ptr< CallbackStore > frc::sim::RoboRioSim::RegisterVInCurrentCallback ( NotifyCallback  callback,
bool  initialNotify 
)
static

Register a callback to be run whenever the Vin current changes.

Parameters
callbackthe callback
initialNotifywhether the callback should be called with the initial value
Returns
the CallbackStore object associated with this callback

◆ RegisterVInVoltageCallback()

static std::unique_ptr< CallbackStore > frc::sim::RoboRioSim::RegisterVInVoltageCallback ( NotifyCallback  callback,
bool  initialNotify 
)
static

Register a callback to be run whenever the Vin voltage changes.

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

◆ ResetData()

static void frc::sim::RoboRioSim::ResetData ( )
static

Reset all simulation data.

◆ SetBrownoutVoltage()

static void frc::sim::RoboRioSim::SetBrownoutVoltage ( units::volt_t  brownoutVoltage)
static

Define the brownout voltage.

Parameters
brownoutVoltagethe new voltage

◆ SetComments()

static void frc::sim::RoboRioSim::SetComments ( std::string_view  comments)
static

Set the comments.

Parameters
commentsThe comments.

◆ SetCPUTemp()

static void frc::sim::RoboRioSim::SetCPUTemp ( units::celsius_t  cpuTemp)
static

Define the cpu temp.

Parameters
cpuTempthe new cpu temp.

◆ SetFPGAButton()

static void frc::sim::RoboRioSim::SetFPGAButton ( bool  fPGAButton)
static

Define the state of the FPGA button.

Parameters
fPGAButtonthe new state

◆ SetRadioLEDState()

static void frc::sim::RoboRioSim::SetRadioLEDState ( RadioLEDState  state)
static

Set the state of the radio led.

Parameters
stateThe state of the radio led.

◆ SetSerialNumber()

static void frc::sim::RoboRioSim::SetSerialNumber ( std::string_view  serialNumber)
static

Set the serial number.

Parameters
serialNumberThe serial number.

◆ SetTeamNumber()

static void frc::sim::RoboRioSim::SetTeamNumber ( int32_t  teamNumber)
static

Set the team number.

Parameters
teamNumberthe new team number.

◆ SetUserActive3V3()

static void frc::sim::RoboRioSim::SetUserActive3V3 ( bool  userActive3V3)
static

Set the 3.3V rail active state.

Parameters
userActive3V3true to make rail active

◆ SetUserActive5V()

static void frc::sim::RoboRioSim::SetUserActive5V ( bool  userActive5V)
static

Set the 5V rail active state.

Parameters
userActive5Vtrue to make rail active

◆ SetUserActive6V()

static void frc::sim::RoboRioSim::SetUserActive6V ( bool  userActive6V)
static

Set the 6V rail active state.

Parameters
userActive6Vtrue to make rail active

◆ SetUserCurrent3V3()

static void frc::sim::RoboRioSim::SetUserCurrent3V3 ( units::ampere_t  userCurrent3V3)
static

Define the 3.3V rail current.

Parameters
userCurrent3V3the new current

◆ SetUserCurrent5V()

static void frc::sim::RoboRioSim::SetUserCurrent5V ( units::ampere_t  userCurrent5V)
static

Define the 5V rail current.

Parameters
userCurrent5Vthe new current

◆ SetUserCurrent6V()

static void frc::sim::RoboRioSim::SetUserCurrent6V ( units::ampere_t  userCurrent6V)
static

Define the 6V rail current.

Parameters
userCurrent6Vthe new current

◆ SetUserFaults3V3()

static void frc::sim::RoboRioSim::SetUserFaults3V3 ( int  userFaults3V3)
static

Set the 3.3V rail number of faults.

Parameters
userFaults3V3number of faults

◆ SetUserFaults5V()

static void frc::sim::RoboRioSim::SetUserFaults5V ( int  userFaults5V)
static

Set the 5V rail number of faults.

Parameters
userFaults5Vnumber of faults

◆ SetUserFaults6V()

static void frc::sim::RoboRioSim::SetUserFaults6V ( int  userFaults6V)
static

Set the 6V rail number of faults.

Parameters
userFaults6Vnumber of faults

◆ SetUserVoltage3V3()

static void frc::sim::RoboRioSim::SetUserVoltage3V3 ( units::volt_t  userVoltage3V3)
static

Define the 3.3V rail voltage.

Parameters
userVoltage3V3the new voltage

◆ SetUserVoltage5V()

static void frc::sim::RoboRioSim::SetUserVoltage5V ( units::volt_t  userVoltage5V)
static

Define the 5V rail voltage.

Parameters
userVoltage5Vthe new voltage

◆ SetUserVoltage6V()

static void frc::sim::RoboRioSim::SetUserVoltage6V ( units::volt_t  userVoltage6V)
static

Define the 6V rail voltage.

Parameters
userVoltage6Vthe new voltage

◆ SetVInCurrent()

static void frc::sim::RoboRioSim::SetVInCurrent ( units::ampere_t  vInCurrent)
static

Define the Vin current.

Parameters
vInCurrentthe new current

◆ SetVInVoltage()

static void frc::sim::RoboRioSim::SetVInVoltage ( units::volt_t  vInVoltage)
static

Define the Vin voltage.

Parameters
vInVoltagethe new voltage

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