using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace HDDReader { public class Drive { // Empty Constructor public Drive() { Initialized = false; Model = ""; Serial = ""; FirmwareRev = ""; InterfaceType = ""; PowerOnTime = ""; PowerOnHours = ""; StartStopCount = ""; BadSectorCount = ""; WeakSectorCount = ""; SpinRetryCount = ""; CommunicationIssueCount = ""; StatusCode = ""; TrimStatus = ""; Report = ""; Temperature = ""; Health = ""; Performance = ""; LifetimeWrites = ""; SmartDATA = ""; } // Split filled constructors among functions to add readability public void InitValues(string model, string serial, string firmware, string interfaceType, string powerOnTime) { Initialized = true; Model = model; Serial = serial; FirmwareRev = firmware; InterfaceType = interfaceType; PowerOnTime = powerOnTime; } public void PopulateData(string powerOnHrs, string startStop, string badSector, string weakSector, string spinRetry, string commIssue, string statusCode, string trim) { PowerOnHours = powerOnHrs; StartStopCount = startStop; BadSectorCount = badSector; WeakSectorCount = weakSector; SpinRetryCount = spinRetry; CommunicationIssueCount = commIssue; StatusCode = statusCode; TrimStatus = trim; } public void PopulateReport(string report, string temp, string health, string perf, string writes, string smart) { Report = report; Temperature = temp; Health = health; Performance = perf; LifetimeWrites = writes; SmartDATA = smart; } public void PrintReport() { Console.WriteLine("Model: " + Model); Console.WriteLine("Serial: " + Serial); Console.WriteLine("Health: " + Health); Console.WriteLine("Power On Time: " + PowerOnTime); Console.WriteLine("Power On Hours: " + PowerOnHours); Console.WriteLine("Total Writes: " + LifetimeWrites); Console.WriteLine("Performance: " + Performance); } // All variables are currently public, can change to private depending on what you intend to do with it public bool Initialized { get; set; } public string Model { get; set; } public string Serial { get; set; } public string FirmwareRev { get; set; } public string InterfaceType { get; set; } public string PowerOnTime { get; set; } public string PowerOnHours { get; set; } public string StartStopCount { get; set; } public string BadSectorCount { get; set; } public string WeakSectorCount { get; set; } public string SpinRetryCount { get; set; } public string CommunicationIssueCount { get; set; } public string StatusCode { get; set; } public string TrimStatus { get; set; } public string Report { get; set; } public string Temperature { get; set; } public string Health { get; set; } public string Performance { get; set; } public string LifetimeWrites { get; set; } public string SmartDATA { get; set; } } }