AceSegment  0.3.0
An adjustable, configurable, and extensible framework for rendering seven segment LED displays.
Public Member Functions | List of all members
ace_segment::RendererBuilder Class Reference

A builder for the Renderer. More...

#include <RendererBuilder.h>

Public Member Functions

 RendererBuilder (Hardware *hardware, Driver *driver, StyledPattern *styledPatterns, uint8_t numDigits)
 Constructor. More...
 
RendererBuildersetFramesPerSecond (uint8_t framesPerSecond)
 Set the desired frame rate. More...
 
RendererBuildersetStatsResetInterval (uint16_t statsResetInterval)
 Set the maximum number of stats updates after which it is periodicallly reset. More...
 
RendererBuildersetStyler (uint8_t styleIndex, Styler *styler)
 Set the Styler for the given styleIndex. More...
 
Rendererbuild ()
 Return a new instance of Renderer with the various configurable parameters. More...
 

Detailed Description

A builder for the Renderer.

Create an instance of this object, optionally call the various configuration methods, then call build() to get a new instance of Renderer.

Definition at line 41 of file RendererBuilder.h.

Constructor & Destructor Documentation

◆ RendererBuilder()

ace_segment::RendererBuilder::RendererBuilder ( Hardware hardware,
Driver driver,
StyledPattern styledPatterns,
uint8_t  numDigits 
)
inlineexplicit

Constructor.

Definition at line 44 of file RendererBuilder.h.

Member Function Documentation

◆ build()

Renderer* ace_segment::RendererBuilder::build ( )
inline

Return a new instance of Renderer with the various configurable parameters.

The Renderer::init() method must be called before using it.

Definition at line 102 of file RendererBuilder.h.

◆ setFramesPerSecond()

RendererBuilder& ace_segment::RendererBuilder::setFramesPerSecond ( uint8_t  framesPerSecond)
inline

Set the desired frame rate.

Default is 60.

Borrowing some terminology from motion picture videos, a "frame" is a full rendering of an image, and a field is a partial rendering of the frame. Each call to renderField() will process a single field of a frame. Different wiring will require different number of fields to produce an entire frame.

fieldsPerSec(resistorsOnDigits) = mFramesPerSecond * kNumSegments fieldsPerSec(resistorsOnSegments) = mFramesPerSecond * mNumDigits

Definition at line 70 of file RendererBuilder.h.

◆ setStatsResetInterval()

RendererBuilder& ace_segment::RendererBuilder::setStatsResetInterval ( uint16_t  statsResetInterval)
inline

Set the maximum number of stats updates after which it is periodicallly reset.

Set to 0 for no auto reset. Periodic resets are useful to remove spurious min and max. The default is kStatsResetIntervalDefault which is 1200 samples. At 60 frames per second with 4 fields per frame, that's about 5 seconds.

Definition at line 82 of file RendererBuilder.h.

◆ setStyler()

RendererBuilder& ace_segment::RendererBuilder::setStyler ( uint8_t  styleIndex,
Styler styler 
)
inline

Set the Styler for the given styleIndex.

Currently supports maximum of kNumStyles which is 4.

Definition at line 91 of file RendererBuilder.h.


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