static int DoStuff(ArgumentParser.TestOptions opts) { var rawFile = RawFileReaderFactory.ReadFile(opts.InputFiles.First()); rawFile.SelectInstrument(Device.MS, 1); var created = rawFile.CreationDate; var modified = rawFile.FileHeader.ModifiedDate; var diff = modified - created; var estTime = rawFile.RunHeader.ExpectedRuntime; var timesModified = rawFile.FileHeader.NumberOfTimesModified; Console.WriteLine("============================================="); Console.WriteLine($"Creation date/time: {created}"); Console.WriteLine($"Last modified date/time: {modified}"); Console.WriteLine($"Number of times modified: {timesModified}"); Console.WriteLine($"Total time: {diff}"); Console.WriteLine($"Expected run time: {estTime}"); Console.WriteLine(); Console.WriteLine($"Estimated dead time: {diff.TotalMinutes - estTime}"); Console.WriteLine("============================================="); /* * var numberOfLogs = rawFile.GetStatusLogEntriesCount(); * var logInfo = rawFile.GetStatusLogHeaderInformation(); * * string logName = opts.InputFiles.First() + ".INST_LOG.txt"; * * Dictionary<int, ISingleValueStatusLog> log = new Dictionary<int, ISingleValueStatusLog>(); * * for (int i = 0; i < logInfo.Count(); i++) * { * log.Add(i, rawFile.GetStatusLogAtPosition(i)); * } * * using (StreamWriter f = new StreamWriter(logName)) * { * ProgressIndicator P = new ProgressIndicator(numberOfLogs, "Writing instrument log"); * P.Start(); * f.Write("Time\t"); * foreach (var x in logInfo) * { * f.Write(x.Label + "\t"); * } * f.Write("\n"); * * for (int i = 0; i < numberOfLogs; i++) * { * f.Write($"{log[0].Times[i]}\t"); * * for (int j = 0; j < logInfo.Length; j++) * { * try * { * f.Write("{0}\t",log[j].Values[i]); * } * catch (Exception) * { * f.Write("\t"); * } * } * f.Write("\n"); * P.Update(); * } * P.Done(); * } * * Console.WriteLine(rawFile.GetInstrumentMethod(0)); * Console.WriteLine(rawFile.CreationDate); * Console.WriteLine(rawFile.FileHeader.ModifiedDate); * Console.WriteLine(rawFile.RunHeader.StartTime); * Console.WriteLine(rawFile.RunHeader.EndTime); */ return(0); }
static int DoStuff(ArgumentParser.TestOptions opts) { Console.WriteLine("Number of processors: {0}", Environment.ProcessorCount); return(0); }