When sorting the issues I found a graphic from Martin in #1945 which was

not implemented. What do you think of it?
This commit is contained in:
bsongis
2015-07-17 11:14:56 +02:00
parent a480c6ce87
commit 4ad6ea8190
4 changed files with 41 additions and 21 deletions
+11
View File
@@ -124,6 +124,17 @@ void updateProgressBar(int num, int den)
}
}
void drawGauge(coord_t x, coord_t y, coord_t w, coord_t h, int32_t val, int32_t max)
{
lcd_rect(x, y, w+1, h);
drawFilledRect(x+1, y+1, w-1, 4, SOLID, ERASE);
coord_t len = limit((uint8_t)1, uint8_t((abs(val) * w/2 + max/2) / max), uint8_t(w/2));
coord_t x0 = (val>0) ? x+w/2 : x+1+w/2-len;
for (coord_t i=h-2; i>0; i--) {
lcd_hline(x0, y+i, len);
}
}
void title(const pm_char * s)
{
lcd_putsAtt(0, 0, s, INVERS);