Exemple #1
0
        public void createTemp(ref List <BaseSensor> sensorList)
        {
            bool isNvAPIWrapper = OptionManager.getInstance().IsNvAPIWrapper;

            this.lockBus();
            var pHwMonitoredDataList = new HardwareMonitoredDataCollection();

            mGigabyteHardwareMonitorControlModule.GetCurrentMonitoredData(SensorTypes.Temperature, ref pHwMonitoredDataList);
            this.unlockBus();

            int num = 2;

            for (int i = 0; i < pHwMonitoredDataList.Count; i++)
            {
                string name = pHwMonitoredDataList[i].Title;
                mGigabyteTemperatureList.Add(pHwMonitoredDataList[i].Value);

                while (this.isExistTemp(ref sensorList, name) == true)
                {
                    name = pHwMonitoredDataList[i].Title + " #" + num++;
                }

                var sensor = new GigabyteTemp(name, i);
                sensor.onGetGigabyteTemperatureHandler += onGetGigabyteTemperature;
                sensorList.Add(sensor);
            }

            num = 2;
            for (int i = 0; i < mGigabyteAmdRadeonGraphicsModuleList.Count; i++)
            {
                string name = mGigabyteAmdRadeonGraphicsModuleList[i].ProductName;
                while (this.isExistTemp(ref sensorList, name) == true)
                {
                    name = mGigabyteAmdRadeonGraphicsModuleList[i].ProductName + " #" + num++;
                }

                var sensor = new GigabyteAmdGpuTemp(name, i);
                sensor.onGetGigabyteAmdTemperatureHandler += onGetGigabyteAmdTemperature;
                sensorList.Add(sensor);
            }

            if (isNvAPIWrapper == false)
            {
                num = 2;
                for (int i = 0; i < mGigabyteNvidiaGeforceGraphicsModuleList.Count; i++)
                {
                    string name = mGigabyteNvidiaGeforceGraphicsModuleList[i].ProductName;
                    while (this.isExistTemp(ref sensorList, name) == true)
                    {
                        name = mGigabyteNvidiaGeforceGraphicsModuleList[i].ProductName + " #" + num++;
                    }

                    var sensor = new GigabyteNvidiaGpuTemp(name, i);
                    sensor.onGetGigabyteNvidiaTemperatureHandler += onGetGigabyteNvidiaTemperature;
                    sensorList.Add(sensor);
                }
            }
        }
Exemple #2
0
        public void createTemp(ref List <HardwareDevice> deviceList)
        {
            var device = new HardwareDevice("Gigabyte");

            if (OptionManager.getInstance().IsGigabyteMotherboard == true)
            {
                this.lockBus();
                try
                {
                    var pHwMonitoredDataList = new HardwareMonitoredDataCollection();
                    mGigabyteHardwareMonitorControlModule.GetCurrentMonitoredData(SensorTypes.Temperature, ref pHwMonitoredDataList);
                    for (int i = 0; i < pHwMonitoredDataList.Count; i++)
                    {
                        string name = pHwMonitoredDataList[i].Title;
                        string id   = string.Format("{0}/{1}/{2}", mIDPrefixTemperature, name, pHwMonitoredDataList[i].DeviceUUID);

                        mGigabyteTemperatureList.Add(pHwMonitoredDataList[i].Value);

                        var sensor = new GigabyteTemp(id, name, i);
                        sensor.onGetGigabyteTemperatureHandler += onGetGigabyteTemperature;
                        device.addDevice(sensor);
                    }
                }
                catch { }
                this.unlockBus();
            }

            if (OptionManager.getInstance().IsGigabyteGpu == true)
            {
                for (int i = 0; i < mGigabyteAmdRadeonGraphicsModuleList.Count; i++)
                {
                    string name   = mGigabyteAmdRadeonGraphicsModuleList[i].ProductName;
                    string id     = string.Format("{0}/{1}/{2}", mIDPrefixTemperature, name, i);
                    var    sensor = new GigabyteAmdGpuTemp(id, name, i);
                    sensor.onGetGigabyteAmdTemperatureHandler += onGetGigabyteAmdTemperature;
                    device.addDevice(sensor);
                }

                for (int i = 0; i < mGigabyteNvidiaGeforceGraphicsModuleList.Count; i++)
                {
                    string name   = mGigabyteNvidiaGeforceGraphicsModuleList[i].ProductName;
                    string id     = string.Format("{0}/{1}/{2}", mIDPrefixTemperature, name, i);
                    var    sensor = new GigabyteNvidiaGpuTemp(id, name, i);
                    sensor.onGetGigabyteNvidiaTemperatureHandler += onGetGigabyteNvidiaTemperature;
                    device.addDevice(sensor);
                }
            }

            if (device.DeviceList.Count > 0)
            {
                deviceList.Add(device);
            }
        }