Release version 0.1.6. Fixed F71882 temperature reading. Added error handling for ATI GPUs (ADL). Fixed sensor events.
authormoel.mich
Sun, 31 Jan 2010 22:00:31 +0000
changeset 150e812fe67bac
parent 14 51c2f209da6d
child 16 e9abdc6e05af
Release version 0.1.6. Fixed F71882 temperature reading. Added error handling for ATI GPUs (ADL). Fixed sensor events.
Hardware/ATI/ADL.cs
Hardware/ATI/ATIGPU.cs
Hardware/LPC/F71882.cs
Hardware/LPC/IT87.cs
Hardware/LPC/W83627DHG.cs
Hardware/TBalancer/TBalancer.cs
Properties/AssemblyInfo.cs
     1.1 --- a/Hardware/ATI/ADL.cs	Sun Jan 31 20:57:18 2010 +0000
     1.2 +++ b/Hardware/ATI/ADL.cs	Sun Jan 31 22:00:31 2010 +0000
     1.3 @@ -110,7 +110,7 @@
     1.4      public const int ADL_MAX_DISPLAYS = 40;
     1.5      public const int ADL_MAX_DEVICENAME = 32;
     1.6      public const int ADL_OK = 0;
     1.7 -    public const int ADL_FAIL = -1;
     1.8 +    public const int ADL_ERR = -1;
     1.9      public const int ADL_DRIVER_OK = 0;
    1.10      public const int ADL_MAX_GLSYNC_PORTS = 8;
    1.11      public const int ADL_MAX_GLSYNC_PORT_LEDS = 8;
     2.1 --- a/Hardware/ATI/ATIGPU.cs	Sun Jan 31 20:57:18 2010 +0000
     2.2 +++ b/Hardware/ATI/ATIGPU.cs	Sun Jan 31 22:00:31 2010 +0000
     2.3 @@ -54,6 +54,8 @@
     2.4      private Sensor memoryClock;
     2.5      private Sensor coreVoltage;
     2.6  
     2.7 +    private List<ISensor> active = new List<ISensor>();
     2.8 +
     2.9      public ATIGPU(string name, int adapterIndex, int busNumber, 
    2.10        int deviceNumber) 
    2.11      {
    2.12 @@ -92,10 +94,7 @@
    2.13      }
    2.14  
    2.15      public ISensor[] Sensors {
    2.16 -      get {
    2.17 -        return new ISensor[] { coreVoltage, coreClock, memoryClock, temperature, 
    2.18 -          fan };
    2.19 -      }
    2.20 +      get { return active.ToArray(); }
    2.21      }
    2.22  
    2.23      public string GetReport() {
    2.24 @@ -104,24 +103,60 @@
    2.25  
    2.26      public void Update() {
    2.27        ADLTemperature adlt = new ADLTemperature();
    2.28 -      ADL.ADL_Overdrive5_Temperature_Get(adapterIndex, 0, ref adlt);
    2.29 -      temperature.Value = 0.001f * adlt.Temperature;
    2.30 +      if (ADL.ADL_Overdrive5_Temperature_Get(adapterIndex, 0, ref adlt)
    2.31 +        == ADL.ADL_OK) 
    2.32 +      {
    2.33 +        temperature.Value = 0.001f * adlt.Temperature;
    2.34 +        ActivateSensor(temperature);
    2.35 +      } else {
    2.36 +        DeactivateSensor(temperature);
    2.37 +      }
    2.38  
    2.39        ADLFanSpeedValue adlf = new ADLFanSpeedValue();
    2.40        adlf.SpeedType = ADL.ADL_DL_FANCTRL_SPEED_TYPE_RPM;
    2.41 -      ADL.ADL_Overdrive5_FanSpeed_Get(adapterIndex, 0, ref adlf);
    2.42 -      fan.Value = adlf.FanSpeed;
    2.43 +      if (ADL.ADL_Overdrive5_FanSpeed_Get(adapterIndex, 0, ref adlf)
    2.44 +        == ADL.ADL_OK) 
    2.45 +      {
    2.46 +        fan.Value = adlf.FanSpeed;
    2.47 +        ActivateSensor(fan);
    2.48 +      } else {
    2.49 +        DeactivateSensor(fan);
    2.50 +      }
    2.51  
    2.52        ADLPMActivity adlp = new ADLPMActivity();
    2.53 -      ADL.ADL_Overdrive5_CurrentActivity_Get(adapterIndex, ref adlp);
    2.54 -      coreClock.Value = 0.01f * adlp.EngineClock;
    2.55 -      memoryClock.Value = 0.01f * adlp.MemoryClock;
    2.56 -      coreVoltage.Value = 0.001f * adlp.Vddc;
    2.57 +      if (ADL.ADL_Overdrive5_CurrentActivity_Get(adapterIndex, ref adlp)
    2.58 +        == ADL.ADL_OK) 
    2.59 +      {
    2.60 +        coreClock.Value = 0.01f * adlp.EngineClock;
    2.61 +        memoryClock.Value = 0.01f * adlp.MemoryClock;
    2.62 +        coreVoltage.Value = 0.001f * adlp.Vddc;
    2.63 +        ActivateSensor(coreClock);
    2.64 +        ActivateSensor(memoryClock);
    2.65 +        ActivateSensor(coreVoltage);
    2.66 +      } else {
    2.67 +        DeactivateSensor(coreClock);
    2.68 +        DeactivateSensor(memoryClock);
    2.69 +        DeactivateSensor(coreVoltage);
    2.70 +      }
    2.71      }
    2.72  
    2.73 -    #pragma warning disable 67
    2.74 +    private void ActivateSensor(Sensor sensor) {
    2.75 +      if (!active.Contains(sensor)) {
    2.76 +        active.Add(sensor);
    2.77 +        if (SensorAdded != null) 
    2.78 +          SensorAdded(sensor);
    2.79 +      }
    2.80 +    }
    2.81 +
    2.82 +    private void DeactivateSensor(Sensor sensor) {
    2.83 +      if (active.Contains(sensor)) {
    2.84 +        active.Remove(sensor);
    2.85 +        if (SensorRemoved != null)
    2.86 +          SensorRemoved(sensor);
    2.87 +      }
    2.88 +    }
    2.89 +
    2.90      public event SensorEventHandler SensorAdded;
    2.91      public event SensorEventHandler SensorRemoved;
    2.92 -    #pragma warning restore 67
    2.93    }
    2.94  }
     3.1 --- a/Hardware/LPC/F71882.cs	Sun Jan 31 20:57:18 2010 +0000
     3.2 +++ b/Hardware/LPC/F71882.cs	Sun Jan 31 22:00:31 2010 +0000
     3.3 @@ -146,9 +146,10 @@
     3.4        }
     3.5  
     3.6        foreach (Sensor sensor in temperatures) {
     3.7 -        int value = ReadByte((byte)(TEMPERATURE_BASE_REG + 2 * sensor.Index));
     3.8 +        sbyte value = (sbyte)ReadByte((byte)(
     3.9 +          TEMPERATURE_BASE_REG + 2 * sensor.Index));
    3.10          sensor.Value = value;
    3.11 -        if (value < 254)
    3.12 +        if (value < sbyte.MaxValue && value > 0)
    3.13            ActivateSensor(sensor);
    3.14          else
    3.15            DeactivateSensor(sensor);
    3.16 @@ -170,14 +171,16 @@
    3.17      private void ActivateSensor(Sensor sensor) {
    3.18        if (!active.Contains(sensor)) {
    3.19          active.Add(sensor);
    3.20 -        SensorAdded(sensor);
    3.21 +        if (SensorAdded != null)
    3.22 +          SensorAdded(sensor);
    3.23        }
    3.24      }
    3.25  
    3.26      private void DeactivateSensor(Sensor sensor) {
    3.27        if (active.Contains(sensor)) {
    3.28          active.Remove(sensor);
    3.29 -        SensorRemoved(sensor);
    3.30 +        if (SensorRemoved != null)
    3.31 +          SensorRemoved(sensor);
    3.32        }
    3.33      }
    3.34  
     4.1 --- a/Hardware/LPC/IT87.cs	Sun Jan 31 20:57:18 2010 +0000
     4.2 +++ b/Hardware/LPC/IT87.cs	Sun Jan 31 22:00:31 2010 +0000
     4.3 @@ -205,14 +205,16 @@
     4.4      private void ActivateSensor(Sensor sensor) {
     4.5        if (!active.Contains(sensor)) {
     4.6          active.Add(sensor);
     4.7 -        SensorAdded(sensor);
     4.8 +        if (SensorAdded != null)
     4.9 +          SensorAdded(sensor);
    4.10        }
    4.11      }
    4.12  
    4.13      private void DeactivateSensor(Sensor sensor) {
    4.14        if (active.Contains(sensor)) {
    4.15          active.Remove(sensor);
    4.16 -        SensorRemoved(sensor);
    4.17 +        if (SensorRemoved != null)
    4.18 +          SensorRemoved(sensor);
    4.19        }
    4.20      }
    4.21  
     5.1 --- a/Hardware/LPC/W83627DHG.cs	Sun Jan 31 20:57:18 2010 +0000
     5.2 +++ b/Hardware/LPC/W83627DHG.cs	Sun Jan 31 22:00:31 2010 +0000
     5.3 @@ -239,14 +239,16 @@
     5.4      private void ActivateSensor(Sensor sensor) {
     5.5        if (!active.Contains(sensor)) {
     5.6          active.Add(sensor);
     5.7 -        SensorAdded(sensor);
     5.8 +        if (SensorAdded != null)
     5.9 +          SensorAdded(sensor);
    5.10        }
    5.11      }
    5.12  
    5.13      private void DeactivateSensor(Sensor sensor) {
    5.14        if (active.Contains(sensor)) {
    5.15          active.Remove(sensor);
    5.16 -        SensorRemoved(sensor);
    5.17 +        if (SensorRemoved != null)
    5.18 +          SensorRemoved(sensor);
    5.19        }
    5.20      }
    5.21  
     6.1 --- a/Hardware/TBalancer/TBalancer.cs	Sun Jan 31 20:57:18 2010 +0000
     6.2 +++ b/Hardware/TBalancer/TBalancer.cs	Sun Jan 31 22:00:31 2010 +0000
     6.3 @@ -81,7 +81,8 @@
     6.4        deactivating.Remove(sensor);
     6.5        if (!active.Contains(sensor)) {
     6.6          active.Add(sensor);
     6.7 -        SensorAdded(sensor);
     6.8 +        if (SensorAdded != null)
     6.9 +          SensorAdded(sensor);
    6.10        }      
    6.11      }
    6.12  
    6.13 @@ -89,7 +90,8 @@
    6.14        if (deactivating.Contains(sensor)) {
    6.15          active.Remove(sensor);
    6.16          deactivating.Remove(sensor);
    6.17 -        SensorRemoved(sensor);
    6.18 +        if (SensorRemoved != null)
    6.19 +          SensorRemoved(sensor);
    6.20        } else if (active.Contains(sensor)) {
    6.21          deactivating.Add(sensor);
    6.22        }     
     7.1 --- a/Properties/AssemblyInfo.cs	Sun Jan 31 20:57:18 2010 +0000
     7.2 +++ b/Properties/AssemblyInfo.cs	Sun Jan 31 22:00:31 2010 +0000
     7.3 @@ -69,5 +69,5 @@
     7.4  // You can specify all the values or you can default the Build and Revision Numbers 
     7.5  // by using the '*' as shown below:
     7.6  // [assembly: AssemblyVersion("1.0.*")]
     7.7 -[assembly: AssemblyVersion("0.1.5.0")]
     7.8 -[assembly: AssemblyFileVersion("0.1.5.0")]
     7.9 +[assembly: AssemblyVersion("0.1.6.0")]
    7.10 +[assembly: AssemblyFileVersion("0.1.6.0")]