GUIslice  0.16.0
Embedded GUI in C
XGraph.c File Reference
#include "GUIslice.h"
#include "GUIslice_drv.h"
#include "elem/XGraph.h"
#include <stdio.h>
Include dependency graph for XGraph.c:

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 nBufMax, 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...
 
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...
 
void gslc_ElemXGraphAdd (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, int16_t nVal)
 Add a value to the graph at the latest position. More...
 
bool gslc_ElemXGraphDraw (void *pvGui, void *pvElemRef, gslc_teRedrawType eRedraw)
 Draw a Graph element on the screen. More...
 

Variables

const char GSLC_PMEM ERRSTR_NULL []
 
const char GSLC_PMEM ERRSTR_PXD_NULL []
 

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

Variable Documentation

const char GSLC_PMEM ERRSTR_NULL[]
const char GSLC_PMEM ERRSTR_PXD_NULL[]