private void hashrateTimer_Tick(object sender, EventArgs e)
{
Random rnd = new Random();
fullHashrate = "0 h/s";
foreach (Miner miner in miners) {
string hashrate = parseLogTail(miner.logFile);
miner.hashrate = (hashrate != String.Empty ? hashrate : miner.hashrate);
summHashrate(miner.hashrate);
int idx = instancesList.FindString("[" + miner.pid + "]");
instancesList.Items[idx] = "[" + miner.pid + "]" +
" {" + miner.hashrate + "} " +
"[" + (miner.lowCpu ? "low" : miner.threads) + "] " +
(miner.pool.description != String.Empty ? miner.pool.description : miner.pool.address);
}
if (fullHashrate == fullHashrateLabel.Text) return;
fullHashrateLabel.Text = fullHashrate;
float hr = float.Parse(fullHashrate.Split(' ')[0]);
if (hr > hashChart.ChartAreas[0].AxisY.Maximum) hashChart.ChartAreas[0].AxisY.Maximum = hr;
hashChart.Series[0].Points.AddY(hr);
if (hashChart.Series[0].Points.Count > 100) hashChart.Series[0].Points.RemoveAt(0);
}