Package com.ctre.phoenix6.sim
Class CANdleSimState
java.lang.Object
com.ctre.phoenix6.sim.CANdleSimState
Class to control the state of a simulated
CANdle.-
Constructor Summary
ConstructorsConstructorDescriptionCANdleSimState(CoreCANdle device) Creates an object to control the state of the givenCANdle. -
Method Summary
Modifier and TypeMethodDescriptionGets the last status code generated by a simulation function.doubleGets the simulated VBat modulated output of the CANdle.setDeviceTemp(double temperature) Sets the simulated temperature of the CANdle.setDeviceTemp(Temperature temperature) Sets the simulated temperature of the CANdle.setFiveVRailVoltage(double volts) Sets the simulated 5V rail voltage of the CANdle.setFiveVRailVoltage(Voltage voltage) Sets the simulated 5V rail voltage of the CANdle.setOutputCurrent(double amps) Sets the simulated output current of the CANdle.setOutputCurrent(Current current) Sets the simulated output current of the CANdle.setSupplyVoltage(double volts) Sets the simulated supply voltage of the CANdle.setSupplyVoltage(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
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
-