SmoothProgress 1.0.0
Displays smooth progress bars on a character based LCD displays for Arduino
BarDisplay< DISP > Class Template Reference

Public Types

enum  UDCharCode : byte {
  ProgBarCharBlank = 0 , ProgBarCharFull , ProgBarCharBegin , ProgBarCharEnd ,
  ProgBarCharPartial
}
 

Public Member Functions

 BarDisplay (DISP &displ, const barstyle &bs)
 BarDisplay constructor creates the object that bounds the LCD display to the bar style defined in the barstyle struct the style is common for all progress bars on that display (hardware limitations of the LCD displays that have only 8 user definable characters) More...
 
 BarDisplay (DISP &displ, const inPROGMEM &wraped)
 BarDisplay constructor creates the object that bounds the LCD display to the bar style defined in the barstyle struct the style is common for all progress bars on that display (hardware limitations of the LCD displays that have only 8 user definable characters) More...
 
 BarDisplay (DISP &displ, const barstyle *bsp)
 
 BarDisplay (DISP &displ, const __FlashBarStyleHelper *bspf)
 
 BarDisplay (const BarDisplay &)=delete
 
BarDisplayoperator= (const BarDisplay &)=delete
 
DISP & dsplay () const
 Access to the display object for low level functions of the LCD More...
 
const barstylegetStyle () const
 Access to the bar style structure More...
 
void setStyle (const barstyle &bs)
 Sets the style of the progress bars on the display More...
 
void setStyle (const inPROGMEM &wraped)
 Sets the style of the progress bars on the display More...
 
barstyle::bspar stylePar () const
 Access to the parameters of the style More...
 
int styleStartOffset () const
 Returns the start offset (in pixels) of the progress bars More...
 
int styleEndOffset () const
 Returns the end offset (in pixels) of the progress bars More...
 
uint8_t styleOrientation () const
 Returns the orientation of the progress bar More...
 
void begin () const
 Initializes the BarDisplay object with the progress bar style
 
void makeChar (byte udChr, const uint8_t xMask[2][barstyle::CharPatRows], uint8_t mask) const
 Creates a user defined character in the CGRAM of the LCD display More...
 

Protected Member Functions

void makeCharMask (uint8_t out[barstyle::CharPatRows], const uint8_t xMask[2][barstyle::CharPatRows], uint8_t mask) const
 Prepares the bitmap for making the user defined character More...
 
void createChar (byte udChr, const uint8_t bitMask[barstyle::CharPatRows]) const
 Creates a user defined character in the CGRAM of the LCD display using the bitmap stored in bitMask argument More...
 
void createChar (byte udChr, const uint8_t xMask[2][barstyle::CharPatRows]) const
 Creates a user defined character in the CGRAM of the LCD display using the bitmaps stored in xMask argument More...
 

Protected Attributes

DISP & disp
 
const barstylebarStyle
 
MemoryType styleMemPlacement
 

Constructor & Destructor Documentation

◆ BarDisplay() [1/2]

template<class DISP = LCD_OBJ>
BarDisplay< DISP >::BarDisplay ( DISP &  displ,
const barstyle bs 
)
inline

BarDisplay constructor creates the object that bounds the LCD display to the bar style defined in the barstyle struct the style is common for all progress bars on that display (hardware limitations of the LCD displays that have only 8 user definable characters)

Parameters
displthe object (as created by the LiquidCrystal library) used to access the particular LCD display
bsthe structure defining the masks for the progress bar style stored in RAM

◆ BarDisplay() [2/2]

template<class DISP = LCD_OBJ>
BarDisplay< DISP >::BarDisplay ( DISP &  displ,
const inPROGMEM wraped 
)
inline

BarDisplay constructor creates the object that bounds the LCD display to the bar style defined in the barstyle struct the style is common for all progress bars on that display (hardware limitations of the LCD displays that have only 8 user definable characters)

Parameters
displthe object (as created by the LiquidCrystal library) used to access the LCD display
wrapedinPROGMEM wrapper object for the structure defining the masks for the progress bar style stored in FLASH

