| Parola for Arduino 3.5 Text effects for LED Matrix modular hardware

Classes | Public Member Functions | List of all members
MD_PZone Class Reference

`#include <MD_Parola.h>`

## Public Member Functions
| MD_PZone (void)
void | begin (MD_MAX72XX *p)
| ~MD_PZone (void)
Methods for core object control.
bool | zoneAnimate (void)
bool | getStatus (void)
void | getZone (uint8_t &zStart, uint8_t &zEnd)
bool | isAnimationAdvanced (void)
void | zoneClear (void)
void | zoneReset (void)
void | zoneShutdown (bool b)
void | zoneSuspend (bool b)
void | setZone (uint8_t zStart, uint8_t zEnd)
Support methods for visually adjusting the display.
uint8_t | getCharSpacing (void)
uint8_t | getIntensity ()
bool | getInvert (void)
uint16_t | getPause (void)
uint16_t | getScrollSpacing (void)
uint16_t | getSpeed (void)
uint16_t | getSpeedIn (void)
uint16_t | getSpeedOut (void)
uint32_t | getSynchTime (void)
textPosition_t | getTextAlignment (void)
uint16_t | getTextWidth (const uint8_t *p)
boolean | getZoneEffect (zoneEffect_t ze)
void | setCharSpacing (uint8_t cs)
void | setIntensity (uint8_t intensity)
void | setInvert (uint8_t invert)
void | setPause (uint16_t pause)
void | setScrollSpacing (uint16_t space)
void | setSpeed (uint16_t speed)
void | setSpeedInOut (uint16_t speedIn, uint16_t speedOut)
void | setSpriteData (const uint8_t *inData, uint8_t inWidth, uint8_t inFrames, const uint8_t *outData, uint8_t outWidth, uint8_t outFrames)
void | setSynchTime (uint32_t zt)
void | setTextAlignment (textPosition_t ta)
void | setTextBuffer (const char *pb)
void | setTextEffect (textEffect_t effectIn, textEffect_t effectOut)
void | setZoneEffect (boolean b, zoneEffect_t ze)
Support methods for fonts and characters.
bool | addChar (uint16_t code, uint8_t *data)
bool | delChar (uint16_t code)
MD_MAX72XX::fontType_t * | getZoneFont (void)
void | setZoneFont (MD_MAX72XX::fontType_t *fontDef)
Support methods for graphics.
void | getZoneExtent (uint16_t &startColumn, uint16_t &endColumn)
void | getTextExtent (uint16_t &startColumn, uint16_t &endColumn)

## Detailed Description

Zone object for the Parola library. This class contains the text to be displayed and all the attributes for the zone.

## Constructor & Destructor Documentation

## ◆ MD_PZone()

MD_PZone::MD_PZone | ( | void |  | ) |

Class constructor.

Instantiate a new instance of the class.

## ◆ ~MD_PZone()

MD_PZone::~MD_PZone | ( | void |  | ) |

Class Destructor.

Release allocated memory and does the necessary to clean up once the object is no longer required.

## Member Function Documentation

## ◆ addChar()

bool MD_PZone::addChar | ( | uint16_t | code,
|  | uint8_t * | data
| ) |  |

Add a user defined character to the replacement list.

Add a replacement characters to the user defined list. The character data must be the same as for a single character in the font definition file. If a character is specified with a code the same as an existing character the existing data will be substituted for the new data. A character code of 0 is illegal as this denotes the end of string character for C++ and cannot be used in an actual string. The library does not copy the in the data in the data definition but only retains a pointer to the data, so any changes to the data storage in the calling program will be reflected in the library.

Parameters

  code | code for the character data.
  data | pointer to the character data.

Returns
  true of the character was inserted in the substitution list.

## ◆ begin()

void MD_PZone::begin | ( | MD_MAX72XX * | p | ) |

Initialize the object.

Initialize the object data. This will be called to initialize new data for the class that cannot be done during the object creation.

Parameters

  p | pointer to the parent's MD_MAX72xx object.

## ◆ delChar()

bool MD_PZone::delChar | ( | uint16_t | code | ) |

Delete a user defined character to the replacement list.

Delete a replacement character to the user defined list. A character code of 0 is illegal as this denotes the end of string character for C++ and cannot be used in an actual string.

Parameters

  code | ASCII code for the character data.

