Example #1
0
        private ProgressiveVolumesSubGridRetriever MakeANewRetriever(ISiteModel siteModel)
        {
            var retriever = new ProgressiveVolumesSubGridRetriever
                                (siteModel,
                                GridDataType.ProgressiveVolumes,
                                siteModel.PrimaryStorageProxy,
                                new CombinedFilter(),
                                new CellPassAttributeFilterProcessingAnnex(),
                                false,
                                BoundingIntegerExtent2D.Inverted(),
                                true,
                                int.MaxValue,
                                new AreaControlSet(),
                                new FilteredValuePopulationControl(),
                                new SubGridTreeBitMask(),
                                new OverrideParameters(),
                                new LiftParameters()
                                );

            retriever.StartDate = new DateTime(2020, 1, 1, 0, 0, 0);
            retriever.EndDate   = new DateTime(2020, 1, 1, 1, 0, 0);
            retriever.Interval  = new TimeSpan(0, 10, 0);

            return(retriever);
        }
Example #2
0
        public ISubGridRetriever Instance(ISubGridsRequestArgument subGridsRequestArgument,
                                          ISiteModel siteModel,
                                          GridDataType gridDataType,
                                          IStorageProxy storageProxy,
                                          ICombinedFilter filter,
                                          ICellPassAttributeFilterProcessingAnnex filterAnnex,
                                          bool hasOverrideSpatialCellRestriction,
                                          BoundingIntegerExtent2D overrideSpatialCellRestriction,
                                          int maxNumberOfPassesToReturn,
                                          AreaControlSet areaControlSet,
                                          IFilteredValuePopulationControl populationControl,
                                          ISubGridTreeBitMask pdExistenceMap,
                                          ITRexSpatialMemoryCacheContext[] subGridCacheContexts,
                                          IOverrideParameters overrides,
                                          ILiftParameters liftParams)
        {
            if (gridDataType == GridDataType.ProgressiveVolumes)
            {
                var retriever = new ProgressiveVolumesSubGridRetriever(siteModel,
                                                                       gridDataType,
                                                                       storageProxy,
                                                                       filter,
                                                                       filterAnnex,
                                                                       hasOverrideSpatialCellRestriction,
                                                                       overrideSpatialCellRestriction,
                                                                       subGridCacheContexts != null,
                                                                       maxNumberOfPassesToReturn,
                                                                       areaControlSet,
                                                                       populationControl,
                                                                       pdExistenceMap,
                                                                       overrides,
                                                                       liftParams);

                if (subGridsRequestArgument is IProgressiveVolumesSubGridsRequestArgument argument)
                {
                    retriever.StartDate = argument.StartDate;
                    retriever.EndDate   = argument.EndDate;
                    retriever.Interval  = argument.Interval;
                }
                else
                {
                    throw new ArgumentException($"Argument passed to sub grid retriever factory for progressive volumes retriever construction is not an expected type: {subGridsRequestArgument.GetType()}");
                }

                return(retriever);
            }
            else
            {
                var retriever = new SubGridRetriever(siteModel,
                                                     gridDataType,
                                                     storageProxy,
                                                     filter,
                                                     filterAnnex,
                                                     hasOverrideSpatialCellRestriction,
                                                     overrideSpatialCellRestriction,
                                                     subGridCacheContexts != null,
                                                     maxNumberOfPassesToReturn,
                                                     areaControlSet,
                                                     populationControl,
                                                     pdExistenceMap,
                                                     overrides,
                                                     liftParams);

                return(retriever);
            }
        }