diff --git a/core/Classes/HardwareInfo.cs b/core/Classes/HardwareInfo.cs index 1d1758d..2ed5599 100644 --- a/core/Classes/HardwareInfo.cs +++ b/core/Classes/HardwareInfo.cs @@ -55,6 +55,11 @@ public void GetInfo() { API.RAM.Load.Clear(); + API.System.SuperIO.Voltage.Clear(); + API.System.SuperIO.Temperature.Clear(); + API.System.SuperIO.Fan.Clear(); + API.System.SuperIO.FanControl.Clear(); + var diskID = -1; for (int i = 0; i < computerHardware.Count; i++) { @@ -72,6 +77,7 @@ public void GetInfo() { if (computerHardware[i].HardwareType == HardwareType.Motherboard) { API.System.Motherboard.Name = computerHardware[i].Name; + API.System.SuperIO.Name = computerHardware[i].SubHardware[0].Name; } } @@ -133,6 +139,51 @@ public void GetInfo() { } } + // Get superIO info + if (computerHardware[i].HardwareType == HardwareType.Motherboard) { + var sh = computerHardware[i].SubHardware[0]; + + for (int j = 0; j < sh.Sensors.Length; j++) { + if (sh.Sensors[j].SensorType == SensorType.Voltage) { + API.System.SuperIO.Voltage.Add(new Sensor { + Name = sh.Sensors[j].Name, + Value = (float)Math.Round((float)sh.Sensors[j].Value, 2), + Min = (float)Math.Round((float)sh.Sensors[j].Min, 2), + Max = (float)Math.Round((float)sh.Sensors[j].Max, 2), + }); + } + + if (sh.Sensors[j].SensorType == SensorType.Temperature) { + API.System.SuperIO.Temperature.Add(new Sensor { + Name = sh.Sensors[j].Name, + Value = (float)Math.Round((float)sh.Sensors[j].Value), + Min = (float)Math.Round((float)sh.Sensors[j].Min), + Max = (float)Math.Round((float)sh.Sensors[j].Max), + }); + } + + if (sh.Sensors[j].SensorType == SensorType.Fan) { + API.System.SuperIO.Fan.Add(new Sensor { + Name = sh.Sensors[j].Name, + Value = (float)Math.Round((float)sh.Sensors[j].Value), + Min = (float)Math.Round((float)sh.Sensors[j].Min), + Max = (float)Math.Round((float)sh.Sensors[j].Max), + }); + } + + if (sh.Sensors[j].SensorType == SensorType.Control) { + API.System.SuperIO.FanControl.Add(new Sensor { + Name = sh.Sensors[j].Name, + Value = (float)Math.Round((float)sh.Sensors[j].Value), + Min = (float)Math.Round((float)sh.Sensors[j].Min), + Max = (float)Math.Round((float)sh.Sensors[j].Max), + }); + } + } + + + } + for (int j = 0; j < sensor.Length; j++) { // CPU temperature if (sensor[j].SensorType == SensorType.Temperature && computerHardware[i].HardwareType == HardwareType.Cpu && sensor[j].Name.StartsWith("CPU Core") && !sensor[j].Name.Contains("Tj")) { @@ -204,9 +255,9 @@ public void GetInfo() { if (sensor[j].SensorType == SensorType.Fan && computerHardware[i].HardwareType.ToString().Contains("Gpu")) { API.GPU.Fan.Add(new Sensor { Name = sensor[j].Name, - Value = (float)Math.Round((float)sensor[j].Value, 1), - Min = (float)Math.Round((float)sensor[j].Min, 1), - Max = (float)Math.Round((float)sensor[j].Max, 1), + Value = (float)Math.Round((float)sensor[j].Value), + Min = (float)Math.Round((float)sensor[j].Min), + Max = (float)Math.Round((float)sensor[j].Max), }); } diff --git a/core/Classes/Interfaces.cs b/core/Classes/Interfaces.cs index e88122d..1022271 100644 --- a/core/Classes/Interfaces.cs +++ b/core/Classes/Interfaces.cs @@ -217,6 +217,28 @@ public List Disks { } = new(); } +public class SuperIOInfo { + public string Name { + get; set; + } + + public List Voltage { + get; set; + } = new(); + + public List Temperature { + get; set; + } = new(); + + public List Fan { + get; set; + } = new(); + + public List FanControl { + get; set; + } = new(); +} + public class MotherboardInfo { public string Name { get; set; @@ -258,7 +280,11 @@ public NetworkInfo Network { public BIOSInfo BIOS { get; set; - } + } = new(); + + public SuperIOInfo SuperIO { + get; set; + } = new(); } public class API {