JBWOPR
Loading...
Searching...
No Matches
JBWoprDateTimeDisplayRainbowEffect Class Reference

Display effect for showing the current date and time, with rainbow colors. More...

#include <jbwopreffects.h>

Inheritance diagram for JBWoprDateTimeDisplayRainbowEffect:
JBWoprDateTimeDisplayEffect JBWoprEffectBase

Public Member Functions

 JBWoprDateTimeDisplayRainbowEffect (JBWoprDevice *woprDevice, std::string timeFormat="", std::string dateFormat="", uint32_t duration=-1, const std::string &name=JBWOPR_EFFECT_NAME_DATETIME_RAINBOW)
 Constructor.
 
void loop () override
 Get name of effect.
 
- Public Member Functions inherited from JBWoprDateTimeDisplayEffect
 JBWoprDateTimeDisplayEffect (JBWoprDevice *woprDevice, std::string timeFormat="", std::string dateFormat="", uint32_t duration=-1, const std::string &name=JBWOPR_EFFECT_NAME_DATETIME)
 Constructor.
 
void start () override
 Start effect.
 
virtual void setTimeFormat (const std::string &timeFormat)
 Set time format.
 
void setDateFormat (const std::string &dateFormat)
 Set date format.
 
- Public Member Functions inherited from JBWoprEffectBase
 JBWoprEffectBase (JBWoprDevice *woprDevice, uint32_t duration=-1, std::string name=JBWOPR_EFFECT_NAME_BASE)
 Constructor.
 
virtual std::string getName ()
 Get name of effect.
 
virtual void stop ()
 Stop effect.
 
bool isRunning () const
 Check if effect is running.
 
uint32_t getDuration () const
 Set duration of effect.
 

Protected Attributes

uint64_t _nextLedTick = 0
 Next LED tick.
 
uint16_t _pixelHue = 0
 Pixel hue.
 
- Protected Attributes inherited from JBWoprDateTimeDisplayEffect
uint32_t _displayCounter = 0
 Display counter, for switching between Date and Time.
 
std::string _rawDateFormat
 Raw date format.
 
std::string _rawTimeFormat
 Raw time format.
 
std::string _dateFormat
 Date format.
 
bool _evenFormat = false
 True if even format.
 
std::string _timeFormatEven
 Time format for even.
 
std::string _timeFormatOdd
 Time format for odd.
 
- Protected Attributes inherited from JBWoprEffectBase
JBWoprDevice_woprDevice
 JBWoprDevice instance.
 
std::string _name
 Name of effect.
 
bool _isRunning = false
 True if effect is running.
 
bool _done = true
 True if effect is done, waiting for duration to end.
 
uint32_t _duration = -1
 Duration of effect in milliseconds.
 
uint32_t _startTime = 0
 Start time of effect in milliseconds.
 
uint32_t _nextTick = 0
 Next tick time in milliseconds.
 

Additional Inherited Members

- Protected Member Functions inherited from JBWoprEffectBase
void _displayText (const std::string &text, JBTextAlignment alignment=JBTextAlignment::LEFT)
 Display text on raw display.
 

Detailed Description

Display effect for showing the current date and time, with rainbow colors.

Shows date for 2 seconds, then time for 8 seconds

Constructor & Destructor Documentation

◆ JBWoprDateTimeDisplayRainbowEffect()

JBWoprDateTimeDisplayRainbowEffect::JBWoprDateTimeDisplayRainbowEffect ( JBWoprDevice woprDevice,
std::string  timeFormat = "",
std::string  dateFormat = "",
uint32_t  duration = -1,
const std::string &  name = JBWOPR_EFFECT_NAME_DATETIME_RAINBOW 
)
explicit

Constructor.

Parameters
woprDeviceJBWoprDevice instance

Member Function Documentation

◆ loop()

void JBWoprDateTimeDisplayRainbowEffect::loop ( )
overridevirtual

Get name of effect.

Reimplemented from JBWoprDateTimeDisplayEffect.


The documentation for this class was generated from the following files: