1 #ifndef _GUISLICE_EX_XRAMP_H_ 2 #define _GUISLICE_EX_XRAMP_H_ 57 #define GSLC_TYPEX_RAMP GSLC_TYPE_BASE_EXTEND + 62 176 #if (GSLC_USE_PROGMEM) 179 #define gslc_ElemXRampCreate_P(pGui,nElemId,nPage,nX,nY,nW,nH,\ 180 nMin_,nMax_,nVal_,colFrame_,colFill_) \ 181 static const uint8_t nFeatures##nElemId = GSLC_ELEM_FEA_VALID | \ 182 GSLC_ELEM_FEA_GLOW_EN | GSLC_ELEM_FEA_FILL_EN; \ 183 static gslc_tsXRamp sGauge##nElemId; \ 184 sGauge##nElemId.nMin = nMin_; \ 185 sGauge##nElemId.nMax = nMax_; \ 186 sGauge##nElemId.nVal = nVal_; \ 187 sGauge##nElemId.nValLast = nVal_; \ 188 sGauge##nElemId.bValLastValid = false; \ 189 static const gslc_tsElem sElem##nElemId PROGMEM = { \ 191 nFeatures##nElemId, \ 193 (gslc_tsRect){nX,nY,nW,nH}, \ 194 GSLC_GROUP_ID_NONE, \ 195 colFrame_,colFill_,colFrame_,colFill_, \ 196 (gslc_tsImgRef){NULL,NULL,GSLC_IMGREF_NONE,NULL}, \ 197 (gslc_tsImgRef){NULL,NULL,GSLC_IMGREF_NONE,NULL}, \ 201 (gslc_teTxtFlags)(GSLC_TXT_DEFAULT), \ 204 GSLC_ALIGN_MID_MID, \ 208 (void*)(&sGauge##nElemId), \ 210 &gslc_ElemXRampDraw, \ 214 gslc_ElemAdd(pGui,nPage,(gslc_tsElem*)&sElem##nElemId, \ 215 (gslc_teElemRefFlags)(GSLC_ELEMREF_SRC_PROG | GSLC_ELEMREF_VISIBLE | GSLC_ELEMREF_REDRAW_FULL)); 220 #define gslc_ElemXRampCreate_P(pGui,nElemId,nPage,nX,nY,nW,nH,\ 221 nMin_,nMax_,nVal_,colFrame_,colFill_) \ 222 static const uint8_t nFeatures##nElemId = GSLC_ELEM_FEA_VALID | \ 223 GSLC_ELEM_FEA_GLOW_EN | GSLC_ELEM_FEA_FILL_EN; \ 224 static gslc_tsXRamp sGauge##nElemId; \ 225 sGauge##nElemId.nMin = nMin_; \ 226 sGauge##nElemId.nMax = nMax_; \ 227 sGauge##nElemId.nVal = nVal_; \ 228 sGauge##nElemId.nValLast = nVal_; \ 229 sGauge##nElemId.bValLastValid = false; \ 230 static const gslc_tsElem sElem##nElemId = { \ 232 nFeatures##nElemId, \ 234 (gslc_tsRect){nX,nY,nW,nH}, \ 235 GSLC_GROUP_ID_NONE, \ 236 colFrame_,colFill_,colFrame_,colFill_, \ 237 (gslc_tsImgRef){NULL,NULL,GSLC_IMGREF_NONE,NULL}, \ 238 (gslc_tsImgRef){NULL,NULL,GSLC_IMGREF_NONE,NULL}, \ 242 (gslc_teTxtFlags)(GSLC_TXT_DEFAULT), \ 245 GSLC_ALIGN_MID_MID, \ 249 (void*)(&sGauge##nElemId), \ 251 &gslc_ElemXRampDraw, \ 255 gslc_ElemAdd(pGui,nPage,(gslc_tsElem*)&sElem##nElemId, \ 256 (gslc_teElemRefFlags)(GSLC_ELEMREF_SRC_CONST | GSLC_ELEMREF_VISIBLE | GSLC_ELEMREF_REDRAW_FULL)); 262 #endif // __cplusplus 263 #endif // _GUISLICE_EX_XRAMP_H_ int16_t nMax
Maximum control value.
Definition: XRamp.h:68
bool gslc_ElemXRampDrawHelp(gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, gslc_teRedrawType eRedraw)
Helper function to draw a gauge with style: ramp.
Definition: XRamp.c:186
int16_t nValLast
Last value.
Definition: XRamp.h:73
gslc_teRedrawType
Redraw types.
Definition: GUIslice.h:370
int16_t nVal
Current control value.
Definition: XRamp.h:71
Extended data for Gauge element.
Definition: XRamp.h:65
gslc_tsElemRef * gslc_ElemXRampCreate(gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsXRamp *pXData, gslc_tsRect rElem, int16_t nMin, int16_t nMax, int16_t nVal, gslc_tsColor colGauge, bool bVert)
Create a Ramp Gauge Element.
Definition: XRamp.c:83
Rectangular region. Defines X,Y corner coordinates plus dimensions.
Definition: GUIslice.h:519
bool gslc_ElemXRampDraw(void *pvGui, void *pvElemRef, gslc_teRedrawType eRedraw)
Draw a gauge element on the screen.
Definition: XRamp.c:158
int16_t nMin
Minimum control value.
Definition: XRamp.h:67
void gslc_ElemXRampSetVal(gslc_tsGui *pGui, gslc_tsElemRef *pElemRef, int16_t nVal)
Update a Gauge element's current value.
Definition: XRamp.c:129
Element reference structure.
Definition: GUIslice.h:578
GUI structure.
Definition: GUIslice.h:716
bool bValLastValid
Last value valid?
Definition: XRamp.h:74
Color structure. Defines RGB triplet.
Definition: GUIslice.h:534