12#include <units/frequency.h>
13#include <units/time.h>
25 ctre::phoenix::StatusCode SendRequest(
const char *network, uint32_t deviceHash, std::shared_ptr<ControlRequest> &req)
const override;
108 constexpr std::string_view
GetName()
const override
110 return "LarsonAnimation";
157 Slot = std::move(newSlot);
172 Color = std::move(newColor);
187 Size = std::move(newSize);
Common interface implemented by all control requests.
Definition ControlRequest.hpp:27
Animation that bounces a pocket of light across the LED strip.
Definition LarsonAnimation.hpp:24
int LEDEndIndex
The index of the last LED this animation controls (inclusive).
Definition LarsonAnimation.hpp:38
constexpr LarsonAnimation & WithColor(signals::RGBWColor newColor)
Modifies this Control Request's Color parameter and returns itself for method-chaining and easier to ...
Definition LarsonAnimation.hpp:170
constexpr LarsonAnimation & WithSlot(int newSlot)
Modifies this Control Request's Slot parameter and returns itself for method-chaining and easier to u...
Definition LarsonAnimation.hpp:155
signals::RGBWColor Color
The color to use in the animation.
Definition LarsonAnimation.hpp:47
constexpr ~LarsonAnimation() override
Definition LarsonAnimation.hpp:101
int Size
The number of LEDs in the pocket of light, up to 15.
Definition LarsonAnimation.hpp:51
constexpr LarsonAnimation & WithFrameRate(units::frequency::hertz_t newFrameRate)
Modifies this Control Request's FrameRate parameter and returns itself for method-chaining and easier...
Definition LarsonAnimation.hpp:222
units::frequency::hertz_t UpdateFreqHz
The frequency at which this control will update.
Definition LarsonAnimation.hpp:82
constexpr LarsonAnimation(int LEDStartIndex, int LEDEndIndex)
Animation that bounces a pocket of light across the LED strip.
Definition LarsonAnimation.hpp:96
units::frequency::hertz_t FrameRate
The frame rate of the animation, from [2, 1000] Hz.
Definition LarsonAnimation.hpp:67
constexpr LarsonAnimation & WithSize(int newSize)
Modifies this Control Request's Size parameter and returns itself for method-chaining and easier to u...
Definition LarsonAnimation.hpp:185
int Slot
The slot of this animation, within [0, 7].
Definition LarsonAnimation.hpp:43
std::map< std::string, std::string > GetControlInfo() const override
Gets information about this control request.
constexpr LarsonAnimation & WithBounceMode(signals::LarsonBounceValue newBounceMode)
Modifies this Control Request's BounceMode parameter and returns itself for method-chaining and easie...
Definition LarsonAnimation.hpp:200
signals::LarsonBounceValue BounceMode
The behavior of the pocket of light when it reaches the end of the strip.
Definition LarsonAnimation.hpp:56
constexpr LarsonAnimation & WithUpdateFreqHz(units::frequency::hertz_t newUpdateFreqHz)
Sets the frequency at which this control will update.
Definition LarsonAnimation.hpp:244
constexpr std::string_view GetName() const override
Gets the name of this control request.
Definition LarsonAnimation.hpp:108
int LEDStartIndex
The index of the first LED this animation controls (inclusive).
Definition LarsonAnimation.hpp:33
std::string ToString() const override
Returns a string representation of the object.
constexpr LarsonAnimation & WithLEDEndIndex(int newLEDEndIndex)
Modifies this Control Request's LEDEndIndex parameter and returns itself for method-chaining and easi...
Definition LarsonAnimation.hpp:139
constexpr LarsonAnimation & WithLEDStartIndex(int newLEDStartIndex)
Modifies this Control Request's LEDStartIndex parameter and returns itself for method-chaining and ea...
Definition LarsonAnimation.hpp:123
Represents an RGBW color that can be applied to an LED.
Definition RGBWColor.hpp:27
Status codes reported by APIs, including OK, warnings, and errors.
Definition StatusCodes.h:28
Definition motor_constants.h:14
The behavior of the larson animation pocket of light when it reaches the end of the strip.
Definition SpnEnums.hpp:4876
static constexpr int Front
The animation bounces as soon as the first LED reaches the end of the strip.
Definition SpnEnums.hpp:4883