1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-15 15:03:07 +01:00

Triangle trend indicator for voltage page

This commit is contained in:
norbert-walter
2022-03-27 17:14:46 +02:00
parent 526806cfcb
commit dd76586ebe
3 changed files with 20 additions and 10 deletions

View File

@@ -223,23 +223,20 @@ public:
}
// Trend indicator
display.setTextColor(textcolor);
display.setFont(&Ubuntu_Bold32pt7b);
// Show trend indicator
if(trend == true){
display.setCursor(310, 240);
display.print(" ");
display.fillRect(310, 240, 40, 120, bgcolor); // Clear area
display.fillRect(315, 183, 35, 4, textcolor); // Draw separator
if(int(raw * 10) > int(valueTrend * 10)){
display.setCursor(310, 240);
display.print("+ ");
displayTrendHigh(320, 174, 11, textcolor); // Show high indicator
}
if(int(raw * 10) < int(valueTrend * 10)){
display.setCursor(310, 240);
display.print("- ");
displayTrendLow(320, 195, 11, textcolor); // Show low indicator
}
}
// No trend indicator
else{
display.setCursor(310, 240);
display.print(" ");
display.fillRect(310, 240, 40, 120, bgcolor); // Clear area
}