Fixed Issue 164.

This commit is contained in:
Michael Möller
2011-02-12 21:17:42 +00:00
parent 46e4752c8f
commit fc62ecc4df
4 changed files with 33 additions and 26 deletions
+15 -14
View File
@@ -151,42 +151,43 @@ namespace OpenHardwareMonitor.Hardware {
IHardware hardware, TextWriter w, string space)
{
w.WriteLine("{0}|", space);
w.WriteLine("{0}+-+ {1} ({2})",
w.WriteLine("{0}+- {1} ({2})",
space, hardware.Name, hardware.Identifier);
ISensor[] sensors = hardware.Sensors;
Array.Sort(sensors, CompareSensor);
foreach (ISensor sensor in sensors) {
w.WriteLine("{0}| +- {1}[{2}] : {3} : {4}",
space, sensor.SensorType, sensor.Index,
string.Format(CultureInfo.InvariantCulture, "{0} : {1} : {2}",
sensor.Value, sensor.Min, sensor.Max), sensor.Name);
w.WriteLine("{0}| +- {1,-14} : {2,8:G6} {3,8:G6} {4,8:G6} ({5})",
space, sensor.Name, sensor.Value, sensor.Min, sensor.Max,
sensor.Identifier);
}
foreach (IHardware subHardware in hardware.SubHardware)
ReportHardwareSensorTree(subHardware, w, "| ");
ReportHardwareSensorTree(subHardware, w, "| ");
}
private static void ReportHardwareParameterTree(
IHardware hardware, TextWriter w, string space)
{
IHardware hardware, TextWriter w, string space) {
w.WriteLine("{0}|", space);
w.WriteLine("{0}+-+ {1} ({2})",
w.WriteLine("{0}+- {1} ({2})",
space, hardware.Name, hardware.Identifier);
ISensor[] sensors = hardware.Sensors;
Array.Sort(sensors, CompareSensor);
foreach (ISensor sensor in sensors) {
string innerSpace = space + "| ";
if (sensor.Parameters.Length > 0) {
w.WriteLine("{0}| +- {1}[{2}] : {3}",
space, sensor.SensorType, sensor.Index, sensor.Name);
w.WriteLine("{0}|", innerSpace);
w.WriteLine("{0}+- {1} ({2})",
innerSpace, sensor.Name, sensor.Identifier);
foreach (IParameter parameter in sensor.Parameters) {
w.WriteLine("{0}| +- {1} : {2}",
space, parameter.Name,
string innerInnerSpace = innerSpace + "| ";
w.WriteLine("{0}+- {1} : {2}",
innerInnerSpace, parameter.Name,
string.Format(CultureInfo.InvariantCulture, "{0} : {1}",
parameter.DefaultValue, parameter.Value));
}
}
}
foreach (IHardware subHardware in hardware.SubHardware)
ReportHardwareParameterTree(subHardware, w, "| ");
ReportHardwareParameterTree(subHardware, w, "| ");
}
private static void ReportHardware(IHardware hardware, TextWriter w) {
+6 -4
View File
@@ -182,10 +182,12 @@ namespace OpenHardwareMonitor.Hardware.Heatmaster {
public string GetReport() {
if (report.Length > 0) {
report.Insert(0, "Serial Port Heatmaster" + Environment.NewLine +
Environment.NewLine);
report.AppendLine();
return report.ToString();
StringBuilder r = new StringBuilder();
r.AppendLine("Serial Port Heatmaster");
r.AppendLine();
r.Append(report);
r.AppendLine();
return r.ToString();
} else
return null;
}
+6 -4
View File
@@ -168,10 +168,12 @@ namespace OpenHardwareMonitor.Hardware {
public static string GetReport() {
if (report.Length > 0) {
report.Insert(0, "Ring0" + Environment.NewLine +
Environment.NewLine);
report.AppendLine();
return report.ToString();
StringBuilder r = new StringBuilder();
r.AppendLine("Ring0");
r.AppendLine();
r.Append(report);
r.AppendLine();
return r.ToString();
} else
return null;
}
+6 -4
View File
@@ -163,10 +163,12 @@ namespace OpenHardwareMonitor.Hardware.TBalancer {
public string GetReport() {
if (report.Length > 0) {
report.Insert(0, "FTD2XX" + Environment.NewLine +
Environment.NewLine);
report.AppendLine();
return report.ToString();
StringBuilder r = new StringBuilder();
r.AppendLine("FTD2XX");
r.AppendLine();
r.Append(report);
r.AppendLine();
return r.ToString();
} else
return null;
}