Esempio n. 1
0
        private void UncheckMiner(string id)
        {
            Progress <bool> progress = new Progress <bool>((data) =>
            {
                ReadyToStart = data;
            });

            linker.minerManager.DisableMiner(id, progress);

            // Remove from tab list
            MiningTab tab = MiningTabs.FirstOrDefault(x => x.id.Contains(id));

            MiningTabs.Remove(tab);
        }
Esempio n. 2
0
        private async void Start_Click(object sender, RoutedEventArgs e)
        {
            Progress <MiningStatus> startingProgress = new Progress <MiningStatus>((data) =>
            {
                // TODO: Add an Amount Earned feature
                InfoText = data.info;

                // If this is just an overall status rather than a miner status
                if (data.id == "NONE")
                {
                    return;
                }

                MiningTab tab = MiningTabs.FirstOrDefault(x => (x.id.Contains(data.id) || data.id.Contains(x.id)));

                tab.Data.HashrateText       = "Hashrate: " + data.hashRate;
                tab.Data.LastBlockText      = "Block: " + data.lastBlock;
                tab.Data.AcceptedSharesText = "Accepted Shares: " + data.acceptedShares;
                tab.Data.RejectedSharesText = "Rejected Shares: " + data.rejectedShares;
                tab.Data.TemperatureText    = "Temperature: " + data.temperature;
            });

            // Select first tab
            tabDynamic.SelectedIndex = 0;

            // Show & Hide screens
            ReadyToStart   = false;
            ShowStop       = true;
            ShowStats      = true;
            EnableAdvanced = false;

            // Log Pool Info
            string poolInfo = (lastPoolDataValue.id == -1 ? "Custom Pool (" + lastPoolDataValue.stratum + ")" : lastPoolDataValue.name + " (" + PoolInput.Trim() + ")");

            MiningInfoText = "Mining on " + poolInfo;
            logger.Info("Starting miners on " + poolInfo);

            await linker.minerManager.StartMining(AddressInput.Trim(), PoolInput.Trim(), startingProgress);

            EnableAdvanced = true;
            ShowStats      = false;
            ShowStop       = false;
            ReadyToStart   = true;
        }
Esempio n. 3
0
        private async Task CheckMiner(string id)
        {
            Progress <bool> progress = new Progress <bool>((data) =>
            {
                ReadyToStart = data;
            });
            Progress <string> installingProgress = new Progress <string>((data) =>
            {
                // Set its data
                progressSteps[id] = data;

                // Change info text to update with every steps' info
                InfoText = String.Join(", ", progressSteps.Values);
            });

            ReadyToStart   = false;
            EnableAdvanced = false;

            // Add the current step
            progressSteps.Add(id, "");

            // Add to tab list
            MiningTab tab = new MiningTab()
            {
                Header = Utilities.IDToTitle(id), id = id, Data = new MiningTabData()
            };

            MiningTabs.Add(tab);

            // Enable And/Or Download the miner
            await linker.minerManager.EnableMiner(id, progress, installingProgress);

            // Remove from the steps
            progressSteps.Remove(id);


            ReadyToStart   = true;
            EnableAdvanced = true;
        }