private IEnumerable <Summary> ReadSummaries(string documentsPath) { /* * var summaryFile = Path.Combine(documentsPath, DatacardConstants.SummariesFile); * if (File.Exists(summaryFile)) * return _protobufSerializer.Read<IEnumerable<Summary>>(summaryFile); * return Enumerable.Empty<Summary>(); */ var loggedDataFiles = Directory.EnumerateFiles(documentsPath, DatacardConstants.ConvertToSearchPattern(DatacardConstants.SummaryFile)); foreach (var loggedDataFile in loggedDataFiles) { var loggedData = _protobufSerializer.Read <Summary>(loggedDataFile); yield return(loggedData); } }
private IEnumerable <LoggedData> ReadLoggedData(string documentsPath) { var loggedDataFiles = Directory.EnumerateFiles(documentsPath, DatacardConstants.ConvertToSearchPattern(DatacardConstants.LoggedDataFile)); foreach (var loggedDataFile in loggedDataFiles) { var loggedData = _protobufSerializer.Read <LoggedData>(loggedDataFile); foreach (var operationData in loggedData.OperationData) { ImportSpatialRecords(documentsPath, operationData); ImportSections(documentsPath, operationData); ImportMeters(documentsPath, operationData); } yield return(loggedData); } }
private IEnumerable <Recommendation> ReadRecommendations(string documentsPath) { var loggedDataFiles = Directory.EnumerateFiles(documentsPath, DatacardConstants.ConvertToSearchPattern(DatacardConstants.RecommendationFile)); return(loggedDataFiles.Select(loggedDataFile => _protobufSerializer.Read <Recommendation>(loggedDataFile))); }
private IEnumerable <WorkItem> ReadWorkItems(string documentsPath) { var loggedDataFiles = Directory.EnumerateFiles(documentsPath, DatacardConstants.ConvertToSearchPattern(DatacardConstants.WorkItemFile)); return(loggedDataFiles.Select(loggedDataFile => _protobufSerializer.Read <WorkItem>(loggedDataFile))); }