RSeries astromech firmware
LogicEngineRenderer Class Referenceabstract

#include <dome/LogicEngine.h>

Detailed Description

Base class renderer for both front and rear RSeries logics.

Base class renderer for all animation on RSeries front and rear logics.

For further information on the hardware:

https://www.youtube.com/watch?v=CbYfDwH_mig

https://astromech.net/forums/showthread.php?30271-RSeries-Logic-Engine-dome-lighting-kits-230-(Nov-2016)-Open

+ Inheritance diagram for LogicEngineRenderer:
+ Collaboration diagram for LogicEngineRenderer:

Public Types

typedef bool(* LogicEffect) (LogicEngineRenderer &renderer)
 
typedef LogicEffect(* LogicEffectSelector) (unsigned effectVal)
 
typedef PROGMEMString(* LogicPMessageSelector) (unsigned index)
 
typedef byte(* LogicRenderGlyph) (char ch, byte fontNum, const CRGB fontColors[], int x, int y, CRGB *leds, const byte *ledMap, int w, int h, byte *glyphHeight)
 
- Public Types inherited from LogicEngineDefaults
enum  ColorVal {
  kRed = 1, kOrange = 2, kYellow = 3, kGreen = 4,
  kCyan = 5, kBlue = 6, kPurple = 7, kMagenta = 8,
  kPink = 9, kDefault = 0
}
 

Public Member Functions

ColorVal randomColor ()
 
void selectEffect (long inputNum)
 
void selectSequence (byte seq, ColorVal colorVal=kDefault, uint8_t speedScale=0, uint8_t numSeconds=0)
 
void selectTextCenter (const char *text, ColorVal colorVal=kDefault, uint8_t speedScale=0, uint8_t numSeconds=0)
 
void selectScrollTextLeft (const char *text, ColorVal colorVal=kDefault, uint8_t speedScale=0, uint8_t numSeconds=0)
 
void selectScrollTextRight (const char *text, ColorVal colorVal=kDefault, uint8_t speedScale=0, uint8_t numSeconds=0)
 
void selectScrollTextUp (const char *text, ColorVal colorVal=kDefault, uint8_t speedScale=0, uint8_t numSeconds=0)
 
virtual void handleCommand (const char *cmd)
 Subclasses should implement this function to process commands specific to their device. More...
 
virtual void setup () override
 Subclasses must implement this function to perform any necessary setup that cannot happen in the constructor. More...
 
virtual void animate () override
 Subclasses must implement this function to run through a single frame of animation/activity. More...
 
bool hasEffectChanged ()
 
void resetEffect ()
 
bool hasEffectChangedType ()
 
unsigned getID () const
 
int getEffectColor ()
 
int getEffectHue ()
 
int getEffectSpeed ()
 
int getEffectLength ()
 
int getEffectTextMsg ()
 
unsigned getEffectDuration ()
 
byte getHue ()
 
void setHue (byte hue)
 
byte getFade ()
 
void setFade (byte fade)
 
byte getDelay ()
 
void setDelay (byte delay)
 
byte getBrightness ()
 
void setBrightness (byte bri)
 
bool getEffectFlip ()
 
void setEffectFlip (bool flip)
 
LogicEffectObjectgetEffectObject ()
 
uint32_t getEffectData ()
 
void setEffectObject (LogicEffectObject *obj)
 
void setEffectData (uint32_t data)
 
uint32_t getEffectData2 ()
 
void setEffectData2 (uint32_t data)
 
void setEffectWidthRange (float percent)
 
int getEffectMsgWidth ()
 
int getEffectMsgHeight ()
 
byte getPeakValue ()
 
void setEffectDelay (uint32_t effectDelay)
 
int width () const
 
int height () const
 
unsigned count () const
 
unsigned mapLED (unsigned index)
 
void setLogicEffectSelector (LogicEffectSelector selector)
 
void setMessageSelector (LogicMessageSelector selector)
 
void setPMessageSelector (LogicPMessageSelector selector)
 
void setPeakValueProvider (PeakValueProvider &provider)
 
void set (unsigned index, const struct CRGB &val)
 
void setHSV (unsigned index, uint8_t hue, uint8_t sat, uint8_t val)
 
void restoreSettings ()
 
void changePalette ()
 
unsigned getCurrentPalette ()
 
void setPaletteHue (byte palNum, byte hue)
 
void clearBlockedPortion ()
 
void updateDisplay ()
 
void updateDisplayPeak ()
 
void updateDisplay (byte bri)
 
