/// <summary> /// Create and configure the segment iterator to be used /// </summary> /// <param name="passFilter"></param> private void SetupForCellPassStackExamination(ICellPassAttributeFilter passFilter) { SegmentIterator = new SubGridSegmentIterator(null, null, SiteModel.PrimaryStorageProxy); if (passFilter.ReturnEarliestFilteredCellPass || (passFilter.HasElevationTypeFilter && passFilter.ElevationType == ElevationType.First)) { SegmentIterator.IterationDirection = IterationDirection.Forwards; } else { SegmentIterator.IterationDirection = IterationDirection.Backwards; } if (passFilter.HasMachineFilter) { if (passFilter.SiteModel == null) { passFilter.SiteModel = SiteModel; } SegmentIterator.SetMachineRestriction(passFilter.GetMachineIDsSet()); } // Create and configure the cell pass iterator to be used CellPassIterator = new SubGridSegmentCellPassIterator_NonStatic { SegmentIterator = SegmentIterator }; CellPassIterator.SetTimeRange(passFilter.HasTimeFilter, passFilter.StartTime, passFilter.EndTime); }
public void InitializeFilteringForCell(ICellPassAttributeFilter attributeFilter, byte subGridCellX, byte subGridCellY) { if (!attributeFilter.HasElevationRangeFilter) { return; } if (ElevationRangeDesignElevations != null) { // ReSharper disable once CompareOfFloatsByEqualityOperator if (ElevationRangeDesignElevations[subGridCellX, subGridCellY] == Consts.NullHeight) { ElevationRangeTopElevationForCell = Consts.NullDouble; ElevationRangeBottomElevationForCell = Consts.NullDouble; return; } ElevationRangeTopElevationForCell = ElevationRangeDesignElevations[subGridCellX, subGridCellY] + attributeFilter.ElevationRangeOffset; } else { ElevationRangeTopElevationForCell = attributeFilter.ElevationRangeLevel + attributeFilter.ElevationRangeOffset; } ElevationRangeBottomElevationForCell = ElevationRangeTopElevationForCell - attributeFilter.ElevationRangeThickness; }
InitialiseFilterContext(ISiteModel siteModel, ICellPassAttributeFilter passFilter, ICellPassAttributeFilterProcessingAnnex passFilterAnnex, ProfileCell profileCell, IDesignWrapper passFilterElevRangeDesign) { (bool executionResult, DesignProfilerRequestResult filterDesignErrorCode)result = (false, DesignProfilerRequestResult.UnknownError); // If the elevation range filter uses a design then the design elevations // for the sub grid need to be calculated and supplied to the filter if (passFilter.HasElevationRangeFilter && passFilterElevRangeDesign != null) { var getDesignHeightsResult = passFilterElevRangeDesign.Design.GetDesignHeightsViaLocalCompute(siteModel, passFilterElevRangeDesign.Offset, new SubGridCellAddress(profileCell.OTGCellX, profileCell.OTGCellY), siteModel.CellSize); result.filterDesignErrorCode = getDesignHeightsResult.errorCode; if (result.filterDesignErrorCode != DesignProfilerRequestResult.OK || getDesignHeightsResult.designHeights == null) { if (result.filterDesignErrorCode == DesignProfilerRequestResult.NoElevationsInRequestedPatch) { _log.LogInformation( "Lift filter by design. Call to RequestDesignElevationPatch failed due to no elevations in requested patch."); } else { _log.LogWarning( $"Lift filter by design. Call to RequestDesignElevationPatch failed due to no TDesignProfilerRequestResult return code {result.filterDesignErrorCode}."); } return(result); } passFilterAnnex.InitializeElevationRangeFilter(passFilter, getDesignHeightsResult.designHeights.Cells); } result.executionResult = true; return(result); }
/// <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> /// Computes the CCA palette for the specified machine /// </summary> public static IPlanViewPalette ComputeCCAPalette(ISiteModel siteModel, ICellPassAttributeFilter filter, DisplayMode mode) { var machineUid = filter.MachinesList.Length > 0 ? filter.MachinesList[0] : Guid.Empty; var ccaMinimumPassesValue = siteModel.GetCCAMinimumPassesValue(machineUid, filter.StartTime, filter.EndTime, filter.LayerID); if (ccaMinimumPassesValue == 0) { return(null); } var ccaColorScale = CCAColorScaleManager.CreateCoverageScale(ccaMinimumPassesValue); var transitions = new Transition[ccaColorScale.TotalColors]; for (var i = 0; i < transitions.Length; i++) { transitions[i] = new Transition(i + 1, ColorUtility.UIntToColor(ccaColorScale.ColorSegments[transitions.Length - i - 1].Color)); } if (mode == DisplayMode.CCA) { return(new CCAPalette { PaletteTransitions = transitions }); } return(new CCASummaryPalette { UndercompactedColour = transitions[0].Color, CompactedColour = transitions[1].Color, OvercompactedColour = transitions[2].Color }); }
/// <summary> /// Prepares the set of event population control flags depending on the requested data type and filter /// </summary> /// <param name="profileTypeRequired"></param> /// <param name="passFilter"></param> public void PreparePopulationControl(GridDataType profileTypeRequired, ILiftParameters liftParams, ICellPassAttributeFilter passFilter) { CalculateFlags(profileTypeRequired, liftParams, out bool compactionSummaryInLiftBuildSettings, out bool workInProgressSummaryInLiftBuildSettings, out bool thicknessInProgressInLiftBuildSettings); Clear(); WantsTargetPassCountValues = profileTypeRequired == GridDataType.All; WantsTempWarningLevelMinValues = profileTypeRequired == GridDataType.All; WantsTempWarningLevelMaxValues = profileTypeRequired == GridDataType.All; WantsEventMachineGearValues = passFilter.HasMachineDirectionFilter; WantsEventMapResetValues = liftParams.LiftDetectionType == LiftDetectionType.MapReset || liftParams.LiftDetectionType == LiftDetectionType.AutoMapReset; WantsEventDesignNameValues = passFilter.HasDesignFilter || WantsEventMapResetValues; WantsTargetCCVValues = compactionSummaryInLiftBuildSettings || workInProgressSummaryInLiftBuildSettings; WantsTargetMDPValues = compactionSummaryInLiftBuildSettings || workInProgressSummaryInLiftBuildSettings; WantsTargetCCAValues = compactionSummaryInLiftBuildSettings || workInProgressSummaryInLiftBuildSettings; WantsTargetLiftThicknessValues = workInProgressSummaryInLiftBuildSettings || thicknessInProgressInLiftBuildSettings || liftParams.LiftDetectionType == LiftDetectionType.Automatic || liftParams.LiftDetectionType == LiftDetectionType.AutoMapReset; WantsEventVibrationStateValues = passFilter.HasVibeStateFilter || (profileTypeRequired == GridDataType.All || profileTypeRequired == GridDataType.CCV || profileTypeRequired == GridDataType.CCVPercent || profileTypeRequired == GridDataType.RMV || profileTypeRequired == GridDataType.Frequency || profileTypeRequired == GridDataType.Amplitude); WantsEventElevationMappingModeValues = passFilter.HasElevationMappingModeFilter; WantsEventInAvoidZoneStateValues = false; // todo passFilter.HasAvoidZoneStateFilter; WantsEventGPSAccuracyValues = passFilter.HasGPSAccuracyFilter || passFilter.HasGPSToleranceFilter; WantsEventPositioningTechValues = passFilter.HasPositioningTechFilter; WantsEventMachineAutomaticsValues = passFilter.HasGCSGuidanceModeFilter; WantsLayerIDValues = profileTypeRequired == GridDataType.CellProfile || profileTypeRequired == GridDataType.CellPasses || passFilter.HasLayerIDFilter || liftParams.LiftDetectionType == LiftDetectionType.Tagfile || liftParams.LiftDetectionType == LiftDetectionType.MapReset || liftParams.LiftDetectionType == LiftDetectionType.AutoMapReset; }
public void InitializeElevationRangeFilter(ICellPassAttributeFilter attributeFilter, float[,] designElevations) { // If there is a design specified then initialize the filter using the design elevations // queried and supplied by the caller, otherwise the specified Elevation level, offset and thickness // are used to calculate an elevation bracket. var elevationRangeIsLevelAndThicknessOnly = designElevations == null; if (elevationRangeIsLevelAndThicknessOnly) { ElevationRangeTopElevationForCell = attributeFilter.ElevationRangeLevel + attributeFilter.ElevationRangeOffset; ElevationRangeBottomElevationForCell = ElevationRangeTopElevationForCell - attributeFilter.ElevationRangeThickness; } else { ElevationRangeDesignElevations = designElevations; } ElevationRangeIsInitialized = true; }
/// <summary> /// Constructor accepting attribute and spatial filters /// </summary> public CombinedFilter(ICellPassAttributeFilter attributeFilter, ICellSpatialFilter spatialFilter) { AttributeFilter = attributeFilter; SpatialFilter = spatialFilter; }