1 #ifndef _GUISLICE_EX_XRADIAL_H_ 2 #define _GUISLICE_EX_XRADIAL_H_ 54 #define GSLC_TYPEX_RADIAL GSLC_TYPE_BASE_EXTEND + 61 121 uint16_t nIndicLen,uint16_t nIndicTip,
bool bIndicFill);
223 #if (GSLC_USE_PROGMEM) 226 #define gslc_ElemXRadialCreate_P(pGui,nElemId,nPage,nX,nY,nW,nH,\ 227 nMin_,nMax_,nVal_,colFrame_,colFill_,colGauge_) \ 228 static const uint8_t nFeatures##nElemId = GSLC_ELEM_FEA_VALID | \ 229 GSLC_ELEM_FEA_GLOW_EN | GSLC_ELEM_FEA_FILL_EN; \ 230 static gslc_tsXRadial sGauge##nElemId; \ 231 sGauge##nElemId.nMin = nMin_; \ 232 sGauge##nElemId.nMax = nMax_; \ 233 sGauge##nElemId.nVal = nVal_; \ 234 sGauge##nElemId.nValLast = nVal_; \ 235 sGauge##nElemId.bValLastValid = false; \ 236 sGauge##nElemId.colGauge = colGauge_; \ 237 sGauge##nElemId.colTick = GSLC_COL_GRAY; \ 238 sGauge##nElemId.nTickCnt = 8; \ 239 sGauge##nElemId.nTickLen = 5; \ 240 sGauge##nElemId.bFlip = false; \ 241 sGauge##nElemId.nIndicLen = 10; \ 242 sGauge##nElemId.nIndicTip = 3; \ 243 sGauge##nElemId.bIndicFill = false; \ 244 static const gslc_tsElem sElem##nElemId PROGMEM = { \ 246 nFeatures##nElemId, \ 248 (gslc_tsRect){nX,nY,nW,nH}, \ 249 GSLC_GROUP_ID_NONE, \ 250 colFrame_,colFill_,colFrame_,colFill_, \ 251 (gslc_tsImgRef){NULL,NULL,GSLC_IMGREF_NONE,NULL}, \ 252 (gslc_tsImgRef){NULL,NULL,GSLC_IMGREF_NONE,NULL}, \ 256 (gslc_teTxtFlags)(GSLC_TXT_DEFAULT), \ 259 GSLC_ALIGN_MID_MID, \ 263 (void*)(&sGauge##nElemId), \ 265 &gslc_ElemXRadialDraw, \ 269 gslc_ElemAdd(pGui,nPage,(gslc_tsElem*)&sElem##nElemId, \ 270 (gslc_teElemRefFlags)(GSLC_ELEMREF_SRC_PROG | GSLC_ELEMREF_VISIBLE | GSLC_ELEMREF_REDRAW_FULL)); 275 #define gslc_ElemXRadialCreate_P(pGui,nElemId,nPage,nX,nY,nW,nH,\ 276 nMin_,nMax_,nVal_,colFrame_,colFill_,colGauge_) \ 277 static const uint8_t nFeatures##nElemId = GSLC_ELEM_FEA_VALID | \ 278 GSLC_ELEM_FEA_GLOW_EN | GSLC_ELEM_FEA_FILL_EN; \ 279 static gslc_tsXRadial sGauge##nElemId; \ 280 sGauge##nElemId.nMin = nMin_; \ 281 sGauge##nElemId.nMax = nMax_; \ 282 sGauge##nElemId.nVal = nVal_; \ 283 sGauge##nElemId.nValLast = nVal_; \ 284 sGauge##nElemId.bValLastValid = false; \ 285 sGauge##nElemId.colGauge = colGauge_; \ 286 sGauge##nElemId.colTick = GSLC_COL_GRAY; \ 287 sGauge##nElemId.nTickCnt = 8; \ 288 sGauge##nElemId.nTickLen = 5; \ 289 sGauge##nElemId.bFlip = false; \ 290 sGauge##nElemId.nIndicLen = 10; \ 291 sGauge##nElemId.nIndicTip = 3; \ 292 sGauge##nElemId.bIndicFill = false; \ 293 static const gslc_tsElem sElem##nElemId = { \ 295 nFeatures##nElemId, \ 297 (gslc_tsRect){nX,nY,nW,nH}, \ 298 GSLC_GROUP_ID_NONE, \ 299 colFrame_,colFill_,colFrame_,colFill_, \ 300 (gslc_tsImgRef){NULL,NULL,GSLC_IMGREF_NONE,NULL}, \ 301 (gslc_tsImgRef){NULL,NULL,GSLC_IMGREF_NONE,NULL}, \ 305 (gslc_teTxtFlags)(GSLC_TXT_DEFAULT), \ 308 GSLC_ALIGN_MID_MID, \ 312 (void*)(&sGauge##nElemId), \ 314 &gslc_ElemXRadialDraw, \ 318 gslc_ElemAdd(pGui,nPage,(gslc_tsElem*)&sElem##nElemId, \ 319 (gslc_teElemRefFlags)(GSLC_ELEMREF_SRC_CONST | GSLC_ELEMREF_VISIBLE | GSLC_ELEMREF_REDRAW_FULL)); 325 #endif // __cplusplus 326 #endif // _GUISLICE_EX_XRADIAL_H_ void gslc_ElemXRadialSetVal(gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, int16_t nVal)
Update a Gauge element's current value.
Definition: XRadial.c:172
bool bFlip
Reverse direction of gauge.
Definition: XRadial.h:78
bool gslc_ElemXRadialDraw(void *pvGui, void *pvElemRef, gslc_teRedrawType eRedraw)
Draw a gauge element on the screen.
Definition: XRadial.c:225
int16_t nMax
Maximum control value.
Definition: XRadial.h:65
gslc_teRedrawType
Redraw types.
Definition: GUIslice.h:370
bool gslc_ElemXRadialDrawRadial(gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, gslc_teRedrawType eRedraw)
Helper function to draw a gauge with style: radial.
Definition: XRadial.c:297
bool bIndicFill
Fill the indicator if true.
Definition: XRadial.h:81
uint16_t nIndicLen
Indicator length.
Definition: XRadial.h:79
uint16_t nIndicTip
Size of tip at end of indicator.
Definition: XRadial.h:80
Rectangular region. Defines X,Y corner coordinates plus dimensions.
Definition: GUIslice.h:519
Extended data for Gauge element.
Definition: XRadial.h:62
bool bValLastValid
Last value valid?
Definition: XRadial.h:71
gslc_tsColor colGauge
Color of gauge fill bar.
Definition: XRadial.h:74
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.
Definition: XRadial.c:82
uint16_t nTickCnt
Number of gauge tick marks.
Definition: XRadial.h:76
Element reference structure.
Definition: GUIslice.h:578
void gslc_ElemXRadialSetFlip(gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, bool bFlip)
Set a Gauge element's rotation direction.
Definition: XRadial.c:199
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.
Definition: XRadial.c:153
gslc_tsColor colTick
Color of gauge tick marks.
Definition: XRadial.h:75
int16_t nVal
Current control value.
Definition: XRadial.h:68
uint16_t nTickLen
Length of gauge tick marks.
Definition: XRadial.h:77
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.
Definition: XRadial.c:133
GUI structure.
Definition: GUIslice.h:716
Color structure. Defines RGB triplet.
Definition: GUIslice.h:534
int16_t nMin
Minimum control value.
Definition: XRadial.h:64
int16_t nValLast
Last value.
Definition: XRadial.h:70