Ejemplo n.º 1
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);
                    pnlGpus.Controls.Add(gpu);
                    gpu.UpdateState(false);
                    // gpu.Show();
                }

                /*
                 * for (int i = 0; i < 5; i++)
                 * {
                 *  GpuData d = new GpuData("DD");
                 *  d.FanSpeed = "45";
                 *  d.Hashrate = "35";
                 *  d.Temperature = "3";
                 *  GpuView gpu = new GpuView(d, this);
                 *  pnlGpus.Controls.Add(gpu);
                 *  gpu.UpdateState(true);
                 * }
                 */
            }
            catch (Exception e)
            {
            }
        }
Ejemplo n.º 2
0
        public void UpdateUI()
        {
            try
            {
                if (Miner.MinerState == MinerProgramState.Running)
                {
                    List <IMinerProgram> miners = Miner.ActualMinerPrograms;
                    pnlGpus.Controls.Clear();
                    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);
                            pnlGpus.Controls.Add(gpu);
                            gpu.UpdateState(true);
                            //gpu.Show();
                        }
                    }
                }
                else
                {
                    UpdateUIStatic();
                }
            }
            catch (Exception e)
            {
                Logger.Instance.LogError(e.Message);
            }
        }