Package edu.wpi.first.wpilibj.simulation
Class RoboRioSim
java.lang.Object
edu.wpi.first.wpilibj.simulation.RoboRioSim
A utility class to control a simulated RoboRIO.
- 
Method SummaryModifier and TypeMethodDescriptionstatic doubleMeasure the Brownout voltage.static StringGet the comments string.static doubleGet the cpu temp.static booleanQuery the state of the FPGA button.Get the state of the radio led.static StringGet the serial number.static intGet the team number.static booleanGet the 3.3V rail active state.static booleanGet the 5V rail active state.static booleanGet the 6V rail active state.static doubleMeasure the 3.3V rail current.static doubleMeasure the 5V rail current.static doubleMeasure the 6V rail current.static intGet the 3.3V rail number of faults.static intGet the 5V rail number of faults.static intGet the 6V rail number of faults.static doubleMeasure the 3.3V rail voltage.static doubleMeasure the 5V rail voltage.static doubleMeasure the 6V rail voltage.static doubleMeasure the Vin current.static doubleMeasure the Vin voltage.static CallbackStoreregisterBrownoutVoltageCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the Brownout voltage changes.static CallbackStoreregisterCPUTempCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the cpu temp changes.static CallbackStoreregisterFPGAButtonCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run when the FPGA button state changes.static CallbackStoreregisterRadioLEDStateCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the Radio led state changes.static CallbackStoreregisterTeamNumberCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the team number changes.static CallbackStoreregisterUserActive3V3Callback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the 3.3V rail active state changes.static CallbackStoreregisterUserActive5VCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the 5V rail active state changes.static CallbackStoreregisterUserActive6VCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the 6V rail active state changes.static CallbackStoreregisterUserCurrent3V3Callback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the 3.3V rail current changes.static CallbackStoreregisterUserCurrent5VCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the 5V rail current changes.static CallbackStoreregisterUserCurrent6VCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the 6V rail current changes.static CallbackStoreregisterUserFaults3V3Callback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the 3.3V rail number of faults changes.static CallbackStoreregisterUserFaults5VCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the 5V rail number of faults changes.static CallbackStoreregisterUserFaults6VCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the 6V rail number of faults changes.static CallbackStoreregisterUserVoltage3V3Callback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the 3.3V rail voltage changes.static CallbackStoreregisterUserVoltage5VCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the 5V rail voltage changes.static CallbackStoreregisterUserVoltage6VCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the 6V rail voltage changes.static CallbackStoreregisterVInCurrentCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the Vin current changes.static CallbackStoreregisterVInVoltageCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the Vin voltage changes.static voidReset all simulation data.static voidsetBrownoutVoltage(double vInVoltage) Define the Brownout voltage.static voidsetComments(String comments) Set the comments string.static voidsetCPUTemp(double cpuTemp) Set the cpu temp.static voidsetFPGAButton(boolean fpgaButton) Define the state of the FPGA button.static voidSet the state of the radio led.static voidsetSerialNumber(String serialNumber) Set the serial number.static voidsetTeamNumber(int teamNumber) Set the team number.static voidsetUserActive3V3(boolean userActive3V3) Set the 3.3V rail active state.static voidsetUserActive5V(boolean userActive5V) Set the 5V rail active state.static voidsetUserActive6V(boolean userActive6V) Set the 6V rail active state.static voidsetUserCurrent3V3(double userCurrent3V3) Define the 3.3V rail current.static voidsetUserCurrent5V(double userCurrent5V) Define the 5V rail current.static voidsetUserCurrent6V(double userCurrent6V) Define the 6V rail current.static voidsetUserFaults3V3(int userFaults3V3) Set the 3.3V rail number of faults.static voidsetUserFaults5V(int userFaults5V) Set the 5V rail number of faults.static voidsetUserFaults6V(int userFaults6V) Set the 6V rail number of faults.static voidsetUserVoltage3V3(double userVoltage3V3) Define the 3.3V rail voltage.static voidsetUserVoltage5V(double userVoltage5V) Define the 5V rail voltage.static voidsetUserVoltage6V(double userVoltage6V) Define the 6V rail voltage.static voidsetVInCurrent(double vInCurrent) Define the Vin current.static voidsetVInVoltage(double vInVoltage) Define the Vin voltage.
- 
Method Details- 
registerFPGAButtonCallbackpublic static CallbackStore registerFPGAButtonCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run when the FPGA button state changes.- Parameters:
- callback- the callback
- initialNotify- whether to run the callback with the initial state
- Returns:
- the CallbackStoreobject associated with this callback.
 
- 
getFPGAButtonQuery the state of the FPGA button.- Returns:
- the FPGA button state
 