Returns
  true of the character was found in the substitution list.

## ◆ getCharSpacing()

uint8_t MD_PZone::getCharSpacing | ( | void |  | ) |

Get the zone inter-character spacing in columns.

Returns
  the current setting for the space between characters in columns.

## ◆ getIntensity()

uint8_t MD_PZone::getIntensity | ( |  | ) |

Get the zone brightness.

Get the intensity (brightness) of the display.

Returns
  The intensity setting.

## ◆ getInvert()

bool MD_PZone::getInvert | ( | void |  | ) |

Get the zone current invert state.

See the setInvert() method.

Returns
  the inverted boolean value.

## ◆ getPause()

uint16_t MD_PZone::getPause | ( | void |  | ) |

Get the zone pause time.

See the setPause() method.

Returns
  the pause value in milliseconds.

## ◆ getScrollSpacing()

uint16_t MD_PZone::getScrollSpacing | ( | void |  | ) |

Get the horizontal Scroll spacing.

See the setScrollSpacing() method

Returns
  the space between message in columns.

## ◆ getSpeed()

uint16_t MD_PZone::getSpeed | ( | void |  | ) |

Get the zone animation speed.

See the setSpeed() method. This should be replaced with either getSpeedIn() or getSpeedOut() unless it is known that both directions are running at the same speed.

Returns
  the IN speed value.

## ◆ getSpeedIn()

uint16_t MD_PZone::getSpeedIn | ( | void |  | ) |

Get the zone animation IN speed.

See the setSpeed() method.

Returns
  the speed value.

## ◆ getSpeedOut()

uint16_t MD_PZone::getSpeedOut | ( | void |  | ) |

Get the zone animation OUT speed.

See the setSpeed() method.

Returns
  the speed value.

## ◆ getStatus()

bool MD_PZone::getStatus | ( | void |  | ) |

Get the completion status.

Return the current completion status for the zone animation.

See comments for the MD_Parola getZoneStatus() method.

Returns
  bool true if the zone animation is completed

## ◆ getSynchTime()

uint32_t MD_PZone::getSynchTime | ( | void |  | ) |

Get the zone animation start time.

See the setSynchTime() method

Returns
  the internal time reference.

## ◆ getTextAlignment()

textPosition_t MD_PZone::getTextAlignment | ( | void |  | ) |

Get the current text alignment specification.

Returns
  the current text alignment setting

## ◆ getTextExtent()

void MD_PZone::getTextExtent | ( | uint16_t & | startColumn,
|  | uint16_t & | endColumn
| ) |  |

Get the start and end column numbers for the text displayed.

Returns the start and end column numbers for the text displayed in the zone. This retains consistency between user code and library.

Parameters

  startColumn | the by-reference parameter that will hold the return value for the start column.
  endColumn | the by-reference parameter that will hold the return value for the end column.

Returns
  The start and end columns in the by-reference parameters.

## ◆ getTextWidth()

uint16_t MD_PZone::getTextWidth | ( | const uint8_t * | p | ) |

Get the width of text in columns

Calculate the width of the characters and the space between them using the current font and text settings.

Parameters

  p | pointer to a text string

Returns
  the width of the string in display columns

## ◆ getZone()

void MD_PZone::getZone | ( | uint8_t & | zStart,
|  | uint8_t & | zEnd
| ) |  |

Get the start and end parameters for a zone.

See comments for the MD_Parola namesake method.

Parameters

  zStart | value for the start module number placed here [0..numZones-1].
  zEnd | value for the end module number placed here [0..numZones-1].

## ◆ getZoneEffect()

boolean MD_PZone::getZoneEffect | ( | zoneEffect_t | ze | ) |

Get the value of specified display effect.

The display effect is one of the zoneEffect_t types. The returned value will be true if the attribute is set, false if the attribute is not set.

Parameters

  ze | the required text alignment.

Returns
  true if the value is set, false otherwise.

## ◆ getZoneExtent()

void MD_PZone::getZoneExtent | ( | uint16_t & | startColumn,
|  | uint16_t & | endColumn
| ) |  |

Get the start and end column numbers for the zone.

Returns the start and end column numbers for the zone display. This retains consistency between user code and library.

Parameters

  startColumn | the by-reference parameter that will hold the return value for the start column.
  endColumn | the by-reference parameter that will hold the return value for the end column.

