1 #ifndef _GUISLICE_EX_XGAUGE_H_ 2 #define _GUISLICE_EX_XGAUGE_H_ 57 #define GSLC_TYPEX_GAUGE GSLC_TYPE_BASE_EXTEND + 0 153 uint16_t nIndicLen,uint16_t nIndicTip,
bool bIndicFill);
223 #if (GSLC_FEATURE_XGAUGE_RADIAL) 237 #if (GSLC_FEATURE_XGAUGE_RAMP) 286 #if (GSLC_USE_PROGMEM) 289 #define gslc_ElemXGaugeCreate_P(pGui,nElemId,nPage,nX,nY,nW,nH,\ 290 nMin_,nMax_,nVal_,colFrame_,colFill_,colGauge_,bVert_) \ 291 static const uint8_t nFeatures##nElemId = GSLC_ELEM_FEA_VALID | \ 292 GSLC_ELEM_FEA_GLOW_EN | GSLC_ELEM_FEA_FILL_EN; \ 293 static gslc_tsXGauge sGauge##nElemId; \ 294 sGauge##nElemId.nMin = nMin_; \ 295 sGauge##nElemId.nMax = nMax_; \ 296 sGauge##nElemId.nVal = nVal_; \ 297 sGauge##nElemId.nValLast = nVal_; \ 298 sGauge##nElemId.bValLastValid = false; \ 299 sGauge##nElemId.nStyle = GSLCX_GAUGE_STYLE_PROG_BAR; \ 300 sGauge##nElemId.colGauge = colGauge_; \ 301 sGauge##nElemId.colTick = GSLC_COL_GRAY; \ 302 sGauge##nElemId.nTickCnt = 8; \ 303 sGauge##nElemId.nTickLen = 5; \ 304 sGauge##nElemId.bVert = bVert_; \ 305 sGauge##nElemId.bFlip = false; \ 306 sGauge##nElemId.nIndicLen = 10; \ 307 sGauge##nElemId.nIndicTip = 3; \ 308 sGauge##nElemId.bIndicFill = false; \ 309 static const gslc_tsElem sElem##nElemId PROGMEM = { \ 311 nFeatures##nElemId, \ 313 (gslc_tsRect){nX,nY,nW,nH}, \ 314 GSLC_GROUP_ID_NONE, \ 315 colFrame_,colFill_,colFrame_,colFill_, \ 316 (gslc_tsImgRef){NULL,NULL,GSLC_IMGREF_NONE,NULL}, \ 317 (gslc_tsImgRef){NULL,NULL,GSLC_IMGREF_NONE,NULL}, \ 321 (gslc_teTxtFlags)(GSLC_TXT_DEFAULT), \ 324 GSLC_ALIGN_MID_MID, \ 328 (void*)(&sGauge##nElemId), \ 330 &gslc_ElemXGaugeDraw, \ 334 gslc_ElemAdd(pGui,nPage,(gslc_tsElem*)&sElem##nElemId, \ 335 (gslc_teElemRefFlags)(GSLC_ELEMREF_SRC_PROG | GSLC_ELEMREF_VISIBLE | GSLC_ELEMREF_REDRAW_FULL)); 340 #define gslc_ElemXGaugeCreate_P(pGui,nElemId,nPage,nX,nY,nW,nH,\ 341 nMin_,nMax_,nVal_,colFrame_,colFill_,colGauge_,bVert_) \ 342 static const uint8_t nFeatures##nElemId = GSLC_ELEM_FEA_VALID | \ 343 GSLC_ELEM_FEA_GLOW_EN | GSLC_ELEM_FEA_FILL_EN; \ 344 static gslc_tsXGauge sGauge##nElemId; \ 345 sGauge##nElemId.nMin = nMin_; \ 346 sGauge##nElemId.nMax = nMax_; \ 347 sGauge##nElemId.nVal = nVal_; \ 348 sGauge##nElemId.nValLast = nVal_; \ 349 sGauge##nElemId.bValLastValid = false; \ 350 sGauge##nElemId.nStyle = GSLCX_GAUGE_STYLE_PROG_BAR; \ 351 sGauge##nElemId.colGauge = colGauge_; \ 352 sGauge##nElemId.colTick = GSLC_COL_GRAY; \ 353 sGauge##nElemId.nTickCnt = 8; \ 354 sGauge##nElemId.nTickLen = 5; \ 355 sGauge##nElemId.bVert = bVert_; \ 356 sGauge##nElemId.bFlip = false; \ 357 sGauge##nElemId.nIndicLen = 10; \ 358 sGauge##nElemId.nIndicTip = 3; \ 359 sGauge##nElemId.bIndicFill = false; \ 360 static const gslc_tsElem sElem##nElemId = { \ 362 nFeatures##nElemId, \ 364 (gslc_tsRect){nX,nY,nW,nH}, \ 365 GSLC_GROUP_ID_NONE, \ 366 colFrame_,colFill_,colFrame_,colFill_, \ 367 (gslc_tsImgRef){NULL,NULL,GSLC_IMGREF_NONE,NULL}, \ 368 (gslc_tsImgRef){NULL,NULL,GSLC_IMGREF_NONE,NULL}, \ 372 (gslc_teTxtFlags)(GSLC_TXT_DEFAULT), \ 375 GSLC_ALIGN_MID_MID, \ 379 (void*)(&sGauge##nElemId), \ 381 &gslc_ElemXGaugeDraw, \ 385 gslc_ElemAdd(pGui,nPage,(gslc_tsElem*)&sElem##nElemId, \ 386 (gslc_teElemRefFlags)(GSLC_ELEMREF_SRC_CONST | GSLC_ELEMREF_VISIBLE | GSLC_ELEMREF_REDRAW_FULL)); 392 #endif // __cplusplus 393 #endif // _GUISLICE_EX_XGAUGE_H_ gslc_teXGaugeStyle nStyle
Gauge sub-type.
Definition: XGauge.h:84
bool bVert
Vertical if true, else Horizontal.
Definition: XGauge.h:89
int16_t nVal
Current control value.
Definition: XGauge.h:78
Ramp indicator.
Definition: XGauge.h:64
int16_t nMax
Maximum control value.
Definition: XGauge.h:75
int16_t nValLast
Last value.
Definition: XGauge.h:80
gslc_teRedrawType
Redraw types.
Definition: GUIslice.h:370
uint16_t nTickCnt
Number of gauge tick marks.
Definition: XGauge.h:87
gslc_teXGaugeStyle
Gauge drawing style.
Definition: XGauge.h:61
Radial indicator.
Definition: XGauge.h:63
gslc_tsColor colTick
Color of gauge tick marks.
Definition: XGauge.h:86
bool gslc_ElemXGaugeDraw(void *pvGui, void *pvElemRef, gslc_teRedrawType eRedraw)
Draw a gauge element on the screen.
Definition: XGauge.c:255
bool bValLastValid
Last value valid?
Definition: XGauge.h:81
Rectangular region. Defines X,Y corner coordinates plus dimensions.
Definition: GUIslice.h:519
void gslc_ElemXGaugeSetIndicator(gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, gslc_tsColor colGauge, uint16_t nIndicLen, uint16_t nIndicTip, bool bIndicFill)
Configure the appearance of the Gauge indicator.
Definition: XGauge.c:157
Progress bar.
Definition: XGauge.h:62
uint16_t nTickLen
Length of gauge tick marks.
Definition: XGauge.h:88
gslc_tsColor colGauge
Color of gauge fill bar.
Definition: XGauge.h:85
int16_t nMin
Minimum control value.
Definition: XGauge.h:74
Extended data for Gauge element.
Definition: XGauge.h:72
bool bFlip
Reverse direction of gauge.
Definition: XGauge.h:90
void gslc_ElemXGaugeUpdate(gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, int16_t nVal)
Update a Gauge element's current value.
Definition: XGauge.c:198
Element reference structure.
Definition: GUIslice.h:578
uint16_t nIndicTip
Size of tip at end of indicator.
Definition: XGauge.h:92
void gslc_ElemXGaugeSetTicks(gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, gslc_tsColor colTick, uint16_t nTickCnt, uint16_t nTickLen)
Configure the appearance of the Gauge ticks.
Definition: XGauge.c:178
GUI structure.
Definition: GUIslice.h:716
Color structure. Defines RGB triplet.
Definition: GUIslice.h:534
bool gslc_ElemXGaugeDrawProgressBar(gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, gslc_teRedrawType eRedraw)
Helper function to draw a gauge with style: progress bar.
Definition: XGauge.c:306
void gslc_ElemXGaugeSetFlip(gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, bool bFlip)
Set a Gauge element's fill direction.
Definition: XGauge.c:228
void gslc_ElemXGaugeSetStyle(gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, gslc_teXGaugeStyle nType)
Configure the style of a Gauge element.
Definition: XGauge.c:140
bool bIndicFill
Fill the indicator if true.
Definition: XGauge.h:93
uint16_t nIndicLen
Indicator length.
Definition: XGauge.h:91
gslc_tsElemRef * gslc_ElemXGaugeCreate(gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsXGauge *pXData, gslc_tsRect rElem, int16_t nMin, int16_t nMax, int16_t nVal, gslc_tsColor colGauge, bool bVert)
Create a Gauge Element.
Definition: XGauge.c:86