Big refactor of mining pool support, optimization of existing icons
This commit is contained in:
parent
f9aa593f0b
commit
814cd234a9
23 changed files with 772 additions and 1190 deletions
|
@ -1,7 +1,7 @@
|
|||
#include "mining_pool_stats_handler.hpp"
|
||||
#include <iostream>
|
||||
|
||||
std::array<std::string, NUM_SCREENS> parseMiningPoolStatsHashRate(std::string miningPoolName, std::string text)
|
||||
std::array<std::string, NUM_SCREENS> parseMiningPoolStatsHashRate(std::string text)
|
||||
{
|
||||
std::array<std::string, NUM_SCREENS> ret;
|
||||
ret.fill(""); // Initialize all elements to empty strings
|
||||
|
@ -55,31 +55,19 @@ std::array<std::string, NUM_SCREENS> parseMiningPoolStatsHashRate(std::string mi
|
|||
|
||||
ret[NUM_SCREENS - 1] = label;
|
||||
|
||||
// Set the mining pool logo
|
||||
if (miningPoolName == "ocean") {
|
||||
ret[0] = "mdi:ocean_logo";
|
||||
} else if (miningPoolName == "braiins") {
|
||||
ret[0] = "mdi:braiins_logo";
|
||||
}
|
||||
|
||||
ret[0] = "mdi:miningpool";
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
std::array<std::string, NUM_SCREENS> parseMiningPoolStatsDailyEarnings(std::string miningPoolName, int sats)
|
||||
std::array<std::string, NUM_SCREENS> parseMiningPoolStatsDailyEarnings(int sats, std::string label)
|
||||
{
|
||||
std::array<std::string, NUM_SCREENS> ret;
|
||||
ret.fill(""); // Initialize all elements to empty strings
|
||||
std::string satsDisplay = std::to_string(sats);
|
||||
std::string label;
|
||||
|
||||
if (miningPoolName == "braiins") {
|
||||
// fpps guarantees payout; report current daily earnings
|
||||
label = "sats/earned";
|
||||
} else {
|
||||
// TIDES can only estimate earnings on the next block Ocean finds
|
||||
label = "sats/block";
|
||||
}
|
||||
|
||||
if (sats >= 100000000) {
|
||||
// A whale mining 1+ BTC per day! No decimal points; whales scoff at such things.
|
||||
|
@ -121,12 +109,7 @@ std::array<std::string, NUM_SCREENS> parseMiningPoolStatsDailyEarnings(std::stri
|
|||
|
||||
ret[NUM_SCREENS - 1] = label;
|
||||
|
||||
// Set the mining pool logo
|
||||
if (miningPoolName == "ocean") {
|
||||
ret[0] = "mdi:ocean_logo";
|
||||
} else if (miningPoolName == "braiins") {
|
||||
ret[0] = "mdi:braiins_logo";
|
||||
}
|
||||
ret[0] = "mdi:miningpool";
|
||||
|
||||
return ret;
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
#include <array>
|
||||
#include <string>
|
||||
|
||||
std::array<std::string, NUM_SCREENS> parseMiningPoolStatsHashRate(std::string miningPoolName, std::string text);
|
||||
std::array<std::string, NUM_SCREENS> parseMiningPoolStatsDailyEarnings(std::string miningPoolName, int sats);
|
||||
std::array<std::string, NUM_SCREENS> parseMiningPoolStatsHashRate(std::string text);
|
||||
std::array<std::string, NUM_SCREENS> parseMiningPoolStatsDailyEarnings(int sats, std::string label);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue