public void PushLastSaveToFile() { if (m_minerObserved == null) { return; } if (m_minerObserved.m_minerInfo == null) { return; } if (m_minerObserved.m_minerInfo.HasError() || !m_minerObserved.m_minerInfo.HasText()) { return; } if (!m_minerObserved.m_minerInfo.isConverted) { return; } EtherMinerOrgMinerInfo miner = m_minerObserved.m_minerInfo.GetMinerInfo(); AbstractMinerInfo minerinfo = new AbstractMinerInfo(); minerinfo.m_address = miner.GetWallet().GetAddress(); minerinfo.m_timestampInSeconds = miner.GetFrameStatistic().GetTimestamp(); minerinfo.m_averageHashrate = miner.GetFrameStatistic().GetAverageHashRate(); minerinfo.m_hardwareHashrate = miner.GetFrameStatistic().GetReportedHashRate(); minerinfo.m_serverHashrate = miner.GetFrameStatistic().GetCurrentHashRate(); minerinfo.m_validShares = miner.GetFrameStatistic().GetValideShares(); minerinfo.m_invalidShares = miner.GetFrameStatistic().GetInvalideShares(); minerinfo.m_staleShares = miner.GetFrameStatistic().GetStaleShares(); minerinfo.m_unpaidWei = miner.GetUnpaidWai(); minerinfo.m_bitcoinPerMinute = miner.GetBitcoinPerMinute(); minerinfo.m_coinsPerMinute = miner.GetCoinsPerMinutes(); minerinfo.m_usdPerMinute = miner.GetUsdPerMinutes(); minerinfo.m_workerCount = miner.GetActiveWorkers(); m_poolSaveAndLoad.SaveMinerState(PoolManageByThisAPI.Ethermine, minerinfo); // AbstractMinerBasicInfo[] m_debugMinerKeys; //m_poolSaveAndLoad.ImportAllKeys(PoolManageByThisAPI.Ethermine.ToString(), miner.GetWallet().GetAddress(), new DateTime((int)year, (int)month, (int)day, (int)hour, (int)minute, 0, 0, DateTimeKind.Utc), DateTime.UtcNow, out m_debugMinerKeys); }
public void SetWith(EtherMinerOrgMinerInfo info) { if (info == null) { if (m_frameGeneral != null) { m_frameGeneral.SetWith(null); } if (m_hashRateEstimation != null) { m_hashRateEstimation.SetWith(0); } if (m_history != null) { m_history.SetWith(info.GetFameHistory()); } if (m_unconfirmed != null) { m_unconfirmed.text = ""; } if (m_unpaid != null) { m_unpaid.text = ""; } if (m_dollarPerMinute != null) { m_dollarPerMinute.text = ""; } if (m_bitcoinsPerMinute != null) { m_bitcoinsPerMinute.text = ""; } if (m_coinsPerMinute != null) { m_coinsPerMinute.text = ""; } if (m_activeWorker != null) { m_activeWorker.text = ""; } return; } if (m_hashRateEstimation != null) { m_hashRateEstimation.SetWith(info.GetFrameStatistic().GetCurrentHashRate()); } if (m_frameGeneral != null) { m_frameGeneral.SetWith(info.GetFrameStatistic()); } if (m_address != null) { m_address.text = info.GetWallet().GetAddress(); } if (m_dollarPerMinute != null) { m_dollarPerMinute.text = "" + info.GetUsdPerMinutes() * (60 * 24) + " $/day"; } if (m_coinsPerMinute != null) { m_coinsPerMinute.text = "" + info.GetCoinsPerMinutes() * (60 * 24) + " ETH/day"; } if (m_bitcoinsPerMinute != null) { m_bitcoinsPerMinute.text = "" + info.GetBitcoinPerMinute() * (60 * 24) + " BTC/day"; } if (m_activeWorker != null) { m_activeWorker.text = "" + info.GetActiveWorkers() + " workers"; } if (m_unconfirmed != null) { m_unconfirmed.text = "" + info.GetUnconfirmed() + " unconfirmed"; } if (m_unpaid != null) { EthereumConverttion.ApproximateConvert(info.GetUnpaidWai(), out decimal value, EtherType.Wei, EtherType.Ether); m_unpaid.text = "" + value + " ETH Unpaid"; } }