Member Function Documentation

◆ createChar() [1/2]

template<class DISP = LCD_OBJ>
void BarDisplay< DISP >::createChar ( byte  udChr,
const uint8_t  bitMask[barstyle::CharPatRows] 
) const
inlineprotected

Creates a user defined character in the CGRAM of the LCD display using the bitmap stored in bitMask argument

Parameters
udChrcharacter code position 0-7
bitMaskpointer to the array holding the bitmap of the character

◆ createChar() [2/2]

template<class DISP = LCD_OBJ>
void BarDisplay< DISP >::createChar ( byte  udChr,
const uint8_t  xMask[2][barstyle::CharPatRows] 
) const
inlineprotected

Creates a user defined character in the CGRAM of the LCD display using the bitmaps stored in xMask argument

Parameters
udChrcharacter code position 0-7
xMask2x8 matrix holding the bitmaps (AND and OR mask) that are OR-ed together to get the character bitmap

◆ dsplay()

template<class DISP = LCD_OBJ>
DISP & BarDisplay< DISP >::dsplay ( ) const
inline

Access to the display object for low level functions of the LCD

Returns
a pointer to the LCD display object

◆ getStyle()

template<class DISP = LCD_OBJ>
const barstyle & BarDisplay< DISP >::getStyle ( ) const
inline

Access to the bar style structure

Returns
reference to barstyle structure defining the style of the progress bars on the display

◆ makeChar()

template<class DISP = LCD_OBJ>
void BarDisplay< DISP >::makeChar ( byte  udChr,
const uint8_t  xMask[2][barstyle::CharPatRows],
uint8_t  mask 
) const
inline

Creates a user defined character in the CGRAM of the LCD display

Parameters
udChrcharacter code position 0-7
xMaskpointer to masks (AND and OR in PROGMEM) to be used when defining the character
maskmask (left filled with 1's) defining how much the character will be filled

◆ makeCharMask()

template<class DISP = LCD_OBJ>
void BarDisplay< DISP >::makeCharMask ( uint8_t  out[barstyle::CharPatRows],
const uint8_t  xMask[2][barstyle::CharPatRows],
uint8_t  mask 
) const
inlineprotected

Prepares the bitmap for making the user defined character

Parameters
outpointer to array to hold the output bitmap
xMaskpointer to the AND and OR masks defining the style - the bits that always be off (margin) and the bits that will always be on (frame)
maskmask (left filled with 1's) defining how much the character will actually be filled with pixels

◆ setStyle() [1/2]

template<class DISP = LCD_OBJ>
void BarDisplay< DISP >::setStyle ( const barstyle bs)
inline

Sets the style of the progress bars on the display

Parameters
bsbarstyle structure (stored in RAM) holding the definition of the style

◆ setStyle() [2/2]

template<class DISP = LCD_OBJ>
void BarDisplay< DISP >::setStyle ( const inPROGMEM wraped)
inline

Sets the style of the progress bars on the display

Parameters
bsbarstyle structure (stored in FLASH wrap it up using inPROGMEM(.) !) holding the definition of the style

◆ styleEndOffset()

template<class DISP = LCD_OBJ>
int BarDisplay< DISP >::styleEndOffset ( ) const
inline

Returns the end offset (in pixels) of the progress bars

Returns
end offset (in pixels)

◆ styleOrientation()

template<class DISP = LCD_OBJ>
uint8_t BarDisplay< DISP >::styleOrientation ( ) const
inline

Returns the orientation of the progress bar

Returns
orientation 0:Horizontal==0 or 1:Vertical

◆ stylePar()

template<class DISP = LCD_OBJ>
barstyle::bspar BarDisplay< DISP >::stylePar ( ) const
inline

Access to the parameters of the style

Returns
reference to the nested structure bspar defining the offsets and the orientation of the progress bars

◆ styleStartOffset()

template<class DISP = LCD_OBJ>
int BarDisplay< DISP >::styleStartOffset ( ) const
inline

Returns the start offset (in pixels) of the progress bars

Returns
start offset (in pixels)

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