- 
setFPGAButtonDefine the state of the FPGA button.- Parameters:
- fpgaButton- the new state
 
- 
registerVInVoltageCallbackpublic static CallbackStore registerVInVoltageCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the Vin voltage changes.- Parameters:
- callback- the callback
- initialNotify- whether to call the callback with the initial state
- Returns:
- the CallbackStoreobject associated with this callback.
 
- 
getVInVoltageMeasure the Vin voltage.- Returns:
- the Vin voltage
 
- 
setVInVoltageDefine the Vin voltage.- Parameters:
- vInVoltage- the new voltage
 
- 
registerVInCurrentCallbackpublic static CallbackStore registerVInCurrentCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the Vin current changes.- Parameters:
- callback- the callback
- initialNotify- whether the callback should be called with the initial value
- Returns:
- the CallbackStoreobject associated with this callback.
 
- 
getVInCurrentMeasure the Vin current.- Returns:
- the Vin current
 
- 
setVInCurrentDefine the Vin current.- Parameters:
- vInCurrent- the new current
 
- 
registerUserVoltage6VCallbackpublic static CallbackStore registerUserVoltage6VCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the 6V rail voltage changes.- Parameters:
- callback- the callback
- initialNotify- whether the callback should be called with the initial value
- Returns:
- the CallbackStoreobject associated with this callback.
 
- 
getUserVoltage6VMeasure the 6V rail voltage.- Returns:
- the 6V rail voltage
 
- 
setUserVoltage6VDefine the 6V rail voltage.- Parameters:
- userVoltage6V- the new voltage
 
- 
registerUserCurrent6VCallbackpublic static CallbackStore registerUserCurrent6VCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the 6V rail current changes.- Parameters:
- callback- the callback
- initialNotify- whether the callback should be called with the initial value
- Returns:
- the CallbackStoreobject associated with this callback.
 
- 
getUserCurrent6VMeasure the 6V rail current.- Returns:
- the 6V rail current
 
- 
setUserCurrent6VDefine the 6V rail current.- Parameters:
- userCurrent6V- the new current
 
- 
registerUserActive6VCallbackpublic static CallbackStore registerUserActive6VCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the 6V rail active state changes.- Parameters:
- callback- the callback
- initialNotify- whether the callback should be called with the initial state
- Returns:
- the CallbackStoreobject associated with this callback.
 
- 
getUserActive6VGet the 6V rail active state.- Returns:
- true if the 6V rail is active
 
- 
setUserActive6VSet the 6V rail active state.- Parameters:
- userActive6V- true to make rail active
 
- 
registerUserVoltage5VCallbackpublic static CallbackStore registerUserVoltage5VCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the 5V rail voltage changes.- Parameters:
- callback- the callback
- initialNotify- whether the callback should be called with the initial value
- Returns:
- the CallbackStoreobject associated with this callback.
 
- 
getUserVoltage5VMeasure the 5V rail voltage.- Returns:
- the 5V rail voltage
 
- 
setUserVoltage5VDefine the 5V rail voltage.- Parameters:
- userVoltage5V- the new voltage
 
- 
registerUserCurrent5VCallbackpublic static CallbackStore registerUserCurrent5VCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the 5V rail current changes.- Parameters:
- callback- the callback
- initialNotify- whether the callback should be called with the initial value
- Returns:
- the CallbackStoreobject associated with this callback.
 
- 
getUserCurrent5VMeasure the 5V rail current.- Returns:
- the 5V rail current
 
- 
setUserCurrent5VDefine the 5V rail current.- Parameters:
- userCurrent5V- the new current
 
- 
registerUserActive5VCallbackpublic static CallbackStore registerUserActive5VCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the 5V rail active state changes.- Parameters:
- callback- the callback
- initialNotify- whether the callback should be called with the initial state
- Returns:
- the CallbackStoreobject associated with this callback.
 
- 
getUserActive5VGet the 5V rail active state.- Returns:
- true if the 5V rail is active
 
- 
setUserActive5VSet the 5V rail active state.- Parameters:
- userActive5V- true to make rail active
 
- 
registerUserVoltage3V3Callbackpublic static CallbackStore registerUserVoltage3V3Callback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the 3.3V rail voltage changes.- Parameters:
- callback- the callback
- initialNotify- whether the callback should be called with the initial value
- Returns:
- the CallbackStoreobject associated with this callback.
 
- 
getUserVoltage3V3Measure the 3.3V rail voltage.- Returns:
- the 3.3V rail voltage
 
- 
setUserVoltage3V3Define the 3.3V rail voltage.- Parameters:
- userVoltage3V3- the new voltage
 
