Hardware/Computer.cs
changeset 256 6dc6410489f4
parent 254 d8079800a888
child 262 8731a1b81301
     1.1 --- a/Hardware/Computer.cs	Fri Feb 11 22:29:26 2011 +0000
     1.2 +++ b/Hardware/Computer.cs	Sat Feb 12 21:17:42 2011 +0000
     1.3 @@ -151,42 +151,43 @@
     1.4        IHardware hardware, TextWriter w, string space) 
     1.5      {
     1.6        w.WriteLine("{0}|", space);
     1.7 -      w.WriteLine("{0}+-+ {1} ({2})",
     1.8 +      w.WriteLine("{0}+- {1} ({2})",
     1.9          space, hardware.Name, hardware.Identifier);
    1.10        ISensor[] sensors = hardware.Sensors;
    1.11        Array.Sort(sensors, CompareSensor);
    1.12        foreach (ISensor sensor in sensors) {
    1.13 -        w.WriteLine("{0}|   +- {1}[{2}] : {3} : {4}",
    1.14 -          space, sensor.SensorType, sensor.Index, 
    1.15 -            string.Format(CultureInfo.InvariantCulture, "{0} : {1} : {2}",
    1.16 -            sensor.Value, sensor.Min, sensor.Max), sensor.Name);
    1.17 +        w.WriteLine("{0}|  +- {1,-14} : {2,8:G6} {3,8:G6} {4,8:G6} ({5})", 
    1.18 +          space, sensor.Name, sensor.Value, sensor.Min, sensor.Max, 
    1.19 +          sensor.Identifier);
    1.20        }
    1.21        foreach (IHardware subHardware in hardware.SubHardware)
    1.22 -        ReportHardwareSensorTree(subHardware, w, "|   ");
    1.23 +        ReportHardwareSensorTree(subHardware, w, "|  ");
    1.24      }
    1.25  
    1.26      private static void ReportHardwareParameterTree(
    1.27 -      IHardware hardware, TextWriter w, string space) 
    1.28 -    {
    1.29 +      IHardware hardware, TextWriter w, string space) {
    1.30        w.WriteLine("{0}|", space);
    1.31 -      w.WriteLine("{0}+-+ {1} ({2})",
    1.32 +      w.WriteLine("{0}+- {1} ({2})",
    1.33          space, hardware.Name, hardware.Identifier);
    1.34        ISensor[] sensors = hardware.Sensors;
    1.35        Array.Sort(sensors, CompareSensor);
    1.36        foreach (ISensor sensor in sensors) {
    1.37 +        string innerSpace = space + "|  ";
    1.38          if (sensor.Parameters.Length > 0) {
    1.39 -          w.WriteLine("{0}|   +- {1}[{2}] : {3}",
    1.40 -            space, sensor.SensorType, sensor.Index, sensor.Name);
    1.41 +          w.WriteLine("{0}|", innerSpace);
    1.42 +          w.WriteLine("{0}+- {1} ({2})",
    1.43 +            innerSpace, sensor.Name, sensor.Identifier);
    1.44            foreach (IParameter parameter in sensor.Parameters) {
    1.45 -            w.WriteLine("{0}|      +- {1} : {2}",
    1.46 -              space, parameter.Name,
    1.47 +            string innerInnerSpace = innerSpace + "|  ";
    1.48 +            w.WriteLine("{0}+- {1} : {2}",
    1.49 +              innerInnerSpace, parameter.Name,
    1.50                string.Format(CultureInfo.InvariantCulture, "{0} : {1}",
    1.51                  parameter.DefaultValue, parameter.Value));
    1.52            }
    1.53          }
    1.54        }
    1.55        foreach (IHardware subHardware in hardware.SubHardware)
    1.56 -        ReportHardwareParameterTree(subHardware, w, "|   ");
    1.57 +        ReportHardwareParameterTree(subHardware, w, "|  ");
    1.58      }
    1.59  
    1.60      private static void ReportHardware(IHardware hardware, TextWriter w) {