NiceHashMiner.Miners.MiningSession.MinerStatsCheck C# (CSharp) Method

MinerStatsCheck() public method

public MinerStatsCheck ( NiceHashSMA>.Dictionary NiceHashData ) : void
NiceHashData NiceHashSMA>.Dictionary
return void
        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);
            //    }
            //}
        }

Usage Example

Ejemplo n.º 1
0
 public static async Task MinerStatsCheck(Dictionary <AlgorithmType, NiceHashSma> niceHashData)
 {
     if (_curMiningSession != null)
     {
         await _curMiningSession.MinerStatsCheck(niceHashData);
     }
 }
All Usage Examples Of NiceHashMiner.Miners.MiningSession::MinerStatsCheck