void updateDisplaySplitHalf (byte topBri, byte bottomBri)
 
void updateDisplaySplitRowThirds (byte topBri, byte bottomBri)
 
unsigned measureText (const char *txt, int &outWidth, int &outHeight)
 
unsigned measureText (PROGMEMString ptxt, int &outWidth, int &outHeight)
 
byte getEffectFontNum ()
 
void setEffectFontNum (byte fontNum)
 
void setTextMessage (const char *msg)
 
void setupTextMessage (int selectTextMsg)
 
void clear ()
 
void renderText (int x, int y, byte effectHue)
 
LEDStatusgetUnmappedLEDStatus ()
 
CRGB * getUnmappedLEDs ()
 
void setPixel (int x, int y, byte effectHue, byte bri)
 
void setPixelRGB (int x, int y, const struct CRGB &val)
 
void setPixelRGB (int x, int y, uint8_t r, uint8_t g, uint8_t b)
 
void calculateAllColors (byte colorPalNum, byte brightVal)
 
void calculateAllColors ()
 
void updateMappedLED (unsigned index, byte hueVal, byte briVal=255)
 
virtual void jawaCommand (char cmd, int arg, int value) override
 Subclasses should override this method to handle commands specifying a value. More...
 
virtual void jawaCommand (char cmd, const char *arg) override
 Subclasses should override this method to handle commands. More...
 
LogicEngineSettings getSettings ()
 
void changeSettings (LogicEngineSettings &newSettings)
 
virtual void changeDefaultSettings (LogicEngineSettings &settings)=0
 

Static Public Member Functions

static int getNextID ()
 
static constexpr uint32_t getDefaultEffectDelay ()
 
static int mapSelectColorToHue (unsigned selectColor)
 
- Static Public Member Functions inherited from LogicEngineDefaults
static long sequence (byte seq, ColorVal colorVal=kDefault, uint8_t speedScale=0, uint8_t numSeconds=0)
 Calculate sequence value given four parameters. More...
 

Public Attributes

const typedef char *(* LogicMessageSelector )(unsigned index)
 

Protected Member Functions

 LogicEngineRenderer (byte id, byte tweens, byte totalColors, byte totalColorsWBIZ, unsigned width, unsigned height, unsigned count, unsigned start, unsigned end, CRGB *led, HSVColor *allColors, LEDStatus *ledStatus, const byte *ledMap, LogicRenderGlyph renderGlyph)
 
virtual void defaultSettings ()=0
 

Protected Attributes

LogicEngineSettings fSettings
 
LogicEffectSelector fEffectSelector = NULL
 
LogicMessageSelector fMessageSelector = NULL
 
LogicPMessageSelector fPMessageSelector = NULL
 

Static Protected Attributes

static uint16_t sLastEventCount
 

Additional Inherited Members

- Static Public Attributes inherited from LogicEngineDefaults
static constexpr byte FRONT_FADE = 1
 
static constexpr byte FRONT_DELAY = 10
 
static constexpr byte FRONT_HUE = 0
 
static constexpr byte REAR_FADE = 3
 
static constexpr byte REAR_DELAY = 40
 
static constexpr byte REAR_HUE = 0
 
static constexpr byte FRONT_PAL = 0
 
static constexpr byte REAR_PAL = 1
 
static constexpr byte FRONT_PSI_PAL = 4
 
static constexpr byte REAR_PSI_PAL = 5
 
static constexpr byte FRONT_BRI = 160
 
static constexpr byte REAR_BRI = 140
 
static constexpr byte MAX_BRIGHTNESS = 225
 
static constexpr byte MIN_BRIGHTNESS = 1
 
static constexpr uint32_t NORMVAL = 0
 
static constexpr byte PAL_COUNT = 6
 
static constexpr byte NORMAL = 0
 
static constexpr byte ALARM = 1
 
static constexpr byte FAILURE = 2
 
static constexpr byte LEIA = 3
 
static constexpr byte MARCH = 4
 
static constexpr byte SOLIDCOLOR = 5
 
static constexpr byte FLASHCOLOR = 6
 
static constexpr byte FLIPFLOPCOLOR = 7
 
static constexpr byte FLIPFLOPALTCOLOR = 8
 
static constexpr byte COLORSWAP = 9
 
static constexpr byte RAINBOW = 10
 
static constexpr byte REDALERT = 11
 
static constexpr byte MICBRIGHT = 12
 
static constexpr byte MICRAINBOW = 13
 
static constexpr byte LIGHTSOUT = 14
 
static constexpr byte TEXT = 15
 
static constexpr byte TEXTSCROLLLEFT = 16
 
static constexpr byte TEXTSCROLLRIGHT = 17
 
static constexpr byte TEXTSCROLLUP = 18
 
static constexpr byte ROAMINGPIXEL = 19
 
static constexpr byte HORIZONTALSCANLINE = 20
 
static constexpr byte VERTICALSCANLINE = 21
 
static constexpr byte FIRE = 22
 
static constexpr byte PSICOLORWIPE = 23
 
static constexpr byte PULSE = 24
 
static constexpr byte RANDOM = 99
 

Member Typedef Documentation

◆ LogicEffect

typedef bool(* LogicEngineRenderer::LogicEffect) (LogicEngineRenderer &renderer)

◆ LogicEffectSelector

typedef LogicEffect(* LogicEngineRenderer::LogicEffectSelector) (unsigned effectVal)

◆ LogicPMessageSelector

typedef PROGMEMString(* LogicEngineRenderer::LogicPMessageSelector) (unsigned index)

◆ LogicRenderGlyph

typedef byte(* LogicEngineRenderer::LogicRenderGlyph) (char ch, byte fontNum, const CRGB fontColors[], int x, int y, CRGB *leds, const byte *ledMap, int w, int h, byte *glyphHeight)

Constructor & Destructor Documentation

◆ LogicEngineRenderer()

LogicEngineRenderer::LogicEngineRenderer ( byte  id,
byte  tweens,
byte  totalColors,
byte  totalColorsWBIZ,
unsigned  width,
unsigned  height,
unsigned  count,
unsigned  start,
unsigned  end,
CRGB *  led,
HSVColor *  allColors,
LEDStatus ledStatus,
const byte *  ledMap,
LogicRenderGlyph  renderGlyph 
)
inlineprotected

Member Function Documentation

◆ animate()

virtual void LogicEngineRenderer::animate ( )
inlineoverridevirtual

Subclasses must implement this function to run through a single frame of animation/activity.

Subclasses should not call delay() or otherwise block.

Implements AnimatedEvent.

◆ calculateAllColors() [1/2]

void LogicEngineRenderer::calculateAllColors ( )
inline

◆ calculateAllColors() [2/2]

void LogicEngineRenderer::calculateAllColors ( byte  colorPalNum,
byte  brightVal 
)
inline

◆ changeDefaultSettings()

virtual void LogicEngineRenderer::changeDefaultSettings ( LogicEngineSettings settings)
pure virtual

◆ changePalette()

void LogicEngineRenderer::changePalette ( )
inline

◆ changeSettings()

void LogicEngineRenderer::changeSettings ( LogicEngineSettings newSettings)
inline

◆ clear()

void LogicEngineRenderer::clear ( )
inline

◆ clearBlockedPortion()

void LogicEngineRenderer::clearBlockedPortion ( )
inline

◆ count()

unsigned LogicEngineRenderer::count ( ) const
inline

◆ defaultSettings()

virtual void LogicEngineRenderer::defaultSettings ( )
protectedpure virtual

◆ getBrightness()

byte LogicEngineRenderer::getBrightness ( )
inline

◆ getCurrentPalette()

unsigned LogicEngineRenderer::getCurrentPalette ( )
inline

◆ getDefaultEffectDelay()

static constexpr uint32_t LogicEngineRenderer::getDefaultEffectDelay ( )
inlinestaticconstexpr

◆ getDelay()

byte LogicEngineRenderer::getDelay ( )
inline

◆ getEffectColor()

int LogicEngineRenderer::getEffectColor ( )
inline

◆ getEffectData()

uint32_t LogicEngineRenderer::getEffectData ( )
inline

◆ getEffectData2()

uint32_t LogicEngineRenderer::getEffectData2 ( )
inline

◆ getEffectDuration()

unsigned LogicEngineRenderer::getEffectDuration ( )
inline

◆ getEffectFlip()

bool LogicEngineRenderer::getEffectFlip ( )
inline

◆ getEffectFontNum()

byte LogicEngineRenderer::getEffectFontNum ( )
inline

◆ getEffectHue()

int LogicEngineRenderer::getEffectHue ( )
inline

◆ getEffectLength()

int LogicEngineRenderer::getEffectLength ( )
inline

◆ getEffectMsgHeight()

int LogicEngineRenderer::getEffectMsgHeight ( )
inline

◆ getEffectMsgWidth()

int LogicEngineRenderer::getEffectMsgWidth ( )
inline

◆ getEffectObject()

