private void bg_tray_DoWork(object sender, DoWorkEventArgs e)
{
bool HasShown = false;
bool unstable = false;
int shutdown = 30;
int showtimer = 30;
while (!bg_tray.CancellationPending)
{
if (unstable)
{
if (hightemp >= shutdowntmp)
{
if (shutdown == 0)
{
Logger("[Miner Halt] Reason: Unstable GPU Temperatures.");
inflateBalloon("[!] Miner has been stopped.", "Mining halted due to unstable GPU temperatures.(100°C)\r\nPlease consider checking GPU fans for dust build-up.", ToolTipIcon.Info);
stopReason = "Reason: Unstable GPU temperatures.";
bg_tray.ReportProgress(1);
shutdown = 30;
}
else
shutdown--;
}
else
{
shutdown = 30;
unstable = false;
}
}
else if (hightemp >= shutdowntmp)
{
Logger("[Unstable GPU Temperature] Miner will halt in 30 sec.");
inflateBalloon("[!] Unstable GPU Temperatures!", "Mining will cease automatically if temperatures\r\ndo not decrease within 30 seconds.", ToolTipIcon.Error);
unstable = true;
}
else if (!HasShown && ovheat)
{
if (OHprotect.Checked)
{
Logger("[Protective Cooling Activated] High GPU temperatures.");
inflateBalloon("Protective Cooling Activated", "GPU reached unsafe temperatures.\r\nIncreasing fan speed.", ToolTipIcon.Warning);
}
else
{
Logger("[GPU Running Hot] High GPU Temperatures. Protective Cooling is disabled.");
inflateBalloon("GPU Operating at High Temperatures", "Continuing may result in shortened GPU lifespan.\r\nProtective Cooling is recommended.", ToolTipIcon.Warning);
}
HasShown = true;
}
else if (!ovheat)
{
if (showtimer == 0)
HasShown = false;
else
showtimer--;
}
else
showtimer = 30;
Thread.Sleep(1000);
}
}