Merge pull request #68 from alcar21/feature/add_pool_url_and_days_to_screen

added pool url and days, hours:minutes:seconds to main screen.
This commit is contained in:
BitMaker 2023-06-27 13:18:20 +02:00 committed by GitHub
commit 864b54cc18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}