Esempio n. 1
0
        public void UpdateUI()
        {
            try
            {
                if (Miner.MinerState == MinerProgramState.Running)
                {
                    List <IMinerProgram> miners = Miner.ActualMinerPrograms;
                    while (pnlGpus.Controls.Count > 0)
                    {
                        Control oKill = pnlGpus.Controls[0];
                        pnlGpus.Controls.RemoveAt(0);
                        if (oKill != null)
                        {
                            oKill.Dispose();
                        }
                    }
                    lblGpuInfoStatic.Visible = false;

                    foreach (IMinerProgram item in miners)
                    {
                        MinerDataResult result = item.OutputReader.MinerResult;
                        if (result == null)
                        {
                            continue;
                        }
                        foreach (GpuData gpuData in result.GPUs)
                        {
                            GpuView gpu = new GpuView(gpuData, this);
                            gpu.TopLevel = false;
                            pnlGpus.Controls.Add(gpu);
                            gpu.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
                            gpu.UpdateState(true);
                            gpu.Show();
                        }
                    }
                }
                else
                {
                    UpdateUIStatic();
                }
            }
            catch (Exception e)
            {
                Logger.Instance.LogError(e.Message);
            }
        }
Esempio n. 2
0
        public void UpdateUIStatic()
        {
            try
            {
                List <GpuData> gpus = Miner.GetGpuList();
                pnlGpus.Controls.Clear();
                lblGpuInfoStatic.Visible = true;

                foreach (GpuData gpuData in gpus)
                {
                    GpuView gpu = new GpuView(gpuData, this);
                    gpu.TopLevel = false;
                    pnlGpus.Controls.Add(gpu);
                    gpu.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
                    gpu.UpdateState(false);
                    gpu.Show();
                }
            }
            catch (Exception e)
            {
            }
        }