1.1 --- a/Hardware/ReportWriter.cs Fri Feb 05 22:45:15 2010 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,63 +0,0 @@
1.4 -using System;
1.5 -using System.Collections.Generic;
1.6 -using System.IO;
1.7 -using System.Text;
1.8 -
1.9 -namespace OpenHardwareMonitor.Hardware {
1.10 - public class ReportWriter {
1.11 -
1.12 - private static void NewSection(TextWriter writer) {
1.13 - for (int i = 0; i < 8; i++)
1.14 - writer.Write("----------");
1.15 - writer.WriteLine();
1.16 - writer.WriteLine();
1.17 - }
1.18 -
1.19 - public static void Save(List<IGroup> groupList, Version version) {
1.20 -
1.21 - using (TextWriter w =
1.22 - new StreamWriter("OpenHardwareMonitor.Report.txt")) {
1.23 -
1.24 - w.WriteLine();
1.25 - w.WriteLine("Open Hardware Monitor Report");
1.26 - w.WriteLine();
1.27 -
1.28 - NewSection(w);
1.29 - w.Write("Version: "); w.WriteLine(version.ToString());
1.30 - w.WriteLine();
1.31 -
1.32 - NewSection(w);
1.33 - foreach (IGroup group in groupList) {
1.34 - foreach (IHardware hardware in group.Hardware) {
1.35 - w.WriteLine("|");
1.36 - w.WriteLine("+-+ {0} ({1})",
1.37 - new object[] { hardware.Name, hardware.Identifier });
1.38 - foreach (ISensor sensor in hardware.Sensors) {
1.39 - w.WriteLine("| +- {0} : {1} : {2} : {3}",
1.40 - new object[] { sensor.SensorType, sensor.Index, sensor.Name,
1.41 - sensor.Value });
1.42 - }
1.43 - }
1.44 - }
1.45 - w.WriteLine();
1.46 -
1.47 - foreach (IGroup group in groupList) {
1.48 - string report = group.GetReport();
1.49 - if (report != null) {
1.50 - NewSection(w);
1.51 - w.Write(report);
1.52 - }
1.53 -
1.54 - IHardware[] hardwareArray = group.Hardware;
1.55 - foreach (IHardware hardware in hardwareArray) {
1.56 - string hardwareReport = hardware.GetReport();
1.57 - if (hardwareReport != null) {
1.58 - NewSection(w);
1.59 - w.Write(hardwareReport);
1.60 - }
1.61 - }
1.62 - }
1.63 - }
1.64 - }
1.65 - }
1.66 -}