- 
registerUserCurrent3V3Callbackpublic static CallbackStore registerUserCurrent3V3Callback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the 3.3V rail current changes.- Parameters:
- callback- the callback
- initialNotify- whether the callback should be called with the initial value
- Returns:
- the CallbackStoreobject associated with this callback.
 
- 
getUserCurrent3V3Measure the 3.3V rail current.- Returns:
- the 3.3V rail current
 
- 
setUserCurrent3V3Define the 3.3V rail current.- Parameters:
- userCurrent3V3- the new current
 
- 
registerUserActive3V3Callbackpublic static CallbackStore registerUserActive3V3Callback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the 3.3V rail active state changes.- Parameters:
- callback- the callback
- initialNotify- whether the callback should be called with the initial state
- Returns:
- the CallbackStoreobject associated with this callback.
 
- 
getUserActive3V3Get the 3.3V rail active state.- Returns:
- true if the 3.3V rail is active
 
- 
setUserActive3V3Set the 3.3V rail active state.- Parameters:
- userActive3V3- true to make rail active
 
- 
registerUserFaults6VCallbackpublic static CallbackStore registerUserFaults6VCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the 6V rail number of faults changes.- Parameters:
- callback- the callback
- initialNotify- whether the callback should be called with the initial value
- Returns:
- the CallbackStoreobject associated with this callback.
 
- 
getUserFaults6VGet the 6V rail number of faults.- Returns:
- number of faults
 
- 
setUserFaults6VSet the 6V rail number of faults.- Parameters:
- userFaults6V- number of faults
 
- 
registerUserFaults5VCallbackpublic static CallbackStore registerUserFaults5VCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the 5V rail number of faults changes.- Parameters:
- callback- the callback
- initialNotify- whether the callback should be called with the initial value
- Returns:
- the CallbackStoreobject associated with this callback.
 
- 
getUserFaults5VGet the 5V rail number of faults.- Returns:
- number of faults
 
- 
setUserFaults5VSet the 5V rail number of faults.- Parameters:
- userFaults5V- number of faults
 
- 
registerUserFaults3V3Callbackpublic static CallbackStore registerUserFaults3V3Callback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the 3.3V rail number of faults changes.- Parameters:
- callback- the callback
- initialNotify- whether the callback should be called with the initial value
- Returns:
- the CallbackStoreobject associated with this callback.
 
- 
getUserFaults3V3Get the 3.3V rail number of faults.- Returns:
- number of faults
 
- 
setUserFaults3V3Set the 3.3V rail number of faults.- Parameters:
- userFaults3V3- number of faults
 
- 
registerBrownoutVoltageCallbackpublic static CallbackStore registerBrownoutVoltageCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the Brownout voltage changes.- Parameters:
- callback- the callback
- initialNotify- whether to call the callback with the initial state
- Returns:
- the CallbackStoreobject associated with this callback.
 
- 
getBrownoutVoltageMeasure the Brownout voltage.- Returns:
- the Brownout voltage
 
- 
setBrownoutVoltageDefine the Brownout voltage.- Parameters:
- vInVoltage- the new voltage
 
- 
registerCPUTempCallbackRegister a callback to be run whenever the cpu temp changes.- Parameters:
- callback- the callback
- initialNotify- whether to call the callback with the initial state
- Returns:
- the CallbackStoreobject associated with this callback.
 
- 
getCPUTempGet the cpu temp.- Returns:
- the cpu temp.
 
- 
setCPUTempSet the cpu temp.- Parameters:
- cpuTemp- the new cpu temp.
 
- 
registerTeamNumberCallbackpublic static CallbackStore registerTeamNumberCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the team number changes.- Parameters:
- callback- the callback
- initialNotify- whether to call the callback with the initial state
- Returns:
- the CallbackStoreobject associated with this callback.
 
- 
getTeamNumberGet the team number.- Returns:
- the team number.
 
- 
setTeamNumberSet the team number.- Parameters:
- teamNumber- the new team number.
 
- 
getSerialNumberGet the serial number.- Returns:
- The serial number.
 
- 
setSerialNumberSet the serial number.- Parameters:
- serialNumber- The serial number.
 
- 
getCommentsGet the comments string.- Returns:
- The comments string.
 
- 
setCommentsSet the comments string.- Parameters:
- comments- The comments string.
 
- 
registerRadioLEDStateCallbackpublic static CallbackStore registerRadioLEDStateCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run whenever the Radio led state changes.- Parameters:
- callback- the callback
- initialNotify- whether to call the callback with the initial state
- Returns:
- the CallbackStoreobject associated with this callback.
 
- 
getRadioLEDStateGet the state of the radio led.- Returns:
- The state of the radio led.
 
- 
setRadioLEDStateSet the state of the radio led.- Parameters:
- state- The state of the radio led.
 
- 
resetDataReset all simulation data.
 
-