Hardware/HDD/AbstractHarddrive.cs
changeset 374 ea86cea126bc
parent 369 5077ed7ddca8
child 385 8f16f03797f5
     1.1 --- a/Hardware/HDD/AbstractHarddrive.cs	Wed Jul 25 15:33:16 2012 +0000
     1.2 +++ b/Hardware/HDD/AbstractHarddrive.cs	Wed Jul 25 16:03:36 2012 +0000
     1.3 @@ -169,7 +169,8 @@
     1.4          if (!sensorTypeAndChannels.Contains(pair)) {
     1.5            Sensor sensor = new Sensor(attribute.Name, 
     1.6              attribute.SensorChannel, attribute.DefaultHiddenSensor, 
     1.7 -            attribute.SensorType.Value, this, null, settings);
     1.8 +            attribute.SensorType.Value, this, attribute.ParameterDescriptions, 
     1.9 +            settings);
    1.10  
    1.11            sensors.Add(attribute, sensor);
    1.12            ActivateSensor(sensor);
    1.13 @@ -199,7 +200,7 @@
    1.14            foreach (DriveAttributeValue value in values) {
    1.15              if (value.Identifier == attribute.Identifier) {
    1.16                Sensor sensor = keyValuePair.Value;
    1.17 -              sensor.Value = attribute.ConvertValue(value);
    1.18 +              sensor.Value = attribute.ConvertValue(value, sensor.Parameters);
    1.19              }
    1.20            }
    1.21          }
    1.22 @@ -261,7 +262,7 @@
    1.23              if (a.Identifier == value.Identifier) {
    1.24                description = a.Name;
    1.25                if (a.HasRawValueConversion | a.SensorType.HasValue)
    1.26 -                physical = a.ConvertValue(value);
    1.27 +                physical = a.ConvertValue(value, null);
    1.28                else
    1.29                  physical = null;
    1.30              }
    1.31 @@ -295,7 +296,9 @@
    1.32        return r.ToString();
    1.33      }
    1.34  
    1.35 -    protected static float RawToInt(byte[] raw, byte value) {
    1.36 +    protected static float RawToInt(byte[] raw, byte value,
    1.37 +      IReadOnlyArray<IParameter> parameters) 
    1.38 +    {
    1.39        return (raw[3] << 24) | (raw[2] << 16) | (raw[1] << 8) | raw[0];
    1.40      }
    1.41