Hardware/Nvidia/NvidiaGroup.cs
changeset 195 0ee888c485d5
parent 182 4801e9eaf979
child 298 96263190189a
     1.1 --- a/Hardware/Nvidia/NvidiaGroup.cs	Tue Sep 21 10:33:28 2010 +0000
     1.2 +++ b/Hardware/Nvidia/NvidiaGroup.cs	Tue Sep 21 20:32:36 2010 +0000
     1.3 @@ -43,8 +43,8 @@
     1.4  
     1.5    internal class NvidiaGroup : IGroup {
     1.6     
     1.7 -    private List<IHardware> hardware = new List<IHardware>();
     1.8 -    private StringBuilder report = new StringBuilder();
     1.9 +    private readonly List<IHardware> hardware = new List<IHardware>();
    1.10 +    private readonly StringBuilder report = new StringBuilder();
    1.11  
    1.12      public NvidiaGroup(ISettings settings) {
    1.13        if (!NVAPI.IsAvailable)
    1.14 @@ -69,7 +69,7 @@
    1.15        } else {        
    1.16          NvStatus status = NVAPI.NvAPI_EnumPhysicalGPUs(handles, out count);
    1.17          if (status != NvStatus.OK) {
    1.18 -          report.AppendLine("Status: " + status.ToString());
    1.19 +          report.AppendLine("Status: " + status);
    1.20            report.AppendLine();
    1.21            return;
    1.22          }
    1.23 @@ -104,14 +104,12 @@
    1.24        }
    1.25  
    1.26        report.Append("Number of GPUs: ");
    1.27 -      report.AppendLine(count.ToString(CultureInfo.InvariantCulture));      
    1.28 -      
    1.29 -      for (int i = 0; i < count; i++) {    
    1.30 +      report.AppendLine(count.ToString(CultureInfo.InvariantCulture));
    1.31 +
    1.32 +      for (int i = 0; i < count; i++) {
    1.33          NvDisplayHandle displayHandle;
    1.34 -        if (displayHandles.TryGetValue(handles[i], out displayHandle))
    1.35 -          hardware.Add(new NvidiaGPU(i, handles[i], displayHandle, settings));                            
    1.36 -        else
    1.37 -          hardware.Add(new NvidiaGPU(i, handles[i], null, settings));   
    1.38 +        displayHandles.TryGetValue(handles[i], out displayHandle);
    1.39 +        hardware.Add(new NvidiaGPU(i, handles[i], displayHandle, settings));
    1.40        }
    1.41  
    1.42        report.AppendLine();