CTRE Phoenix C++ 5.33.1
Animation.h
Go to the documentation of this file.
1/* Copyright (C) Cross The Road Electronics 2024 */
2#pragma once
3
4#include <cstddef>
5
6namespace ctre{ namespace phoenix{ namespace led{
7
8class BaseStandardAnimation;
9class BaseTwoSizeAnimation;
10
11/**
12 * The base class for all animations that CANdle supports.
13 */
14class Animation {
15 int _animationIdx, _numLed, _ledOffset;
16 double _speed;
17public:
18 /**
19 * Constructor for an Animation class
20 * @param idx The animation-specific ID
21 * @param speed The rate at which the animation runs at. Higher is generally faster
22 * @param numLed The number of LEDs to run the animation on
23 * @param ledOffset Where to start the animation
24 */
25 Animation(int idx, double speed, int numLed, int ledOffset);
26 virtual ~Animation();
27 /**
28 * Sets the speed of the animation
29 * @param speed The rate at which the animation runs at. Higher is generally faster
30 */
31 void SetSpeed(double speed);
32 /**
33 * Sets the number of LEDs the animation will run on
34 * @param numLed The number of LEDs to run the animation on
35 */
36 void SetNumLed(int numLed);
37 /**
38 * Sets where the animation starts along the strip
39 * @param ledOffset Where to start the animation along the strip
40 */
41 void SetLedOffset(int ledOffset);
42
45
47 double GetSpeed();
48 int GetNumLed();
50};
51
52} // namespace led
53} // namespace phoenix
54} // namespace ctre
The base class for all animations that CANdle supports.
Definition: Animation.h:14
void SetSpeed(double speed)
Sets the speed of the animation.
virtual BaseTwoSizeAnimation * GetBaseTwoSizeAnimation()=0
void SetNumLed(int numLed)
Sets the number of LEDs the animation will run on.
Animation(int idx, double speed, int numLed, int ledOffset)
Constructor for an Animation class.
void SetLedOffset(int ledOffset)
Sets where the animation starts along the strip.
virtual BaseStandardAnimation * GetBaseStandardAnimation()=0
The base class for one generic type of animation.
Definition: BaseStandardAnimation.h:12
The base class for one generic type of animation.
Definition: BaseTwoSizeAnimation.h:12
namespace ctre
Definition: paramEnum.h:5