Returns
  The start and end columns in the by-reference parameters.

## ◆ getZoneFont()

MD_MAX72XX::fontType_t* MD_PZone::getZoneFont | ( | void |  | ) |

Get the display font.

Return the current font table pointer for this zone.

Returns
  Pointer to the font definition used.

## ◆ isAnimationAdvanced()

bool MD_PZone::isAnimationAdvanced | ( | void |  | ) |

Check if animation frame has advanced.

Check if the last call to zoneAnimate() resulted in the animation frame advancing by one or more frames in one or more zones.

Returns
  True if the animation frame advanced in any of the display zones.

## ◆ setCharSpacing()

void MD_PZone::setCharSpacing | ( | uint8_t | cs | ) |

Set the zone inter-character spacing in columns.

Set the number of blank columns between characters when they are displayed.

Parameters

  cs | space between characters in columns.

Returns
  No return value.

## ◆ setIntensity()

void MD_PZone::setIntensity | ( | uint8_t | intensity | ) |

Set the zone brightness.

Set the intensity (brightness) of the display.

Parameters

  intensity | the intensity to set the display (0-15).

Returns
  No return value.

## ◆ setInvert()

void MD_PZone::setInvert | ( | uint8_t | invert | ) |

Invert the zone display.

Set the display to inverted (ON LED turns OFF and vice versa).

Parameters

  invert | true for inverted display, false for normal display

Returns
  No return value.

## ◆ setPause()

void MD_PZone::setPause | ( | uint16_t | pause | ) |

Set the pause between ENTER and EXIT animations for this zone.

Between each entry and exit, the library will pause by the number of milliseconds specified to allow the viewer to read the message. For continuous scrolling displays this should be set to the same value as the display speed.

Parameters

  pause | the time, in milliseconds, between animations.

Returns
  No return value.

## ◆ setScrollSpacing()

void MD_PZone::setScrollSpacing | ( | uint16_t | space | ) |

Set the horizontal scrolling distance between messages.

When scrolling horizontally, the distance between the end of one message and the start of the next can be set using this method. Normal operation is for the message to be fully off the display before the new message starts. Set to zero for default behavior.

Parameters

  space | the spacing, in columns, between messages; zero for default behaviour..

Returns
  No return value.

## ◆ setSpeed()

void MD_PZone::setSpeed | ( | uint16_t | speed | ) |

Set the zone animation frame speed.

The speed of the display is the 'tick' time between animation frames. The lower this time the faster the animation; set it to zero to run as fast as possible.

This method will set the same value for both IN and OUT animations speed.

Parameters

  speed | the time, in milliseconds, between animation frames.

Returns
  No return value.

## ◆ setSpeedInOut()

void MD_PZone::setSpeedInOut | ( | uint16_t | speedIn,
|  | uint16_t | speedOut
| ) |  |

Set separate IN and OUT zone animation frame speed.

The speed of the display is the 'tick' time between animation frames. The lower this time the faster the animation; set it to zero to run as fast as possible.

This method will set both the IN and OUT animations separately to the specified speed.

Parameters

  speedIn | the time, in milliseconds, between IN animation frames.
  speedOut | the time, in milliseconds, between OUT animation frames.

Returns
  No return value.

## ◆ setSpriteData()

void MD_PZone::setSpriteData | ( | const uint8_t * | inData,
|  | uint8_t | inWidth,
|  | uint8_t | inFrames,
|  | const uint8_t * | outData,
|  | uint8_t | outWidth,
|  | uint8_t | outFrames
| ) |  |

Set data for user sprite effects.

Set up the data parameters for user sprite text entry/exit effects. See the comments for the namesake method in MD_Parola.

Parameters

  inData | pointer to the data table defining the entry sprite.
  inWidth | the width (in bytes) of each frame of the sprite.
  inFrames | the number of frames for the sprite.
  outData | pointer to the data table that is inWidth*InFrames in size.
  outWidth | the width (in bytes) of each frame of the sprite.
  outFrames | the number of frames for the sprite.

Returns
  No return value.

## ◆ setSynchTime()

void MD_PZone::setSynchTime | ( | uint32_t | zt | ) |

Set the zone animation start time.

