CTRE Phoenix 6 C++ 26.3.0
Loading...
Searching...
No Matches
ctre::phoenix6::sim::CANdleSimState Class Reference

Class to control the state of a simulated hardware::CANdle. More...

#include <ctre/phoenix6/sim/CANdleSimState.hpp>

Public Member Functions

 CANdleSimState (hardware::core::CoreCANdle const &device)
 Creates an object to control the state of the given hardware::CANdle.
 
 CANdleSimState (CANdleSimState const &)=delete
 
 CANdleSimState (CANdleSimState &&)=default
 
CANdleSimState & operator= (CANdleSimState const &)=delete
 
CANdleSimState & operator= (CANdleSimState &&)=default
 
ctre::phoenix::StatusCode GetLastStatusCode () const
 Gets the last status code generated by a simulation function.
 
units::dimensionless::scalar_t GetVBatModulation () const
 Gets the simulated VBat modulated output of the CANdle.
 
ctre::phoenix::StatusCode SetSupplyVoltage (units::voltage::volt_t volts)
 Sets the simulated supply voltage of the CANdle.
 
ctre::phoenix::StatusCode SetFiveVRailVoltage (units::voltage::volt_t volts)
 Sets the simulated 5V rail voltage of the CANdle.
 
ctre::phoenix::StatusCode SetOutputCurrent (units::current::ampere_t amps)
 Sets the simulated output current of the CANdle.
 
ctre::phoenix::StatusCode SetDeviceTemp (units::temperature::celsius_t temperature)
 Sets the simulated temperature of the CANdle.
 

Detailed Description

Class to control the state of a simulated hardware::CANdle.

Constructor & Destructor Documentation

◆ CANdleSimState() [1/3]

ctre::phoenix6::sim::CANdleSimState::CANdleSimState ( hardware::core::CoreCANdle const & device)

Creates an object to control the state of the given hardware::CANdle.

Note the recommended method of accessing simulation features is to use hardware::CANdle::GetSimState.

Parameters
deviceDevice to which this simulation state is attached

◆ CANdleSimState() [2/3]

ctre::phoenix6::sim::CANdleSimState::CANdleSimState ( CANdleSimState const & )
delete

◆ CANdleSimState() [3/3]

ctre::phoenix6::sim::CANdleSimState::CANdleSimState ( CANdleSimState && )
default

Member Function Documentation

◆ GetLastStatusCode()

ctre::phoenix::StatusCode ctre::phoenix6::sim::CANdleSimState::GetLastStatusCode ( ) const

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()

units::dimensionless::scalar_t ctre::phoenix6::sim::CANdleSimState::GetVBatModulation ( ) const

Gets the simulated VBat modulated output of the CANdle.

Returns
VBat modulation duty cycle

◆ operator=() [1/2]

CANdleSimState & ctre::phoenix6::sim::CANdleSimState::operator= ( CANdleSimState && )
default

◆ operator=() [2/2]

CANdleSimState & ctre::phoenix6::sim::CANdleSimState::operator= ( CANdleSimState const & )
delete

◆ SetDeviceTemp()

ctre::phoenix::StatusCode ctre::phoenix6::sim::CANdleSimState::SetDeviceTemp ( units::temperature::celsius_t temperature)

Sets the simulated temperature of the CANdle.

Parameters
temperatureThe device temperature in ℃
Returns
Status code

◆ SetFiveVRailVoltage()

ctre::phoenix::StatusCode ctre::phoenix6::sim::CANdleSimState::SetFiveVRailVoltage ( units::voltage::volt_t volts)

Sets the simulated 5V rail voltage of the CANdle.

Parameters
voltsThe 5V rail voltage in Volts
Returns
Status code

◆ SetOutputCurrent()

ctre::phoenix::StatusCode ctre::phoenix6::sim::CANdleSimState::SetOutputCurrent ( units::current::ampere_t amps)

Sets the simulated output current of the CANdle.

Parameters
ampsThe output current in Amps
Returns
Status code

◆ SetSupplyVoltage()

ctre::phoenix::StatusCode ctre::phoenix6::sim::CANdleSimState::SetSupplyVoltage ( units::voltage::volt_t volts)

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
voltsThe supply voltage in Volts
Returns
Status code

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