/// <summary> /// Constructor for the sub grid retriever helper /// </summary> /// <param name="siteModel">The project this sub gris is being retrieved from</param> /// <param name="gridDataType">The type of client grid data sub grids to be returned by this retriever</param> /// <param name="storageProxy">The Ignite storage proxy to be used when requesting data from the persistent store</param> /// <param name="filter">The TRex spatial and attribute filtering description for the request</param> /// <param name="filterAnnex">An annex of data related to cell by cell filtering where the attributes related to that cell may change from cell to cell</param> /// <param name="hasOverrideSpatialCellRestriction">The spatially selected cells are masked by a rectangular restriction boundary</param> /// <param name="overrideSpatialCellRestriction"></param> /// <param name="prepareGridForCacheStorageIfNoSieving">The cell coordinate bounding box restricting cells involved in the request</param> /// <param name="maxNumberOfPassesToReturn">The maximum number of passes in a cell in a sub grid that will be considered when processing the request</param> /// <param name="areaControlSet">The skip/step area control set for selection of cells with sub grids for processing. Cells not identified by the control set will return null values.</param> /// <param name="populationControl">The delegate responsible for populating events depended on for processing the request.</param> /// <param name="pDExistenceMap">The production data existence map for the project the request relates to</param> /// <param name="overrides">The set of overriding machine event values to use</param> /// <param name="liftParams">The set of layer/lift analysis parameters to use</param> public ProgressiveVolumesSubGridRetriever(ISiteModel siteModel, GridDataType gridDataType, IStorageProxy storageProxy, ICombinedFilter filter, ICellPassAttributeFilterProcessingAnnex filterAnnex, bool hasOverrideSpatialCellRestriction, BoundingIntegerExtent2D overrideSpatialCellRestriction, bool prepareGridForCacheStorageIfNoSieving, int maxNumberOfPassesToReturn, AreaControlSet areaControlSet, IFilteredValuePopulationControl populationControl, ISubGridTreeBitMask pDExistenceMap, IOverrideParameters overrides, ILiftParameters liftParams) : base(siteModel, gridDataType, filter, filterAnnex, hasOverrideSpatialCellRestriction, overrideSpatialCellRestriction, prepareGridForCacheStorageIfNoSieving, maxNumberOfPassesToReturn, storageProxy, areaControlSet, populationControl, pDExistenceMap, overrides, liftParams) { // Clear any time element from the supplied filter. Time constraints ar derived from the startDate and endDate parameters filter.AttributeFilter.HasTimeFilter = false; // Clear any instruction in the filter to extract the earliest value - this has no meaning in progressive calculations filter.AttributeFilter.ReturnEarliestFilteredCellPass = false; // Remove any first/last/highest/lowest aspect from the filter - this has no meaning in progressive calculations filter.AttributeFilter.HasElevationTypeFilter = false; // Remove any machine filtering - the intent here is to examine volume progression over time, machine breakdowns don't make sense at this point filter.AttributeFilter.HasMachineFilter = false; }
/// <summary> /// Constructs a cell profile analyzer that analyzes cells in a cell profile vector /// </summary> /// <param name="siteModel"></param> /// <param name="pDExistenceMap"></param> /// <param name="filterSet"></param> /// <param name="cellLiftBuilder"></param> /// <param name="overrides"></param> public CellProfileAnalyzer(ISiteModel siteModel, ISubGridTreeBitMask pDExistenceMap, IFilterSet filterSet, ICellLiftBuilder cellLiftBuilder, IOverrideParameters overrides, ILiftParameters liftParams) : base(siteModel, pDExistenceMap, filterSet, overrides, liftParams) { CellLiftBuilder = cellLiftBuilder; PassFilter = filterSet.Filters[0].AttributeFilter; if (PassFilter.HasElevationRangeFilter && PassFilter.ElevationRangeDesign.DesignID != Guid.Empty) { var design = siteModel.Designs.Locate(PassFilter.ElevationRangeDesign.DesignID); if (design == null) { Log.LogError($"ElevationRangeDesign {PassFilter.ElevationRangeDesign.DesignID} is unknown in project {siteModel.ID}"); } else { PassFilterElevationRangeDesign = new DesignWrapper(PassFilter.ElevationRangeDesign, design); } } PassFilterAnnex = new CellPassAttributeFilterProcessingAnnex(); CellFilter = filterSet.Filters[0].SpatialFilter; }
/// <summary> /// Constructs a profile lift builder that analyzes cells in a cell profile vector /// </summary> public SummaryVolumesCellProfileAnalyzer(ISiteModel siteModel, ISubGridTreeBitMask pDExistenceMap, IFilterSet filterSet, IDesignWrapper referenceDesignWrapper, ICellLiftBuilder cellLiftBuilder, VolumeComputationType volumeType, IOverrideParameters overrides, ILiftParameters liftParams) : base(siteModel, pDExistenceMap, filterSet, overrides, liftParams) { svDesignWrapper = referenceDesignWrapper; VolumeType = volumeType; }
/// <summary> /// Constructs the profile analysis executor /// </summary> public ComputeProfileExecutor_ClusterCompute(ProfileStyle profileStyle, Guid projectID, GridDataType profileTypeRequired, XYZ[] nEECoords, IFilterSet filters, // externalRequestDescriptor: TASNodeRequestDescriptor; DesignOffset design, bool returnAllPassesAndLayers, VolumeComputationType volumeType, IOverrideParameters overrides, ILiftParameters liftParams) { ProfileStyle = profileStyle; ProjectID = projectID; ProfileTypeRequired = profileTypeRequired; NEECoords = nEECoords; Filters = filters; Design = design; VolumeType = volumeType; Overrides = overrides; LiftParams = liftParams; }
/// <summary> /// Constructs a profile lift builder that analyzes cells in a cell profile vector /// </summary> public CellProfileAnalyzerBase(ISiteModel siteModel, ISubGridTreeBitMask pDExistenceMap, IFilterSet filterSet, IOverrideParameters overrides, ILiftParameters liftParams) { SiteModel = siteModel; PDExistenceMap = pDExistenceMap; FilterSet = filterSet; Overrides = overrides; LiftParams = liftParams; Initialise(); }
public CellDatumRequestArgument_ApplicationService( Guid siteModelID, DisplayMode mode, bool coordsAreGrid, XYZ point, IFilterSet filters, DesignOffset referenceDesign, IOverrideParameters overrides) { ProjectID = siteModelID; Mode = mode; CoordsAreGrid = coordsAreGrid; Point = point; Filters = filters; ReferenceDesign = referenceDesign; Overrides = overrides; }
protected SubGridRetrieverBase(ISiteModel siteModel, GridDataType gridDataType, ICombinedFilter filter, ICellPassAttributeFilterProcessingAnnex filterAnnex, bool hasOverrideSpatialCellRestriction, BoundingIntegerExtent2D overrideSpatialCellRestriction, bool prepareGridForCacheStorageIfNoSieving, int maxNumberOfPassesToReturn, IStorageProxy storageProxy, AreaControlSet areaControlSet, IFilteredValuePopulationControl populationControl, ISubGridTreeBitMask pDExistenceMap, IOverrideParameters overrides, ILiftParameters liftParams) { _segmentIterator = null; _cellPassIterator = null; _siteModel = siteModel; _gridDataType = gridDataType; _filter = filter; _filterAnnex = filterAnnex; _hasOverrideSpatialCellRestriction = hasOverrideSpatialCellRestriction; _overrideSpatialCellRestriction = overrideSpatialCellRestriction; _prepareGridForCacheStorageIfNoSieving = prepareGridForCacheStorageIfNoSieving; _maxNumberOfPassesToReturn = maxNumberOfPassesToReturn; _storageProxy = storageProxy; _populationControl = populationControl; _areaControlSet = areaControlSet; _pdExistenceMap = pDExistenceMap; _overrides = overrides; _liftParams = liftParams; // Create and configure the assignment context which is used to contain a filtered pass and // its attendant machine events and target values prior to assignment to the client sub grid. _assignmentContext = new FilteredValueAssignmentContext { Overrides = overrides, LiftParams = liftParams }; _filter.AttributeFilter.SiteModel = siteModel; _canUseGlobalLatestCells = _filter.AttributeFilter.LastRecordedCellPassSatisfiesFilter; }
/// <summary> /// Constructor for the sub grid retriever helper /// </summary> /// <param name="siteModel">The project this sub gris is being retrieved from</param> /// <param name="gridDataType">The type of client grid data sub grids to be returned by this retriever</param> /// <param name="storageProxy">The Ignite storage proxy to be used when requesting data from the persistent store</param> /// <param name="filter">The TRex spatial and attribute filtering description for the request</param> /// <param name="filterAnnex">An annex of data related to cell by cell filtering where the attributes related to that cell may change from cell to cell</param> /// <param name="hasOverrideSpatialCellRestriction">The spatially selected cells are masked by a rectangular restriction boundary</param> /// <param name="overrideSpatialCellRestriction"></param> /// <param name="prepareGridForCacheStorageIfNoSieving">The cell coordinate bounding box restricting cells involved in the request</param> /// <param name="maxNumberOfPassesToReturn">The maximum number of passes in a cell in a sub grid that will be considered when processing the request</param> /// <param name="areaControlSet">The skip/step area control set for selection of cells with sub grids for processing. Cells not identified by the control set will return null values.</param> /// <param name="populationControl">The delegate responsible for populating events depended on for processing the request.</param> /// <param name="pDExistenceMap">The production data existence map for the project the request relates to</param> /// <param name="overrides">The set of overriding machine event values to use</param> /// <param name="liftParams">The set of layer/lift analysis parameters to use</param> public SubGridRetriever(ISiteModel siteModel, GridDataType gridDataType, IStorageProxy storageProxy, ICombinedFilter filter, ICellPassAttributeFilterProcessingAnnex filterAnnex, bool hasOverrideSpatialCellRestriction, BoundingIntegerExtent2D overrideSpatialCellRestriction, bool prepareGridForCacheStorageIfNoSieving, int maxNumberOfPassesToReturn, AreaControlSet areaControlSet, IFilteredValuePopulationControl populationControl, ISubGridTreeBitMask pDExistenceMap, IOverrideParameters overrides, ILiftParameters liftParams) : base(siteModel, gridDataType, filter, filterAnnex, hasOverrideSpatialCellRestriction, overrideSpatialCellRestriction, prepareGridForCacheStorageIfNoSieving, maxNumberOfPassesToReturn, storageProxy, areaControlSet, populationControl, pDExistenceMap, overrides, liftParams) { }
/// <summary> /// Configures a new profile builder that provides the three core builders used in profiling: construction of cell vector from profile line, /// profile analysis orchestration and per cell layer/statistics calculation /// </summary> public void Configure(ProfileStyle profileStyle, ISiteModel siteModel, ISubGridTreeBitMask productionDataExistenceMap, GridDataType gridDataType, IFilterSet filterSet, IDesignWrapper referenceDesignWrapper, IFilteredValuePopulationControl PopulationControl, ICellPassFastEventLookerUpper CellPassFastEventLookerUpper, VolumeComputationType volumeType, IOverrideParameters overrides, ILiftParameters liftParams, bool slicerToolUsed = true) { CellLiftBuilder = factory.NewCellLiftBuilder(siteModel, gridDataType, PopulationControl, filterSet, CellPassFastEventLookerUpper); CellProfileBuilder = factory.NewCellProfileBuilder(siteModel, filterSet, referenceDesignWrapper, slicerToolUsed); CellProfileAnalyzer = factory.NewCellProfileAnalyzer( profileStyle, siteModel, productionDataExistenceMap, filterSet, referenceDesignWrapper, CellLiftBuilder, volumeType, overrides, liftParams); }
public CellDatumRequestArgument_ClusterCompute( Guid siteModelID, DisplayMode mode, XYZ neeCoords, int otgCellX, int otgCellY, IFilterSet filters, DesignOffset referenceDesign, IOverrideParameters overrides, ILiftParameters liftParams) { ProjectID = siteModelID; Mode = mode; NEECoords = neeCoords; OTGCellX = otgCellX; OTGCellY = otgCellY; Filters = filters; ReferenceDesign = referenceDesign; Overrides = overrides; LiftParams = liftParams; }
/// <summary> /// Creates a new builder responsible for analyzing profile information for a cell or cells identified along a profile line /// </summary> public ICellProfileAnalyzer <T> NewCellProfileAnalyzer(ProfileStyle profileStyle, ISiteModel siteModel, ISubGridTreeBitMask pDExistenceMap, IFilterSet filterSet, IDesignWrapper referenceDesignWrapper, ICellLiftBuilder cellLiftBuilder, VolumeComputationType volumeComputationType, IOverrideParameters overrides, ILiftParameters liftParams) { switch (profileStyle) { case ProfileStyle.CellPasses: return(DIContext.Obtain <Func <ISiteModel, ISubGridTreeBitMask, IFilterSet, ICellLiftBuilder, IOverrideParameters, ILiftParameters, ICellProfileAnalyzer <T> > >() (siteModel, pDExistenceMap, filterSet, cellLiftBuilder, overrides, liftParams)); case ProfileStyle.SummaryVolume: return(DIContext.Obtain <Func <ISiteModel, ISubGridTreeBitMask, IFilterSet, IDesignWrapper, ICellLiftBuilder, VolumeComputationType, IOverrideParameters, ILiftParameters, ICellProfileAnalyzer <T> > >() (siteModel, pDExistenceMap, filterSet, referenceDesignWrapper, cellLiftBuilder, volumeComputationType, overrides, liftParams)); default: throw new ArgumentOutOfRangeException(nameof(profileStyle), profileStyle, null); } }
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); } }
/// <summary> /// Checks to see if compaction as measured by CCV/MDP or CCA has met or not the compaction metrics /// </summary> public void CheckLiftCompaction(ProfileLayer layer, IOverrideParameters overrides, GridDataType gridDataType) { // CCA tracking vars int Tolerance = 0; // How many extra passes is OK before over-compaction is set bool TargetMeet = false; int ValidCCAPasses = 0; bool IsCCV = gridDataType == GridDataType.CCV || gridDataType == GridDataType.CCVPercent; bool IsMDP = gridDataType == GridDataType.MDP || gridDataType == GridDataType.MDPPercent; bool IsCCA = gridDataType == GridDataType.CCA || gridDataType == GridDataType.CCAPercent; short ATargetCCV = overrides.OverrideMachineCCV ? overrides.OverridingMachineCCV : CellPassConsts.NullCCV; short ATargetMDP = overrides.OverrideMachineMDP ? overrides.OverridingMachineMDP : CellPassConsts.NullMDP; for (int I = layer.EndCellPassIdx; I >= layer.StartCellPassIdx; I--) { if (Passes.FilteredPassData[I].FilteredPass.CCV == CellPassConsts.NullCCV && Passes.FilteredPassData[I].FilteredPass.MDP == CellPassConsts.NullMDP && Passes.FilteredPassData[I].FilteredPass.CCA == CellPassConsts.NullCCA) { continue; } if (!FilteredPassFlags[I]) { continue; } // If gridType = icdtAll then only one type should have a non null value if (IsCCV || (gridDataType == GridDataType.All)) { if (Passes.FilteredPassData[I].FilteredPass.CCV != CellPassConsts.NullCCV) { if (!overrides.OverrideMachineCCV) { ATargetCCV = Passes.FilteredPassData[I].TargetValues.TargetCCV; } if (ATargetCCV == CellPassConsts.NullCCV) { continue; } if (Passes.FilteredPassData[I].FilteredPass.CCV < ATargetCCV * overrides.CMVRange.Min / 100) { layer.Status |= LayerStatus.Undercompacted; } else if (Passes.FilteredPassData[I].FilteredPass.CCV > ATargetCCV * overrides.CMVRange.Max / 100) { layer.Status |= LayerStatus.Overcompacted; } } } if (IsMDP || (gridDataType == GridDataType.All)) { if (Passes.FilteredPassData[I].FilteredPass.MDP != CellPassConsts.NullMDP) { if (!overrides.OverrideMachineMDP) { ATargetMDP = Passes.FilteredPassData[I].TargetValues.TargetMDP; } if (ATargetMDP == CellPassConsts.NullMDP) { continue; } if (Passes.FilteredPassData[I].FilteredPass.MDP < ATargetMDP * overrides.MDPRange.Min / 100) { layer.Status |= LayerStatus.Undercompacted; } else if (Passes.FilteredPassData[I].FilteredPass.MDP > ATargetMDP * overrides.MDPRange.Max / 100) { layer.Status |= LayerStatus.Overcompacted; } } } // For CCA it will always be for one machine we are looking at // Also compaction logic is different to above compaction types if (IsCCA || (gridDataType == GridDataType.All)) { if (Passes.FilteredPassData[I].TargetValues.TargetCCA == CellPassConsts.NullCCA) { continue; } if (Passes.FilteredPassData[I].FilteredPass.CCA != CellPassConsts.NullCCA) { ValidCCAPasses++; // Last valid CCA pass is the most important to state if ((Passes.FilteredPassData[I].FilteredPass.CCA / 2) >= Passes.FilteredPassData[I].TargetValues.TargetCCA ) // is target meet { if (TargetMeet) // has happened before { if ((ValidCCAPasses - 1) > Tolerance) { // They have done too much work layer.Status |= LayerStatus.Overcompacted; break; } } else { TargetMeet = true; // Next check to see if previous pass also meet target } } else { // Target not meet layer.Status |= TargetMeet ? LayerStatus.Complete : LayerStatus.Undercompacted; break; } } if (I == layer.StartCellPassIdx) // if no more passes to check { layer.Status |= TargetMeet ? LayerStatus.Complete : LayerStatus.Undercompacted; } continue; // Continue until satisfied checking for over-compacted or at end of layer } break; } }
private CellDatumRequestArgument_ClusterCompute CreateCellDatumRequestArgument_ClusterCompute(ISiteModel siteModel, DesignOffset referenceDesign, DisplayMode mode, IOverrideParameters overrides) { //The single cell is at world origin var coords = new XYZ(0.1, 0.1); siteModel.Grid.CalculateIndexOfCellContainingPosition(coords.X, coords.Y, out int OTGCellX, out int OTGCellY); return(new CellDatumRequestArgument_ClusterCompute { ProjectID = siteModel.ID, Filters = new FilterSet(new CombinedFilter()), Mode = mode, NEECoords = coords, OTGCellX = OTGCellX, OTGCellY = OTGCellY, ReferenceDesign = referenceDesign, Overrides = overrides }); }
private CellDatumRequestArgument_ApplicationService CreateCellDatumRequestArgument_ApplicationService(ISiteModel siteModel, DesignOffset referenceDesign, DisplayMode mode, IOverrideParameters overrides) { //The single cell is at world origin var coords = new XYZ(0.1, 0.1, 0); return(new CellDatumRequestArgument_ApplicationService { ProjectID = siteModel.ID, Filters = new FilterSet(new CombinedFilter()), Mode = mode, Point = coords, ReferenceDesign = referenceDesign, CoordsAreGrid = true, Overrides = overrides }); }
/// <summary> /// Constructor that accepts the common parameters around a set of sub grids the requester will be asked to process /// and initializes the requester state ready to start processing individual sub grid requests. /// </summary> public void Initialize(ISubGridsRequestArgument subGridsRequestArgument, ISiteModel siteModel, GridDataType gridDataType, IStorageProxy storageProxy, ICombinedFilter filter, bool hasOverrideSpatialCellRestriction, BoundingIntegerExtent2D overrideSpatialCellRestriction, int maxNumberOfPassesToReturn, AreaControlSet areaControlSet, IFilteredValuePopulationControl populationControl, ISubGridTreeBitMask pdExistenceMap, ITRexSpatialMemoryCache subGridCache, ITRexSpatialMemoryCacheContext[] subGridCacheContexts, ISurveyedSurfaces filteredSurveyedSurfaces, ISurfaceElevationPatchRequest surfaceElevationPatchRequest, IOverrideParameters overrides, ILiftParameters liftParams) { _siteModel = siteModel; _gridDataType = gridDataType; _filter = filter; _hasOverrideSpatialCellRestriction = hasOverrideSpatialCellRestriction; _overrideSpatialCellRestriction = overrideSpatialCellRestriction; _retriever = DIContext.Obtain <ISubGridRetrieverFactory>().Instance(subGridsRequestArgument, siteModel, gridDataType, storageProxy, filter, _filterAnnex, hasOverrideSpatialCellRestriction, overrideSpatialCellRestriction, maxNumberOfPassesToReturn, areaControlSet, populationControl, pdExistenceMap, subGridCacheContexts, overrides, liftParams); _returnEarliestFilteredCellPass = _filter.AttributeFilter.ReturnEarliestFilteredCellPass; _processingMap = new SubGridTreeBitmapSubGridBits(SubGridBitsCreationOptions.Unfilled); _surfaceElevationPatchRequest = surfaceElevationPatchRequest; _subGridCache = subGridCache; _subGridCacheContexts = subGridCacheContexts; _surveyedSurfacePatchType = _filter.AttributeFilter.ReturnEarliestFilteredCellPass ? SurveyedSurfacePatchType.EarliestSingleElevation : SurveyedSurfacePatchType.LatestSingleElevation; _filteredSurveyedSurfaces = filteredSurveyedSurfaces; _filteredSurveyedSurfaces?.SortChronologically(_surveyedSurfacePatchType == SurveyedSurfacePatchType.LatestSingleElevation); _filteredSurveyedSurfacesAsGuidArray = _filteredSurveyedSurfaces?.Select(x => x.ID).ToArray() ?? new Guid[0]; var elevRangeDesignFilter = _filter.AttributeFilter.ElevationRangeDesign; if (elevRangeDesignFilter.DesignID != Guid.Empty) { var design = _siteModel.Designs.Locate(elevRangeDesignFilter.DesignID); if (design == null) { _log.LogError($"ElevationRangeDesign {elevRangeDesignFilter.DesignID} is unknown in project {siteModel.ID}"); } else { _elevationRangeDesign = new DesignWrapper(elevRangeDesignFilter, design); } } if (_filter.SpatialFilter.IsDesignMask) { _surfaceDesignMaskDesign = _siteModel.Designs.Locate(_filter.SpatialFilter.SurfaceDesignMaskDesignUid); } _filter.AttributeFilter.SiteModel = _siteModel; }