Class CANdleSimState
java.lang.Object
com.ctre.phoenix6.sim.CANdleSimState
-
Constructor Summary
ConstructorsConstructorDescriptionCANdleSimState(CoreCANdle device) Creates an object to control the state of the givenCANdle. -
Method Summary
Modifier and TypeMethodDescriptionfinal StatusCodeGets the last status code generated by a simulation function.final doubleGets the simulated VBat modulated output of the CANdle.final StatusCodesetDeviceTemp(double temperature) Sets the simulated temperature of the CANdle.final StatusCodesetDeviceTemp(Temperature temperature) Sets the simulated temperature of the CANdle.final StatusCodesetFiveVRailVoltage(double volts) Sets the simulated 5V rail voltage of the CANdle.final StatusCodesetFiveVRailVoltage(Voltage voltage) Sets the simulated 5V rail voltage of the CANdle.final StatusCodesetOutputCurrent(double amps) Sets the simulated output current of the CANdle.final StatusCodesetOutputCurrent(Current current) Sets the simulated output current of the CANdle.final StatusCodesetSupplyVoltage(double volts) Sets the simulated supply voltage of the CANdle.final StatusCodesetSupplyVoltage(Voltage voltage) Sets the simulated supply voltage of the CANdle.
-
Constructor Details
-
CANdleSimState
Creates an object to control the state of the givenCANdle.Note the recommended method of accessing simulation features is to use
CoreCANdle.getSimState().- Parameters:
device- Device to which this simulation state is attached
-
-
Method Details
-
getLastStatusCode
Gets the last status code generated by a simulation function.Not all functions return a status code but can potentially report errors. This function can be used to retrieve those status codes.
- Returns:
- Last status code generated by a simulation function
-
getVBatModulation
public final double getVBatModulation()Gets the simulated VBat modulated output of the CANdle.- Returns:
- VBat modulation duty cycle
-
setSupplyVoltage
Sets the simulated supply voltage of the CANdle.The minimum allowed supply voltage is 4 V - values below this will be promoted to 4 V.
- Parameters:
volts- The supply voltage in Volts- Returns:
- Status code
-
setSupplyVoltage
Sets the simulated supply voltage of the CANdle.The minimum allowed supply voltage is 4 V - values below this will be promoted to 4 V.
- Parameters:
voltage- The supply voltage- Returns:
- Status code
-
setFiveVRailVoltage
Sets the simulated 5V rail voltage of the CANdle.- Parameters:
volts- The 5V rail voltage in Volts- Returns:
- Status code
-
setFiveVRailVoltage
Sets the simulated 5V rail voltage of the CANdle.- Parameters:
voltage- The 5V rail voltage- Returns:
- Status code
-
setOutputCurrent
Sets the simulated output current of the CANdle.- Parameters:
amps- The output current in Amps- Returns:
- Status code
-
setOutputCurrent
Sets the simulated output current of the CANdle.- Parameters:
current- The output current- Returns:
- Status code
-
setDeviceTemp
Sets the simulated temperature of the CANdle.- Parameters:
temperature- The device temperature in ℃- Returns:
- Status code
-
setDeviceTemp
Sets the simulated temperature of the CANdle.- Parameters:
temperature- The device temperature- Returns:
- Status code
-