GUIslice  0.16.0
Embedded GUI in C
XGraph.h File Reference
#include "GUIslice.h"
Include dependency graph for XGraph.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  gslc_tsXGraph
 Extended data for Graph element. More...
 

Macros

#define GSLC_TYPEX_GRAPH
 

Enumerations

enum  gslc_teXGraphStyle { GSLCX_GRAPH_STYLE_DOT, GSLCX_GRAPH_STYLE_LINE, GSLCX_GRAPH_STYLE_FILL }
 Gauge drawing style. More...
 

Functions

gslc_tsElemRefgslc_ElemXGraphCreate (gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsXGraph *pXData, gslc_tsRect rElem, int16_t nFontId, int16_t *pBuf, uint16_t nBufRows, gslc_tsColor colGraph)
 Create a Graph Element. More...
 
void gslc_ElemXGraphSetStyle (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, gslc_teXGraphStyle eStyle, uint8_t nMargin)
 Set the graph's additional drawing characteristics. More...
 
void gslc_ElemXGraphSetRange (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, int16_t nYMin, int16_t nYMax)
 Set the graph's drawing range. More...
 
bool gslc_ElemXGraphDraw (void *pvGui, void *pvElemRef, gslc_teRedrawType eRedraw)
 Draw a Graph element on the screen. More...
 
void gslc_ElemXGraphAdd (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, int16_t nVal)
 Add a value to the graph at the latest position. More...
 
void gslc_ElemXGraphScrollSet (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, uint8_t nScrollPos, uint8_t nScrollMax)
 Set the graph scroll position (nScrollPos) as a fraction of nScrollMax. More...
 

Macro Definition Documentation

#define GSLC_TYPEX_GRAPH

Enumeration Type Documentation

Gauge drawing style.

Enumerator
GSLCX_GRAPH_STYLE_DOT 

Dot.

GSLCX_GRAPH_STYLE_LINE 

Line.

GSLCX_GRAPH_STYLE_FILL 

Filled.

Function Documentation

void gslc_ElemXGraphAdd ( gslc_tsGui pGui,
gslc_tsElemRef pElemRef,
int16_t  nVal 
)

Add a value to the graph at the latest position.

Parameters
[in]pGuiPointer to GUI
[in]pElemRefPointer to Element reference
[in]nValData value to add
Returns
none
gslc_tsElemRef* gslc_ElemXGraphCreate ( gslc_tsGui pGui,
int16_t  nElemId,
int16_t  nPage,
gslc_tsXGraph pXData,
gslc_tsRect  rElem,
int16_t  nFontId,
int16_t *  pBuf,
uint16_t  nBufRows,
gslc_tsColor  colGraph 
)

Create a Graph Element.

Parameters
[in]pGuiPointer to GUI
[in]nElemIdElement ID to assign (0..16383 or GSLC_ID_AUTO to autogen)
[in]nPagePage ID to attach element to
[in]pXDataPtr to extended element data structure
[in]rElemRectangle coordinates defining checkbox size
[in]nFontIdFont ID to use for graph area
[in]pBufPtr to data buffer (already allocated) with size (nBufMax) int16_t
[in]nBufRowsMaximum number of points in buffer
[in]colGraphColor of the graph
Returns
Pointer to Element reference or NULL if failure
bool gslc_ElemXGraphDraw ( void *  pvGui,
void *  pvElemRef,
gslc_teRedrawType  eRedraw 
)

Draw a Graph element on the screen.

Parameters
[in]pvGuiVoid ptr to GUI (typecast to gslc_tsGui*)
[in]pvElemRefVoid ptr to Element reference (typecast to gslc_tsElemRef*)
[in]eRedrawRedraw mode
Returns
true if success, false otherwise
void gslc_ElemXGraphScrollSet ( gslc_tsGui pGui,
gslc_tsElemRef pElemRef,
uint8_t  nScrollPos,
uint8_t  nScrollMax 
)

Set the graph scroll position (nScrollPos) as a fraction of nScrollMax.

Parameters
[in]pGuiPointer to GUI
[in]pElemRefPointer to Element reference
[in]nScrollPosNew scroll position
[in]nScrollMaxMaximum scroll position
Returns
none
void gslc_ElemXGraphSetRange ( gslc_tsGui pGui,
gslc_tsElemRef pElemRef,
int16_t  nYMin,
int16_t  nYMax 
)

Set the graph's drawing range.

Parameters
[in]pGuiPointer to GUI
[in]pElemRefPointer to Element reference
[in]nYMinMinimum Y value to draw
[in]nYMaxMaximum Y value to draw
Returns
none
void gslc_ElemXGraphSetStyle ( gslc_tsGui pGui,
gslc_tsElemRef pElemRef,
gslc_teXGraphStyle  eStyle,
uint8_t  nMargin 
)

Set the graph's additional drawing characteristics.

Parameters
[in]pGuiPointer to GUI
[in]pElemRefPointer to Element reference
[in]eStyleDrawing style for the graph
[in]nMarginMargin to provide around graph area inside frame
Returns
none