LogicEffectObject* LogicEngineRenderer::getEffectObject ( )
inline

◆ getEffectSpeed()

int LogicEngineRenderer::getEffectSpeed ( )
inline

◆ getEffectTextMsg()

int LogicEngineRenderer::getEffectTextMsg ( )
inline

◆ getFade()

byte LogicEngineRenderer::getFade ( )
inline

◆ getHue()

byte LogicEngineRenderer::getHue ( )
inline

◆ getID()

unsigned LogicEngineRenderer::getID ( ) const
inline

◆ getNextID()

static int LogicEngineRenderer::getNextID ( )
inlinestatic

◆ getPeakValue()

byte LogicEngineRenderer::getPeakValue ( )
inline

◆ getSettings()

LogicEngineSettings LogicEngineRenderer::getSettings ( )
inline

◆ getUnmappedLEDs()

CRGB* LogicEngineRenderer::getUnmappedLEDs ( )
inline

◆ getUnmappedLEDStatus()

LEDStatus* LogicEngineRenderer::getUnmappedLEDStatus ( )
inline

◆ handleCommand()

virtual void LogicEngineRenderer::handleCommand ( const char *  cmd)
inlinevirtual

Subclasses should implement this function to process commands specific to their device.

By convention the first two characters are the device type identifier. 'H' 'P' for holoprojector, etc.

Implements CommandEvent.

◆ hasEffectChanged()

bool LogicEngineRenderer::hasEffectChanged ( )
inline

◆ hasEffectChangedType()

bool LogicEngineRenderer::hasEffectChangedType ( )
inline

◆ height()

int LogicEngineRenderer::height ( ) const
inline

◆ jawaCommand() [1/2]

virtual void LogicEngineRenderer::jawaCommand ( char  cmd,
const char *  arg 
)
inlineoverridevirtual

Subclasses should override this method to handle commands.

Reimplemented from JawaEvent.

◆ jawaCommand() [2/2]

virtual void LogicEngineRenderer::jawaCommand ( char  cmd,
int  arg,
int  value 
)
inlineoverridevirtual

Subclasses should override this method to handle commands specifying a value.

Reimplemented from JawaEvent.

◆ mapLED()

unsigned LogicEngineRenderer::mapLED ( unsigned  index)
inline

◆ mapSelectColorToHue()

static int LogicEngineRenderer::mapSelectColorToHue ( unsigned  selectColor)
inlinestatic

◆ measureText() [1/2]

unsigned LogicEngineRenderer::measureText ( const char *  txt,
int &  outWidth,
int &  outHeight 
)
inline

◆ measureText() [2/2]

unsigned LogicEngineRenderer::measureText ( PROGMEMString  ptxt,
int &  outWidth,
int &  outHeight 
)
inline

◆ randomColor()

ColorVal LogicEngineRenderer::randomColor ( )
inline

◆ renderText()

void LogicEngineRenderer::renderText ( int  x,
int  y,
byte  effectHue 
)
inline

◆ resetEffect()

void LogicEngineRenderer::resetEffect ( )
inline

◆ restoreSettings()

void LogicEngineRenderer::restoreSettings ( )
inline

◆ selectEffect()

void LogicEngineRenderer::selectEffect ( long  inputNum)
inline

◆ selectScrollTextLeft()

void LogicEngineRenderer::selectScrollTextLeft ( const char *  text,
ColorVal  colorVal = kDefault,
uint8_t  speedScale = 0,
uint8_t  numSeconds = 0 
)
inline

◆ selectScrollTextRight()

void LogicEngineRenderer::selectScrollTextRight ( const char *  text,
ColorVal  colorVal = kDefault,
uint8_t  speedScale = 0,
uint8_t  numSeconds = 0 
)
inline

◆ selectScrollTextUp()

void LogicEngineRenderer::selectScrollTextUp ( const char *  text,
ColorVal  colorVal = kDefault,
uint8_t  speedScale = 0,
uint8_t  numSeconds = 0 
)
inline

◆ selectSequence()

void LogicEngineRenderer::selectSequence ( byte  seq,
ColorVal  colorVal = kDefault,
uint8_t  speedScale = 0,
uint8_t  numSeconds = 0 
)
inline

◆ selectTextCenter()

void LogicEngineRenderer::selectTextCenter ( const char *  text,
ColorVal  colorVal = kDefault,
uint8_t  speedScale = 0,
uint8_t  numSeconds = 0 
)
inline

◆ set()

void LogicEngineRenderer::set ( unsigned  index,
const struct CRGB &  val 
)
inline

◆ setBrightness()

