CTRE Phoenix 6 C++ 26.50.0-alpha-1
Loading...
Searching...
No Matches
CANdleSimState.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) Cross The Road Electronics.  All rights reserved.
3 * License information can be found in CTRE_LICENSE.txt
4 * For support and suggestions contact support@ctr-electronics.com or file
5 * an issue tracker at https://github.com/CrossTheRoadElec/Phoenix-Releases
6 */
7#pragma once
8
11#include <wpi/units/current.hpp>
12#include <wpi/units/dimensionless.hpp>
13#include <wpi/units/temperature.hpp>
14#include <wpi/units/voltage.hpp>
15
16namespace ctre {
17namespace phoenix6 {
18
19namespace hardware {
20namespace core {
21 /* forward proto */
22 class CoreCANdle;
23}
24}
25
26namespace sim {
27
28 /**
29 * \brief Class to control the state of a simulated hardware#CANdle.
30 */
32 {
33 private:
34 int _id;
35
36 public:
37 /**
38 * \brief Creates an object to control the state of the given hardware#CANdle.
39 *
40 * \details Note the recommended method of accessing simulation features is to
41 * use hardware#CANdle#GetSimState.
42 *
43 * \param device Device to which this simulation state is attached
44 */
46 /* disallow copy, allow move */
47 CANdleSimState(CANdleSimState const &) = delete;
51
52 /**
53 * \brief Gets the last status code generated by a simulation function.
54 *
55 * \details Not all functions return a status code but can potentially report errors.
56 * This function can be used to retrieve those status codes.
57 *
58 * \returns Last status code generated by a simulation function
59 */
61
62 /**
63 * \brief Gets the simulated VBat modulated output of the CANdle.
64 *
65 * \returns VBat modulation duty cycle
66 */
67 wpi::units::scalar_t GetVBatModulation() const;
68
69 /**
70 * \brief Sets the simulated supply voltage of the CANdle.
71 *
72 * \details The minimum allowed supply voltage is 4 V - values below this
73 * will be promoted to 4 V.
74 *
75 * \param volts The supply voltage in Volts
76 * \returns Status code
77 */
79
80 /**
81 * \brief Sets the simulated 5V rail voltage of the CANdle.
82 *
83 * \param volts The 5V rail voltage in Volts
84 * \returns Status code
85 */
87
88 /**
89 * \brief Sets the simulated output current of the CANdle.
90 *
91 * \param amps The output current in Amps
92 * \returns Status code
93 */
94 ctre::phoenix::StatusCode SetOutputCurrent(wpi::units::ampere_t amps);
95
96 /**
97 * \brief Sets the simulated temperature of the CANdle.
98 *
99 * \param temperature The device temperature in ℃
100 * \returns Status code
101 */
102 ctre::phoenix::StatusCode SetDeviceTemp(wpi::units::celsius_t temperature);
103 };
104}
105
106}
107}
Class for CTR Electronics' CANdle® branded device, a device that controls LEDs over the CAN bus.
Definition CoreCANdle.hpp:839
CANdleSimState & operator=(CANdleSimState &&)=default
ctre::phoenix::StatusCode GetLastStatusCode() const
Gets the last status code generated by a simulation function.
CANdleSimState(CANdleSimState const &)=delete
ctre::phoenix::StatusCode SetDeviceTemp(wpi::units::celsius_t temperature)
Sets the simulated temperature of the CANdle.
CANdleSimState(CANdleSimState &&)=default
CANdleSimState(hardware::core::CoreCANdle const &device)
Creates an object to control the state of the given hardware::CANdle.
ctre::phoenix::StatusCode SetSupplyVoltage(wpi::units::volt_t volts)
Sets the simulated supply voltage of the CANdle.
wpi::units::scalar_t GetVBatModulation() const
Gets the simulated VBat modulated output of the CANdle.
CANdleSimState & operator=(CANdleSimState const &)=delete
ctre::phoenix::StatusCode SetFiveVRailVoltage(wpi::units::volt_t volts)
Sets the simulated 5V rail voltage of the CANdle.
ctre::phoenix::StatusCode SetOutputCurrent(wpi::units::ampere_t amps)
Sets the simulated output current of the CANdle.
Status codes reported by APIs, including OK, warnings, and errors.
Definition StatusCodes.h:28
Definition ExternalFeedbackConfigs.hpp:17
Definition ExternalFeedbackConfigs.hpp:17
Definition CANdiSimState.hpp:27
Definition ExternalFeedbackConfigs.hpp:16
Definition motor_constants.h:14