public void MinerStatsCheck(Dictionary<AlgorithmType, NiceHashSMA> NiceHashData)
{
double CurrentProfit = 0.0d;
_mainFormRatesComunication.ClearRates(_runningGroupMiners.Count);
foreach (var groupMiners in _runningGroupMiners.Values) {
Miner m = groupMiners.Miner;
// skip if not running
if (!m.IsRunning) continue;
APIData AD = m.GetSummary();
if (AD == null) {
Helpers.ConsolePrint(m.MinerTAG(), "GetSummary returned null..");
}
// set rates
if (NiceHashData != null && AD != null) {
groupMiners.CurrentRate = NiceHashData[AD.AlgorithmID].paying * AD.Speed * 0.000000001;
} else {
groupMiners.CurrentRate = 0;
// set empty
AD = new APIData(groupMiners.AlgorithmType);
}
CurrentProfit += groupMiners.CurrentRate;
// Update GUI
_mainFormRatesComunication.AddRateInfo(m.MinerTAG(), groupMiners.DevicesInfoString, AD, groupMiners.CurrentRate, m.IsAPIReadException);
}
//// check if profitabile
//if (CheckStatus && !IsMiningRegardlesOfProfit) {
// CheckStatus = false;
// if (IsProfitable) {
// // check current profit
// CheckIfShouldMine(CurrentProfit, true);
// } else if (!IsProfitable) {
// // recalculate and switch
// SwichMostProfitableGroupUpMethod(NiceHashData, true);
// }
//}
}