void LogicEngineRenderer::setBrightness ( byte  bri)
inline

◆ setDelay()

void LogicEngineRenderer::setDelay ( byte  delay)
inline

◆ setEffectData()

void LogicEngineRenderer::setEffectData ( uint32_t  data)
inline

◆ setEffectData2()

void LogicEngineRenderer::setEffectData2 ( uint32_t  data)
inline

◆ setEffectDelay()

void LogicEngineRenderer::setEffectDelay ( uint32_t  effectDelay)
inline

◆ setEffectFlip()

void LogicEngineRenderer::setEffectFlip ( bool  flip)
inline

◆ setEffectFontNum()

void LogicEngineRenderer::setEffectFontNum ( byte  fontNum)
inline

◆ setEffectObject()

void LogicEngineRenderer::setEffectObject ( LogicEffectObject obj)
inline

◆ setEffectWidthRange()

void LogicEngineRenderer::setEffectWidthRange ( float  percent)
inline

◆ setFade()

void LogicEngineRenderer::setFade ( byte  fade)
inline

◆ setHSV()

void LogicEngineRenderer::setHSV ( unsigned  index,
uint8_t  hue,
uint8_t  sat,
uint8_t  val 
)
inline

◆ setHue()

void LogicEngineRenderer::setHue ( byte  hue)
inline

◆ setLogicEffectSelector()

void LogicEngineRenderer::setLogicEffectSelector ( LogicEffectSelector  selector)
inline

◆ setMessageSelector()

void LogicEngineRenderer::setMessageSelector ( LogicMessageSelector  selector)
inline

◆ setPaletteHue()

void LogicEngineRenderer::setPaletteHue ( byte  palNum,
byte  hue 
)
inline

◆ setPeakValueProvider()

void LogicEngineRenderer::setPeakValueProvider ( PeakValueProvider provider)
inline

◆ setPixel()

void LogicEngineRenderer::setPixel ( int  x,
int  y,
byte  effectHue,
byte  bri 
)
inline

◆ setPixelRGB() [1/2]

void LogicEngineRenderer::setPixelRGB ( int  x,
int  y,
const struct CRGB &  val 
)
inline

◆ setPixelRGB() [2/2]

void LogicEngineRenderer::setPixelRGB ( int  x,
int  y,
uint8_t  r,
uint8_t  g,
uint8_t  b 
)
inline

◆ setPMessageSelector()

void LogicEngineRenderer::setPMessageSelector ( LogicPMessageSelector  selector)
inline

◆ setTextMessage()

void LogicEngineRenderer::setTextMessage ( const char *  msg)
inline

◆ setup()

virtual void LogicEngineRenderer::setup ( )
inlineoverridevirtual

Subclasses must implement this function to perform any necessary setup that cannot happen in the constructor.

Implements SetupEvent.

◆ setupTextMessage()

void LogicEngineRenderer::setupTextMessage ( int  selectTextMsg)
inline

◆ updateDisplay() [1/2]

void LogicEngineRenderer::updateDisplay ( )
inline

◆ updateDisplay() [2/2]

void LogicEngineRenderer::updateDisplay ( byte  bri)
inline

◆ updateDisplayPeak()

void LogicEngineRenderer::updateDisplayPeak ( )
inline

◆ updateDisplaySplitHalf()

void LogicEngineRenderer::updateDisplaySplitHalf ( byte  topBri,
byte  bottomBri 
)
inline

◆ updateDisplaySplitRowThirds()

void LogicEngineRenderer::updateDisplaySplitRowThirds ( byte  topBri,
byte  bottomBri 
)
inline

◆ updateMappedLED()

void LogicEngineRenderer::updateMappedLED ( unsigned  index,
byte  hueVal,
byte  briVal = 255 
)
inline

◆ width()

int LogicEngineRenderer::width ( ) const
inline

Member Data Documentation

◆ fEffectSelector

LogicEffectSelector LogicEngineRenderer::fEffectSelector = NULL
protected

◆ fMessageSelector

LogicMessageSelector LogicEngineRenderer::fMessageSelector = NULL
protected

◆ fPMessageSelector

LogicPMessageSelector LogicEngineRenderer::fPMessageSelector = NULL
protected

◆ fSettings

LogicEngineSettings LogicEngineRenderer::fSettings
protected

◆ LogicMessageSelector

const typedef char*(* LogicEngineRenderer::LogicMessageSelector) (unsigned index)

◆ sLastEventCount

uint16_t LogicEngineRenderer::sLastEventCount
staticprotected

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