|
@@ -88,23 +88,29 @@ namespace BsWidget
|
|
_yurClient = new BsYurHttpStatusClient();
|
|
_yurClient = new BsYurHttpStatusClient();
|
|
_yurClient.Event += Yur_Event;
|
|
_yurClient.Event += Yur_Event;
|
|
|
|
|
|
- _computer = new Computer();
|
|
|
|
- _computer.CPUEnabled = true;
|
|
|
|
- _computer.GPUEnabled = true;
|
|
|
|
- _computer.FanControllerEnabled = false;
|
|
|
|
- _computer.HDDEnabled = false;
|
|
|
|
- _computer.MainboardEnabled = false;
|
|
|
|
- _computer.RAMEnabled = false;
|
|
|
|
- _computer.Open();
|
|
|
|
|
|
+ if (Program.NoPerf)
|
|
|
|
+ {
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ _computer = new Computer();
|
|
|
|
+ _computer.CPUEnabled = true;
|
|
|
|
+ _computer.GPUEnabled = true;
|
|
|
|
+ _computer.FanControllerEnabled = false;
|
|
|
|
+ _computer.HDDEnabled = false;
|
|
|
|
+ _computer.MainboardEnabled = false;
|
|
|
|
+ _computer.RAMEnabled = false;
|
|
|
|
+ _computer.Open();
|
|
|
|
+
|
|
|
|
+ _pcTimer = new Timer { Interval = 750 };
|
|
|
|
+ _pcTimer.Tick += PcTimer_Tick;
|
|
|
|
+ }
|
|
|
|
|
|
_queue = new BlockingCollection<UpdateFlags>();
|
|
_queue = new BlockingCollection<UpdateFlags>();
|
|
CutHistory = new List<HistoryModel>();
|
|
CutHistory = new List<HistoryModel>();
|
|
|
|
|
|
_updateTimer = new Timer { Interval = 25 };
|
|
_updateTimer = new Timer { Interval = 25 };
|
|
_updateTimer.Tick += UpdateTimer_Tick;
|
|
_updateTimer.Tick += UpdateTimer_Tick;
|
|
-
|
|
|
|
- _pcTimer = new Timer { Interval = 750 };
|
|
|
|
- _pcTimer.Tick += PcTimer_Tick;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
protected override void OnLoad(EventArgs e)
|
|
protected override void OnLoad(EventArgs e)
|
|
@@ -115,9 +121,9 @@ namespace BsWidget
|
|
TopMost = false;
|
|
TopMost = false;
|
|
WindowState = FormWindowState.Normal;
|
|
WindowState = FormWindowState.Normal;
|
|
_updateTimer.Start();
|
|
_updateTimer.Start();
|
|
- _pcTimer.Start();
|
|
|
|
_client.Start();
|
|
_client.Start();
|
|
_yurClient.Start();
|
|
_yurClient.Start();
|
|
|
|
+ _pcTimer?.Start();
|
|
}
|
|
}
|
|
|
|
|
|
protected override void OnMouseDoubleClick(MouseEventArgs e)
|
|
protected override void OnMouseDoubleClick(MouseEventArgs e)
|
|
@@ -151,7 +157,7 @@ namespace BsWidget
|
|
{
|
|
{
|
|
_client.Stop();
|
|
_client.Stop();
|
|
_yurClient.Stop();
|
|
_yurClient.Stop();
|
|
- _computer.Close();
|
|
|
|
|
|
+ _computer?.Close();
|
|
base.OnFormClosed(e);
|
|
base.OnFormClosed(e);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -253,7 +259,7 @@ namespace BsWidget
|
|
{
|
|
{
|
|
try
|
|
try
|
|
{
|
|
{
|
|
- foreach (var hardware in _computer.Hardware.Where(p => p.HardwareType == HardwareType.CPU || p.HardwareType == HardwareType.GpuNvidia))
|
|
|
|
|
|
+ foreach (var hardware in _computer.Hardware.Where(p => p.HardwareType == HardwareType.CPU || p.HardwareType == HardwareType.GpuNvidia || p.HardwareType == HardwareType.GpuAti))
|
|
{
|
|
{
|
|
hardware.Update();
|
|
hardware.Update();
|
|
}
|
|
}
|
|
@@ -294,7 +300,7 @@ namespace BsWidget
|
|
|
|
|
|
try
|
|
try
|
|
{
|
|
{
|
|
- GpuUsage = _computer.Hardware.Where(p => p.HardwareType == HardwareType.GpuNvidia).SelectMany(p => p.Sensors)
|
|
|
|
|
|
+ GpuUsage = _computer.Hardware.Where(p => p.HardwareType == HardwareType.GpuNvidia || p.HardwareType == HardwareType.GpuAti).SelectMany(p => p.Sensors)
|
|
.Where(p => p.SensorType == SensorType.Load && p.Name == "GPU Core").Select(p => p.Value).Max();
|
|
.Where(p => p.SensorType == SensorType.Load && p.Name == "GPU Core").Select(p => p.Value).Max();
|
|
}
|
|
}
|
|
catch
|
|
catch
|
|
@@ -535,7 +541,7 @@ namespace BsWidget
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if (flags.HasFlag(UpdateFlags.CpuAndGpu) || flags.HasFlag(UpdateFlags.RefreshAll))
|
|
|
|
|
|
+ if (Program.NoPerf == false && (flags.HasFlag(UpdateFlags.CpuAndGpu) || flags.HasFlag(UpdateFlags.RefreshAll)))
|
|
{
|
|
{
|
|
var width = 800;
|
|
var width = 800;
|
|
var height = 50;
|
|
var height = 50;
|