示例#1
0
 public HardwareGpuControl(OpenHardwareMonitor.Hardware.ISensor sensor, string name) : base()
 {
     mOHMSensor = sensor;
     Name       = name;
     Value      = 0;
     LastValue  = 0;
 }
示例#2
0
 public OSDSensor(OpenHardwareMonitor.Hardware.ISensor sensor, OSDUnitType unitType, string name, int index) : base(SENSOR_TYPE.OSD)
 {
     mOHMSensor  = sensor;
     LibraryType = OSDLibraryType.OpenHardwareMonitor;
     UnitType    = unitType;
     Name        = name;
     mIndex      = index;
 }
示例#3
0
        public void setTemperatureSensor()
        {
            if (mLHMList.Count > 0 || mOHMList.Count > 0)
            {
                return;
            }

            if (mLHMHardware != null)
            {
                LibreHardwareMonitor.Hardware.ISensor packageSensor = null;
                var sensor = mLHMHardware.Sensors;
                for (int i = 0; i < sensor.Length; i++)
                {
                    if (sensor[i].SensorType == LibreHardwareMonitor.Hardware.SensorType.Temperature)
                    {
                        if (mLHMHardware.HardwareType == LibreHardwareMonitor.Hardware.HardwareType.Cpu ||
                            mLHMHardware.HardwareType == LibreHardwareMonitor.Hardware.HardwareType.GpuAmd ||
                            mLHMHardware.HardwareType == LibreHardwareMonitor.Hardware.HardwareType.GpuNvidia)
                        {
                            if (sensor[i].Name.IndexOf("Core") >= 0)
                            {
                                mLHMList.Add(sensor[i]);
                            }

                            if (sensor[i].Name.IndexOf("Package") >= 0)
                            {
                                packageSensor = sensor[i];
                                break;
                            }
                        }
                    }
                }

                if (packageSensor != null)
                {
                    mLHMList.Clear();
                    mLHMList.Add(packageSensor);
                }
            }

            else if (mOHMHardware != null)
            {
                OpenHardwareMonitor.Hardware.ISensor packageSensor = null;
                var sensor = mOHMHardware.Sensors;
                for (int i = 0; i < sensor.Length; i++)
                {
                    if (sensor[i].SensorType == OpenHardwareMonitor.Hardware.SensorType.Temperature)
                    {
                        if (mOHMHardware.HardwareType == OpenHardwareMonitor.Hardware.HardwareType.CPU ||
                            mOHMHardware.HardwareType == OpenHardwareMonitor.Hardware.HardwareType.GpuAti ||
                            mOHMHardware.HardwareType == OpenHardwareMonitor.Hardware.HardwareType.GpuNvidia)
                        {
                            if (sensor[i].Name.IndexOf("Core") >= 0)
                            {
                                mOHMList.Add(sensor[i]);
                            }

                            if (sensor[i].Name.IndexOf("Package") >= 0)
                            {
                                packageSensor = sensor[i];
                                break;
                            }
                        }
                    }
                }

                if (packageSensor != null)
                {
                    mOHMList.Clear();
                    mOHMList.Add(packageSensor);
                }
            }
        }
示例#4
0
 public HardwareFanSpeed(OpenHardwareMonitor.Hardware.ISensor sensor, string name) : base(SENSOR_TYPE.FAN)
 {
     mOHMSensor = sensor;
     Name       = name;
 }
 public HardwareMotherBoardTemp(OpenHardwareMonitor.Hardware.ISensor sensor, string name) : base(SENSOR_TYPE.TEMPERATURE)
 {
     mOHMSensor = sensor;
     Name       = name;
 }