示例#1
0
        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);
            }
        }
示例#2
0
        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);
            }
        }
示例#3
0
        private IEnumerable <Recommendation> ReadRecommendations(string documentsPath)
        {
            var loggedDataFiles = Directory.EnumerateFiles(documentsPath, DatacardConstants.ConvertToSearchPattern(DatacardConstants.RecommendationFile));

            return(loggedDataFiles.Select(loggedDataFile => _protobufSerializer.Read <Recommendation>(loggedDataFile)));
        }
示例#4
0
        private IEnumerable <WorkItem> ReadWorkItems(string documentsPath)
        {
            var loggedDataFiles = Directory.EnumerateFiles(documentsPath, DatacardConstants.ConvertToSearchPattern(DatacardConstants.WorkItemFile));

            return(loggedDataFiles.Select(loggedDataFile => _protobufSerializer.Read <WorkItem>(loggedDataFile)));
        }