Each zone animation has an associated start time. The start time defaults to the time when the zone is initialized. This method allows synchronization between zones by setting the same start time. Should be used in conjunction with the getSynchTime() method as the return value should only be treated as an internal reference and arbitrary values will result in irregular behavior.

Parameters

  zt | the required start time.

Returns
  No return value.

## ◆ setTextAlignment()

void MD_PZone::setTextAlignment | ( | textPosition_t | ta | ) |

Set the text alignment within the zone.

Text alignment is specified as one of the values in textPosition_t.

Parameters

  ta | the required text alignment.

Returns
  No return value.

## ◆ setTextBuffer()

void MD_PZone::setTextBuffer | ( | const char * | pb | ) |

Set the pointer to the text buffer for this zone.

Sets the text buffer to be a pointer to user data. See the comments for the namesake method in MD_Parola.

Parameters

  pb | pointer to the text buffer to be used.

Returns
  No return value.

## ◆ setTextEffect()

void MD_PZone::setTextEffect | ( | textEffect_t | effectIn,
|  | textEffect_t | effectOut
| ) |  |

Set the entry and exit text effects for the zone.

See the comments for the namesake method in MD_Parola.

Parameters

  effectIn | the entry effect, one of the textEffect_t enumerated values.
  effectOut | the exit effect, one of the textEffect_t enumerated values.

Returns
  No return value.

## ◆ setZone()

void MD_PZone::setZone | ( | uint8_t | zStart,
|  | uint8_t | zEnd
| ) |  |

Set the start and end parameters for a zone.

See comments for the MD_Parola namesake method.

Parameters

  zStart | the first module number for the zone [0..numZones-1].
  zEnd | the last module number for the zone [0..numZones-1].

## ◆ setZoneEffect()

void MD_PZone::setZoneEffect | ( | boolean | b,
|  | zoneEffect_t | ze
| ) |  |

Set the zone display effect.

The display effect is one of the zoneEffect_t types, and this will be set (true) or reset (false) depending on the boolean value. The resulting zone display will be modified as per the required effect.

Parameters

  b | set the value if true, reset the value if false
  ze | the required text alignment.

Returns
  No return value.

## ◆ setZoneFont()

void MD_PZone::setZoneFont | ( | MD_MAX72XX::fontType_t * | fontDef | ) |

Set the display font.

See comments for the namesake Parola method.

Parameters

  fontDef | Pointer to the font definition to be used.

Returns
  No return value.

## ◆ zoneAnimate()

bool MD_PZone::zoneAnimate | ( | void |  | ) |

Animate the zone.

Animate using the currently specified text and animation parameters. This method is invoked from the main Parola object.

Returns
  bool true if the zone animation has completed, false otherwise.

## ◆ zoneClear()

void MD_PZone::zoneClear | ( | void |  | ) |

Clear the zone.

See comments for the MD_Parola namesake method.

Returns
  No return value.

## ◆ zoneReset()

void MD_PZone::zoneReset | ( | void |  | ) |

Reset the current zone animation to restart.

See comments for the MD_Parola namesake method.

Returns
  No return value.

## ◆ zoneShutdown()

void MD_PZone::zoneShutdown | ( | bool | b | ) |

Shutdown or resume zone hardware.

See comments for the MD_Parola namesake method.

Parameters

  b | boolean value to shutdown (true) or resume (false).

Returns
  No return value.

## ◆ zoneSuspend()

void MD_PZone::zoneSuspend | ( | bool | b | ) |

Suspend or resume zone updates.

See comments for the MD_Parola namesake method.

Parameters

  b | boolean value to suspend (true) or resume (false).

Returns
  No return value.

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

- src/MD_Parola.h
- src/MD_Parola_Blinds.cpp
- src/MD_Parola_Close.cpp
- src/MD_Parola_Diag.cpp
- src/MD_Parola_Dissolve.cpp
- src/MD_Parola_Fade.cpp
- src/MD_Parola_Grow.cpp
- src/MD_Parola_HScroll.cpp
- src/MD_Parola_Mesh.cpp
- src/MD_Parola_Open.cpp
- src/MD_Parola_Print.cpp
- src/MD_Parola_Random.cpp
- src/MD_Parola_Scan.cpp
- src/MD_Parola_Slice.cpp
- src/MD_Parola_VScroll.cpp
- src/MD_Parola_Wipe.cpp
- src/MD_PZone.cpp