From ebcc7097534ffa1e7b0fbcf4b1d3cf73f946ff13 Mon Sep 17 00:00:00 2001 From: "Alfonso C. Alvarez" Date: Mon, 19 Jun 2023 23:17:40 +0200 Subject: [PATCH] added pool url and days, hours:minutes:seconds to main screen. --- src/monitor.cpp | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/monitor.cpp b/src/monitor.cpp index a02d798..3ee2623 100644 --- a/src/monitor.cpp +++ b/src/monitor.cpp @@ -12,6 +12,7 @@ #include "utils.h" #include "monitor.h" +extern char poolString[80]; extern unsigned long templates; extern unsigned long hashes; extern unsigned long Mhashes; @@ -247,18 +248,21 @@ void show_MinerScreen(unsigned long mElapsed){ render.setFontSize(36); render.drawString(String(shares).c_str(), 186, 76, 0xDEDB); //Hores - unsigned long secElapsed=millis()/1000; - int hr = secElapsed/3600; //Number of seconds in an hour - int mins = (secElapsed-(hr*3600))/60; //Remove the number of hours and calculate the minutes. - int sec = secElapsed-(hr*3600)-(mins*60); - render.setFontSize(36); - render.rdrawString(String(hr).c_str(), 208, 99, 0xDEDB); + char timeMining[15]; + unsigned long secElapsed = millis() / 1000; + int days = secElapsed / 86400; + int hours = (secElapsed - (days * 86400)) / 3600; //Number of seconds in an hour + int mins = (secElapsed - (days * 86400) - (hours * 3600)) / 60; //Remove the number of hours and calculate the minutes. + int secs = secElapsed - (days * 86400) - (hours * 3600) - (mins * 60); + sprintf(timeMining, "%01d,%02d:%02d:%02d", days, hours, mins, secs); + render.setFontSize(33); + render.rdrawString(String(timeMining).c_str(), 315, 102, 0xDEDB); //Minutss - render.setFontSize(36); - render.rdrawString(String(mins).c_str(), 253, 99, 0xDEDB); + //render.setFontSize(36); + //render.rdrawString(String(mins).c_str(), 253, 99, 0xDEDB); //Segons - render.setFontSize(36); - render.rdrawString(String(sec).c_str(), 298, 99, 0xDEDB); + //render.setFontSize(36); + //render.rdrawString(String(sec).c_str(), 298, 99, 0xDEDB); //Valid Blocks render.setFontSize(48); render.drawString(String(valids).c_str(), 285, 56, 0xDEDB); @@ -275,6 +279,12 @@ void show_MinerScreen(unsigned long mElapsed){ render.setFontSize(20); render.rdrawString(getTime().c_str(), 286, 1, TFT_BLACK); + // pool url + background.setTextSize(1); + background.setTextDatum(MC_DATUM); + background.setTextColor(0xDEDB); + background.drawString(String(poolString), 59, 85, FONT2); + //Push prepared background to screen background.pushSprite(0,0); }