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

Functions

gslc_tsElemRefgslc_ElemXRadialCreate (gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsXRadial *pXData, gslc_tsRect rElem, int16_t nMin, int16_t nMax, int16_t nVal, gslc_tsColor colGauge)
 Create a Radial Gauge Element. More...
 
void gslc_ElemXRadialSetIndicator (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, gslc_tsColor colGauge, uint16_t nIndicLen, uint16_t nIndicTip, bool bIndicFill)
 Configure the appearance of the Gauge indicator. More...
 
void gslc_ElemXRadialSetTicks (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, gslc_tsColor colTick, uint16_t nTickCnt, uint16_t nTickLen)
 Configure the appearance of the Gauge ticks. More...
 
void gslc_ElemXRadialSetVal (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, int16_t nVal)
 Update a Gauge element's current value. More...
 
void gslc_ElemXRadialSetFlip (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, bool bFlip)
 Set a Gauge element's rotation direction. More...
 
bool gslc_ElemXRadialDraw (void *pvGui, void *pvElemRef, gslc_teRedrawType eRedraw)
 Draw a gauge element on the screen. More...
 
void gslc_ElemXRadialDrawRadialHelp (gslc_tsGui *pGui, int16_t nX, int16_t nY, uint16_t nArrowLen, uint16_t nArrowSz, int16_t n64Ang, bool bFill, gslc_tsColor colFrame)
 
bool gslc_ElemXRadialDrawRadial (gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, gslc_teRedrawType eRedraw)
 Helper function to draw a gauge with style: radial. More...
 

Variables

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

Function Documentation

gslc_tsElemRef* gslc_ElemXRadialCreate ( gslc_tsGui pGui,
int16_t  nElemId,
int16_t  nPage,
gslc_tsXRadial pXData,
gslc_tsRect  rElem,
int16_t  nMin,
int16_t  nMax,
int16_t  nVal,
gslc_tsColor  colGauge 
)

Create a Radial Gauge Element.

  • Draws a gauge element that represents a proportion (nVal) between nMin and nMax.
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 gauge size
[in]nMinMinimum value of gauge for nVal comparison
[in]nMaxMaximum value of gauge for nVal comparison
[in]nValStarting value of gauge
[in]colGaugeColor for the gauge indicator
Returns
Pointer to Element reference or NULL if failure
bool gslc_ElemXRadialDraw ( void *  pvGui,
void *  pvElemRef,
gslc_teRedrawType  eRedraw 
)

Draw a gauge 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
bool gslc_ElemXRadialDrawRadial ( gslc_tsGui pGui,
gslc_tsElemRef pElemRef,
gslc_teRedrawType  eRedraw 
)

Helper function to draw a gauge with style: radial.

Parameters
[in]pGuiPtr to GUI
[in]pElemRefPtr to Element reference
[in]eRedrawRedraw status
Returns
true if success, false otherwise
void gslc_ElemXRadialDrawRadialHelp ( gslc_tsGui pGui,
int16_t  nX,
int16_t  nY,
uint16_t  nArrowLen,
uint16_t  nArrowSz,
int16_t  n64Ang,
bool  bFill,
gslc_tsColor  colFrame 
)
void gslc_ElemXRadialSetFlip ( gslc_tsGui pGui,
gslc_tsElemRef pElemRef,
bool  bFlip 
)

Set a Gauge element's rotation direction.

  • Setting bFlip reverses the rotation direction
  • Default rotation is clockwise. When bFlip is set, uses counter-clockwise
Parameters
[in]pGuiPointer to GUI
[in]pElemRefPointer to Element reference
[in]bFlipIf set, reverse direction of rotation from default
Returns
none
void gslc_ElemXRadialSetIndicator ( gslc_tsGui pGui,
gslc_tsElemRef pElemRef,
gslc_tsColor  colGauge,
uint16_t  nIndicLen,
uint16_t  nIndicTip,
bool  bIndicFill 
)

Configure the appearance of the Gauge indicator.

Parameters
[in]pGuiPointer to GUI
[in]pElemRefPointer to Element reference
[in]colGaugeColor of the indicator
[in]nIndicLenLength of the indicator
[in]nIndicTipSize of the indicator tip
[in]bIndicFillFill in the indicator if true
Returns
none
void gslc_ElemXRadialSetTicks ( gslc_tsGui pGui,
gslc_tsElemRef pElemRef,
gslc_tsColor  colTick,
uint16_t  nTickCnt,
uint16_t  nTickLen 
)

Configure the appearance of the Gauge ticks.

Parameters
[in]pGuiPointer to GUI
[in]pElemRefPointer to Element reference
[in]colTickColor of the gauge ticks
[in]nTickCntNumber of ticks to draw around / along gauge
[in]nTickLenLength of the tick marks to draw
Returns
none
void gslc_ElemXRadialSetVal ( gslc_tsGui pGui,
gslc_tsElemRef pElemRef,
int16_t  nVal 
)

Update a Gauge element's current value.

  • Note that min & max values are assigned in create()
Parameters
[in]pGuiPointer to GUI
[in]pElemRefPointer to Element reference
[in]nValNew value to show in gauge
Returns
none

Variable Documentation

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