-
Notifications
You must be signed in to change notification settings - Fork 2
/
GPUZPlugin.cs
50 lines (39 loc) · 1.05 KB
/
GPUZPlugin.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using FanControl.Plugins;
using GpuzDemo;
using System;
using System.Linq;
namespace FanControl.GPUZ
{
public class GPUZPlugin : IPlugin
{
private GpuzWrapper _gpuz;
public string Name => "GPU-Z";
public void Close()
{
_gpuz?.Close();
_gpuz = null;
}
public void Initialize()
{
_gpuz = new GpuzWrapper();
_gpuz.Open();
}
public void Load(IPluginSensorsContainer _container)
{
String sensorName;
for (int i = 0; (sensorName = this._gpuz?.SensorName(i)) != String.Empty; i++)
{
var unit = this._gpuz.SensorUnit(i);
var psensor = new GPUZPluginSensor(this._gpuz, i);
if (unit == "RPM")
{
// _container.FanSensors.Add(psensor);
}
else if (unit == "°C")
{
_container.TempSensors.Add(psensor);
}
}
}
}
}