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

Class representing a smooth progress bar More...

#include <SmoothProgress.h>

Inheritance diagram for ProgressBar< DISP >:
BarPos

Public Member Functions

 ProgressBar (DISP &disp, byte _width, byte _col, byte _row, byte _pbn=0)
 Creates horizontal ProgressBar object More...
 
unsigned int size () const
 Returns the size of the progress bar in pixels (height for vertical, width for horizontal) More...
 
void showProgress (int val)
 Draws the progress bar on the LCD display More...
 
void showProgressPct (int val)
 Draws the progress bar on the LCD display More...
 
- Public Member Functions inherited from BarPos
 BarPos (byte _len, byte _col, byte _row, byte _id=0)
 Constructs the BarPos object representing the position and the size of the progress bar on the display More...
 
void setLength (int _len)
 Sets the length of the progress bar More...
 
int getLength () const
 Gets the length of the progress bar (in characters) More...
 
void setPosition (byte _col, byte _row)
 Sets the position of the progress bar on the display the row and the column represents the position of the start character of the progress bar (leftmost of the horizontal progress bar and the bottom one on a vertical progress bar) More...
 
uint8_t col () const
 Returns the position of the progress bar on the display More...
 
uint8_t row () const
 Returns the position of the progress bar on the display More...
 

Protected Member Functions

void showProg (int val, byte n)
 Draws the horizontal progress bar on the LCD display More...
 

Protected Attributes

const DISP & barDisp
 
- Protected Attributes inherited from BarPos
struct BarPos::ProgBarPar par
 

Detailed Description

template<class DISP>
class ProgressBar< DISP >

Class representing a smooth progress bar

Template Parameters
DISPBarDisplay class

Constructor & Destructor Documentation

◆ ProgressBar()

template<class DISP >
ProgressBar< DISP >::ProgressBar ( DISP &  disp,
byte  _width,
byte  _col,
byte  _row,
byte  _pbn = 0 
)
inline

Creates horizontal ProgressBar object

Template Parameters
DISPthe display on which it will be shown
lenthe length of the progress bar in characters, has to be 2 or more
rowposition: the row of the start end of the progress bar
colposition: the column of the start end of the progress bar
idthe id of the progress bar (4 supported: 0-3)

Member Function Documentation

◆ showProg()

template<class DISP >
void ProgressBar< DISP >::showProg ( int  val,
byte  n 
)
inlineprotected

Draws the horizontal progress bar on the LCD display

Parameters
valat what extent it is filled in pixels
nthe id of the progress bar : 0-3

◆ showProgress()

template<class DISP >
void ProgressBar< DISP >::showProgress ( int  val)
inline

Draws the progress bar on the LCD display

Parameters
valat what extent it is filled (left to right) in pixels : 0 to (including) size()

The progress bar is "drawn" printing over all the characters occupied by the progress bar on every call< / remarks>

◆ showProgressPct()

template<class DISP >
void ProgressBar< DISP >::showProgressPct ( int  val)
inline

Draws the progress bar on the LCD display

Parameters
valat what extent it is filled (left to right) in percents : 0 to 100

The progress bar is "drawn" printing over all the characters occupied by the progress bar on every call< / remarks>

◆ size()

template<class DISP >
unsigned int ProgressBar< DISP >::size ( ) const
inline

Returns the size of the progress bar in pixels (height for vertical, width for horizontal)

Returns
the size of the progress bar in pixels (to be filled - without the possible frame and he margin)

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