- add self updating function. You can start an update from onscreen menu
This commit is contained in:
Stephan Mühl
2023-03-23 22:11:46 +01:00
parent e590e22923
commit 396e1f1cf9
13 changed files with 214 additions and 22 deletions

View File

@@ -390,6 +390,17 @@ void DisplayManager_::tick()
}
}
void DisplayManager_::clear()
{
matrix.clear();
}
void DisplayManager_::show()
{
matrix.show();
}
void DisplayManager_::leftButton()
{
if (!MenuManager.inMenu)
@@ -512,4 +523,17 @@ void DisplayManager_::setNewSettings(String Payload)
AUTO_TRANSITION = doc.containsKey("autotransition") ? doc["autotransition"] : AUTO_TRANSITION;
applyAllSettings();
saveSettings();
}
void DisplayManager_::drawProgressBar(int cur, int total)
{
matrix.clear();
int progress = (cur * 100) / total;
char progressStr[5];
snprintf(progressStr, 5, "%d%%", progress); // Formatieren des Prozentzeichens
printText(0, 6, progressStr, true, false);
int leds_for_progress = (progress * MATRIX_WIDTH * MATRIX_HEIGHT) / 100;
matrix.drawFastHLine(0, 7, MATRIX_WIDTH, matrix.Color(100, 100, 100));
matrix.drawFastHLine(0, 7, leds_for_progress / MATRIX_HEIGHT, matrix.Color(0, 255, 0));
matrix.show();
}