Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
LedEngine Class ReferenceProvides basic LED effects via subclassing (e.g. LedMC) or embedding (e.g. EmergencyStopMC). More...
Inheritance diagram for LedEngine:
Detailed DescriptionProvides basic LED effects via subclassing (e.g. LedMC) or embedding (e.g. EmergencyStopMC). This implements a collection of LED special effects so that the code can be reused various places as feedback to to the user. The basic effects provided are:
The 'c' prefix on a function (cset(), cflash(), ccycle()) means it will call clear() before doing its own setting. This is a quick way to replace whatever is currently displayed with whatever you are about to display. A flash() will invert and override the current setting, so that it will "reset" after the flash. Flashes change mid-range values to extremes to make the flash visible (ie not just (1-current)) Normal invert() will do simple inverses (just (1-current)), and doesn't change back automatically. Cycling ("pulsing") and single-value setting are mutually exclusive; one will cut off the other getSetting() returns value of last set(); getValue() returns what's actually being returned to Motion at the moment There's some nice functions for using the LEDs to display numbers. This is handy for when you want to be free of the terminal. The ERS-220 and ERS-7 have enough LEDs that they just use a "count the lights" style of display instead of this pseudo-arabic display. (look close to see that green bar LED at the top of the 210, which doesn't show up well in the camera image for some reason. ) The ERS-7 also has a "mode" which controls how certain face LEDs are interpreted. By setting ERS7Info::LEDABModeOffset / ERS7Info::LEDABModeMask, you can switch between the modes -- a value of 0 is mode "A", and a value of 1 is mode "B". Things to note for the ERS-7:
Definition at line 71 of file LedEngine.h.
Member Enumeration DocumentationUse these to specify a style for displaying numbers using displayNumber().
Definition at line 148 of file LedEngine.h. Use these to specify a style for displaying a percentage value [0-1] using displayPercent().
Definition at line 153 of file LedEngine.h. Constructor & Destructor Documentation
constructor - don't forget to call if you inherit Definition at line 125 of file LedEngine.cc.
destructor Definition at line 76 of file LedEngine.h. Member Function Documentation
Performs the 'cycle' calculation based on desired period, amplituted, amplitude offset, and time since start. See cycle(). Definition at line 187 of file LedEngine.h. Referenced by calcValue(). Performs the 'flash' calculation based on current value (uses calcInvert() if value upper or lower third, 0 or 1 otherwise). Definition at line 180 of file LedEngine.h. Referenced by flash(). Performs the 'invert' calculation based on current value (returns 1-value). Definition at line 176 of file LedEngine.h. Referenced by calcFlash().
Calculates the current value of led i for current time t. Definition at line 197 of file LedEngine.h. Referenced by flash(), getValue(), updateLEDFrames(), and updateLEDs().
causes the leds specified by leds to cycle between low and high, clears others. See cycle() for parameter documentation. Definition at line 110 of file LedEngine.h. Referenced by displayNumber().
sets the leds specified by leds to value for ms milliseconds, then sets back. Clears ~leds Definition at line 211 of file LedEngine.cc. Referenced by ControlBase::doSelect().
sets all leds to 0. Definition at line 280 of file LedEngine.cc. Referenced by ccycle(), cset(), ControlBase::deactivate(), displayNumber(), displayPercent(), ControlBase::doSelect(), and LedEngine().
sets the leds specified by leds to value, clears all the rest Definition at line 100 of file LedEngine.h. Referenced by ControlBase::doReadStdIn().
causes the leds specified by leds to cycle between low and high; values calculated for cycle will be clipped to [0,1] for more sensible blending of square wave approximations (high amplitude sine wave)
When this function is called, the starting time is stored as current time + phase. The equation used is
The idea is that with a amplitude=1 and offset=0, it will start at 0, ramp up to 1, and then ramp down again. The arguments to this function will let you control all parameters of the cycle. You can get a blink-on/off instead of cycle on/off by using a very large amplitude. Definition at line 263 of file LedEngine.cc. Referenced by ccycle(), and EmergencyStopMC::EmergencyStopMC().
Allows convenient display of numerical information to the LEDs on the face. If overflow occurs, the face LEDs are set to flash on and off 3 every 333 milliseconds Definition at line 299 of file LedEngine.cc. Referenced by ControlBase::refresh(), and FlashIPAddrBehavior::setupSequence().
Allows convenient display of percentage information to the LEDs on the face. Besides allowing a two-digit display, the 'edge' bar for each type is blinked to denote how full it is. So you can get up to a two-digit, base 5 display, with an extra digit of estimated value. If overflow (>1) occurs, sets everything to .75. The left and right columns are combined with an OR operation. (they overlap on the top bar) Left and right designations are dog centric! Definition at line 397 of file LedEngine.cc.
adds ms to all flash times (may resurrect previously completed flashes) Definition at line 290 of file LedEngine.cc.
sets the leds specified by leds to either a much higher or much lower value for ms milliseconds, then sets back. Definition at line 234 of file LedEngine.cc.
sets the leds specified by leds to value for ms milliseconds, then sets back. Definition at line 221 of file LedEngine.cc. Referenced by ControlBase::doSelect().
returns the current setting of the LED specified by led_id (the value you passed in set()) Definition at line 120 of file LedEngine.h.
returns the current value of the LED specified by led_id (the value being expressed - may change if cycling for instance) Definition at line 129 of file LedEngine.h. Referenced by FlashIPAddrBehavior::setupSequence().
sets the leds specified by leds to the inverse of their current value Definition at line 185 of file LedEngine.cc.
returns true if there are changes since the last updateLEDs() Reimplemented in LedMC. Definition at line 141 of file LedEngine.cc.
recalculates nextFlashEnd so we can tell when a flash has completed Definition at line 133 of file LedEngine.cc. Referenced by isDirty(), updateLEDFrames(), and updateLEDs().
sets the leds specified by leds to value Definition at line 198 of file LedEngine.cc.
used by displayPercent() to determine settings of LEDs Definition at line 440 of file LedEngine.cc. Referenced by displayPercent().
used by displayNumber() to determine settings of LEDs when using numStyle_t::twodigit Definition at line 371 of file LedEngine.cc. Referenced by displayNumber().
call this from a MotionCommand's updateOutputs() - performs the calculations to update LEDs' values
Definition at line 174 of file LedEngine.cc. Referenced by LedMC::updateOutputs().
call this from a MotionCommand's updateOutputs() - performs the calculations to update LEDs' values
Definition at line 164 of file LedEngine.cc.
call this from a MotionCommand's updateOutputs() - makes calls to MotionManager to update LED values
Definition at line 150 of file LedEngine.cc. Referenced by EmergencyStopMC::updateOutputs(). Member Data Documentation
Initial value:
{ (1<<0)|(1<<8), (1<<0), (1<<0)|(1<<1), (1<<0)|(1<<1)|(1<<2), (1<<0)|(1<<1)|(1<<2)|(1<<3), (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4), (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5), (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6), (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7), (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8), (1<<1)|(1<<3)|(1<<5)|(1<<7) } bit masks for the ondigit style of numberical display - just count the LEDs on the head This is "Count the dots" style Definition at line 146 of file LedEngine.h. Referenced by displayNumber(), and FlashIPAddrBehavior::setupSequence().
true if changes since last updateLEDs: either at least one LED is cycling or a flash has begun/ended Definition at line 223 of file LedEngine.h. Referenced by cflash(), clear(), cycle(), LedMC::doStart(), extendFlash(), flash(), invert(), isDirty(), set(), LedMC::setDirty(), updateLEDFrames(), updateLEDs(), and LedMC::updateOutputs().
the information regarding each of the LEDs Definition at line 222 of file LedEngine.h. Referenced by calcValue(), cflash(), clear(), cycle(), displayNumber(), extendFlash(), flash(), getSetting(), invert(), LedEngine(), recalcFlashEnd(), set(), and setOneOfTwo().
the soonest time a flash will end (and we'll become dirty) Definition at line 225 of file LedEngine.h. Referenced by cflash(), extendFlash(), flash(), LedMC::isAlive(), isDirty(), recalcFlashEnd(), updateLEDFrames(), updateLEDs(), and LedMC::updateOutputs().
the number of LEDs currently cycling (if non-zero, always dirty) Definition at line 224 of file LedEngine.h. Referenced by clear(), cycle(), set(), updateLEDFrames(), and updateLEDs(). The documentation for this class was generated from the following files: |
Tekkotsu v5.1CVS |
Generated Mon May 9 04:59:12 2016 by Doxygen 1.6.3 |