public BatchProcessor(Params arguments) { var serviceProvider = ConfigureServices(); SetupXbimLogging(serviceProvider); IfcStore.ModelProviderFactory.UseHeuristicModelProvider(); _params = arguments; _thisReportSet = new ProcessResultSet(); }
public void Run() { DirectoryInfo di = new DirectoryInfo(Params.TestFileRoot); //get last report FileInfo lastReport = di.GetFiles("XbimRegression_*.csv").OrderByDescending(f => f.LastWriteTime).FirstOrDefault(); if (lastReport != null) { _lastReportSet = new ProcessResultSet(); Console.WriteLine("Loading last report file"); _lastReportSet.LoadFromFile(lastReport.FullName); } // We need to use the logger early to initialise before we use EventTrace Logger.Debug("Conversion starting..."); //get files to process FileInfo[] toProcess = di.GetFiles("*.IFC", SearchOption.AllDirectories); foreach (var file in toProcess) { Console.WriteLine("Processing {0}", file); ProcessResult result = ProcessFile(file.FullName); if (!result.Failed) { Console.WriteLine("Processed {0} : {1} errors, {2} Warnings in {3}ms. {4} IFC Elements & {5} Geometry Nodes.", file, result.Errors, result.Warnings, result.TotalTime, result.Entities, result.GeometryEntries); } else { Console.WriteLine("Processing failed for {0} after {1}ms.", file, result.TotalTime); } } //write results to csv file Console.WriteLine("Creating report... "); String resultsFile = Path.Combine(Params.TestFileRoot, String.Format("XbimRegression_{0:yyyyMMdd-hhmmss}.csv", DateTime.Now)); _thisReportSet.WriteToFile(resultsFile); ///Finished and wait... Console.WriteLine("Finished. Press Enter to continue..."); Console.ReadLine(); }
public BatchProcessor(Params arguments) { _params = arguments; _thisReportSet = new ProcessResultSet(); }