13#include <units/frequency.h>
14#include <units/time.h>
15#include <units/dimensionless.h>
29 ctre::phoenix::StatusCode SendRequest(
const char *network, uint32_t deviceHash, std::shared_ptr<ControlRequest> &req)
const override
31 if (req.get() !=
this)
34 if (reqCast !=
nullptr)
40 req = std::make_shared<RgbFadeAnimation>(*
this);
155 Slot = std::move(newSlot);
221 std::stringstream ss;
222 ss <<
"Control: RgbFadeAnimation" << std::endl;
224 ss <<
" LEDEndIndex: " <<
LEDEndIndex << std::endl;
225 ss <<
" Slot: " <<
Slot << std::endl;
226 ss <<
" Brightness: " <<
Brightness.to<
double>() << std::endl;
227 ss <<
" FrameRate: " <<
FrameRate.to<
double>() <<
" Hz" << std::endl;
238 std::map<std::string, std::string> controlInfo;
239 std::stringstream ss;
240 controlInfo[
"Name"] =
GetName();
241 ss <<
LEDStartIndex; controlInfo[
"LEDStartIndex"] = ss.str(); ss.str(std::string{});
242 ss <<
LEDEndIndex; controlInfo[
"LEDEndIndex"] = ss.str(); ss.str(std::string{});
243 ss <<
Slot; controlInfo[
"Slot"] = ss.str(); ss.str(std::string{});
244 ss <<
Brightness.to<
double>(); controlInfo[
"Brightness"] = ss.str(); ss.str(std::string{});
245 ss <<
FrameRate.to<
double>(); controlInfo[
"FrameRate"] = ss.str(); ss.str(std::string{});
CTREXPORT int c_ctre_phoenix6_RequestControlRgbFadeAnimation(const char *canbus, uint32_t ecuEncoding, double updateFrequency, int LEDStartIndex, int LEDEndIndex, int Slot, double Brightness, double FrameRate)
Abstract Control Request class that other control requests extend for use.
Definition ControlRequest.hpp:30
std::string const & GetName() const
Definition ControlRequest.hpp:53
Animation that fades all the LEDs of a strip simultaneously between Red, Green, and Blue.
Definition RgbFadeAnimation.hpp:28
RgbFadeAnimation & WithLEDStartIndex(int newLEDStartIndex)
Modifies this Control Request's LEDStartIndex parameter and returns itself for method-chaining and ea...
Definition RgbFadeAnimation.hpp:121
units::dimensionless::scalar_t Brightness
The brightness of the animation, as a scalar from 0.0 to 1.0.
Definition RgbFadeAnimation.hpp:67
int LEDStartIndex
The index of the first LED this animation controls (inclusive).
Definition RgbFadeAnimation.hpp:53
units::frequency::hertz_t FrameRate
The frame rate of the animation, from [2, 1000] Hz.
Definition RgbFadeAnimation.hpp:78
RgbFadeAnimation & WithSlot(int newSlot)
Modifies this Control Request's Slot parameter and returns itself for method-chaining and easier to u...
Definition RgbFadeAnimation.hpp:153
units::frequency::hertz_t UpdateFreqHz
The period at which this control will update at.
Definition RgbFadeAnimation.hpp:91
RgbFadeAnimation & WithLEDEndIndex(int newLEDEndIndex)
Modifies this Control Request's LEDEndIndex parameter and returns itself for method-chaining and easi...
Definition RgbFadeAnimation.hpp:137
int LEDEndIndex
The index of the last LED this animation controls (inclusive).
Definition RgbFadeAnimation.hpp:58
RgbFadeAnimation & WithUpdateFreqHz(units::frequency::hertz_t newUpdateFreqHz)
Sets the period at which this control will update at.
Definition RgbFadeAnimation.hpp:209
std::map< std::string, std::string > GetControlInfo() const override
Gets information about this control request.
Definition RgbFadeAnimation.hpp:236
RgbFadeAnimation & WithFrameRate(units::frequency::hertz_t newFrameRate)
Modifies this Control Request's FrameRate parameter and returns itself for method-chaining and easier...
Definition RgbFadeAnimation.hpp:190
std::string ToString() const override
Returns a string representation of the object.
Definition RgbFadeAnimation.hpp:219
RgbFadeAnimation(int LEDStartIndex, int LEDEndIndex)
Animation that fades all the LEDs of a strip simultaneously between Red, Green, and Blue.
Definition RgbFadeAnimation.hpp:106
int Slot
The slot of this animation, within [0, 7].
Definition RgbFadeAnimation.hpp:63
RgbFadeAnimation & WithBrightness(units::dimensionless::scalar_t newBrightness)
Modifies this Control Request's Brightness parameter and returns itself for method-chaining and easie...
Definition RgbFadeAnimation.hpp:168
Status codes reported by APIs, including OK, warnings, and errors.
Definition StatusCodes.h:27
Definition Diff_PositionDutyCycle_Position.hpp:15