14#include <units/frequency.h>
15#include <units/time.h>
28 ctre::phoenix::StatusCode SendRequest(
const char *network, uint32_t deviceHash, std::shared_ptr<ControlRequest> &req)
const override
30 if (req.get() !=
this)
32 auto const reqCast =
dynamic_cast<SolidColor *
>(req.get());
33 if (reqCast !=
nullptr)
39 req = std::make_shared<SolidColor>(*
this);
136 Color = std::move(newColor);
165 std::stringstream ss;
166 ss <<
"Control: SolidColor" << std::endl;
168 ss <<
" LEDEndIndex: " <<
LEDEndIndex << std::endl;
169 ss <<
" Color: " <<
Color << std::endl;
180 std::map<std::string, std::string> controlInfo;
181 std::stringstream ss;
182 controlInfo[
"Name"] =
GetName();
183 ss <<
LEDStartIndex; controlInfo[
"LEDStartIndex"] = ss.str(); ss.str(std::string{});
184 ss <<
LEDEndIndex; controlInfo[
"LEDEndIndex"] = ss.str(); ss.str(std::string{});
185 ss <<
Color; controlInfo[
"Color"] = ss.str(); ss.str(std::string{});
CTREXPORT int c_ctre_phoenix6_RequestControlSolidColor(const char *canbus, uint32_t ecuEncoding, double updateFrequency, int LEDStartIndex, int LEDEndIndex, int Color_Red, int Color_Green, int Color_Blue, int Color_White)
Abstract Control Request class that other control requests extend for use.
Definition ControlRequest.hpp:30
std::string const & GetName() const
Definition ControlRequest.hpp:53
Sets LEDs to a solid color.
Definition SolidColor.hpp:27
SolidColor & WithLEDStartIndex(int newLEDStartIndex)
Modifies this Control Request's LEDStartIndex parameter and returns itself for method-chaining and ea...
Definition SolidColor.hpp:103
int LEDStartIndex
The index of the first LED this animation controls (inclusive).
Definition SolidColor.hpp:52
int LEDEndIndex
The index of the last LED this animation controls (inclusive).
Definition SolidColor.hpp:57
SolidColor & WithLEDEndIndex(int newLEDEndIndex)
Modifies this Control Request's LEDEndIndex parameter and returns itself for method-chaining and easi...
Definition SolidColor.hpp:119
std::map< std::string, std::string > GetControlInfo() const override
Gets information about this control request.
Definition SolidColor.hpp:178
SolidColor & WithColor(signals::RGBWColor newColor)
Modifies this Control Request's Color parameter and returns itself for method-chaining and easier to ...
Definition SolidColor.hpp:134
std::string ToString() const override
Returns a string representation of the object.
Definition SolidColor.hpp:163
signals::RGBWColor Color
The color to apply to the LEDs.
Definition SolidColor.hpp:61
SolidColor & WithUpdateFreqHz(units::frequency::hertz_t newUpdateFreqHz)
Sets the period at which this control will update at.
Definition SolidColor.hpp:153
SolidColor(int LEDStartIndex, int LEDEndIndex)
The period at which this control will update at.
Definition SolidColor.hpp:88
Represents an RGBW color that can be applied to an LED.
Definition RGBWColor.hpp:27
uint8_t Green
The green component of the color, within [0, 255].
Definition RGBWColor.hpp:36
uint8_t Blue
The blue component of the color, within [0, 255].
Definition RGBWColor.hpp:40
uint8_t White
The white component of the color, within [0, 255].
Definition RGBWColor.hpp:45
uint8_t Red
The red component of the color, within [0, 255].
Definition RGBWColor.hpp:32
Status codes reported by APIs, including OK, warnings, and errors.
Definition StatusCodes.h:27
Definition Diff_PositionDutyCycle_Position.hpp:15