/// <summary> /// Returns a MapWindow.Interfaces.Types.GridDataType that corresponds to a MapWinGIs.GridDataType /// </summary> /// <param name="MapWinGIS_GridDataType">A MapWinGIS.GridDataType</param> /// <returns>A MapWindow.Interfaces.Types.GridDataType</returns> public static GridDataType GetGridDataType(MapWinGIS.GridDataType MapWinGIS_GridDataType) { GridDataType retVal = GridDataType.UNKNOWN_TYPE; switch (MapWinGIS_GridDataType) { case MapWinGIS.GridDataType.DoubleDataType: retVal = GridDataType.DOUBLE_TYPE; break; case MapWinGIS.GridDataType.FloatDataType: retVal = GridDataType.FLOAT_TYPE; break; case MapWinGIS.GridDataType.InvalidDataType: retVal = GridDataType.INVALID_DATA_TYPE; break; case MapWinGIS.GridDataType.LongDataType: retVal = GridDataType.LONG_TYPE; break; case MapWinGIS.GridDataType.ShortDataType: retVal = GridDataType.SHORT_TYPE; break; case MapWinGIS.GridDataType.UnknownDataType: retVal = GridDataType.UNKNOWN_TYPE; break; } return(retVal); }
public void Test_GenericClientLeafSubgrid_CellHasValue_True_Ex(GridDataType gridDataType) { var clientGrid = ClientLeafSubGridFactoryFactory.CreateClientSubGridFactory().GetSubGrid(gridDataType); clientGrid.FillWithTestPattern(); clientGrid.ForEach((x, y) => Assert.True(clientGrid.CellHasValue(x, y), "Cell does not have value when it should")); }
/// <summary> /// Constructor /// </summary> public SubGridRequestsBase(ITRexTask tRexTask, Guid siteModelID, Guid requestID, Guid trexNodeId, GridDataType requestedGridDataType, bool includeSurveyedSurfaceInformation, ISubGridTreeBitMask prodDataMask, ISubGridTreeBitMask surveyedSurfaceOnlyMask, IFilterSet filters, DesignOffset referenceDesign, AreaControlSet areaControlSet, Action <TSubGridsRequestArgument> customArgumentInitializer, SubGridsRequestComputeStyle subGridsRequestComputeStyle) : this() { TRexTask = tRexTask; SiteModelID = siteModelID; RequestID = requestID; TRexNodeId = trexNodeId; RequestedGridDataType = requestedGridDataType; IncludeSurveyedSurfaceInformation = includeSurveyedSurfaceInformation; ProdDataMask = prodDataMask; SurveyedSurfaceOnlyMask = surveyedSurfaceOnlyMask; Filters = filters; ReferenceDesign = referenceDesign; AreaControlSet = areaControlSet; CustomArgumentInitializer = customArgumentInitializer; SubGridsRequestComputeStyle = SubGridsRequestComputeStyle; }
/// <summary> /// Converts a new MapWindow.Interfaces.Types.GridDataType to an older MapWinGIS.GridDataType format /// </summary> /// <param name="Types_GridDataType">A Mapwindow.Interfaces.Types.GridDataType</param> /// <returns>A MapWinGIS.GridDataType</returns> public static MapWinGIS.GridDataType mwGridDataType(GridDataType Types_GridDataType) { MapWinGIS.GridDataType retVal = MapWinGIS.GridDataType.UnknownDataType; switch (Types_GridDataType) { case GridDataType.DOUBLE_TYPE: retVal = MapWinGIS.GridDataType.DoubleDataType; break; case GridDataType.FLOAT_TYPE: retVal = MapWinGIS.GridDataType.FloatDataType; break; case GridDataType.INVALID_DATA_TYPE: retVal = MapWinGIS.GridDataType.InvalidDataType; break; case GridDataType.LONG_TYPE: retVal = MapWinGIS.GridDataType.LongDataType; break; case GridDataType.SHORT_TYPE: retVal = MapWinGIS.GridDataType.ShortDataType; break; case GridDataType.UNKNOWN_TYPE: retVal = MapWinGIS.GridDataType.UnknownDataType; break; } return(retVal); }
/// <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> /// Calculates the a set of lift build setting flags from the required data type and other lift build settings /// </summary> public static void CalculateFlags(GridDataType ProfileTypeRequired, ILiftParameters liftParams, out bool compactionSummaryInLiftBuildSettings, out bool workInProgressSummaryInLiftBuildSettings, out bool thicknessInProgressInLiftBuildSettings) { if (ProfileTypeRequired == GridDataType.All || ProfileTypeRequired == GridDataType.CCV || ProfileTypeRequired == GridDataType.CCVPercent) { compactionSummaryInLiftBuildSettings = liftParams.CCVSummaryTypes != CCVSummaryTypes.None; workInProgressSummaryInLiftBuildSettings = compactionSummaryInLiftBuildSettings; thicknessInProgressInLiftBuildSettings = compactionSummaryInLiftBuildSettings; } else if (ProfileTypeRequired == GridDataType.All || ProfileTypeRequired == GridDataType.MDP || ProfileTypeRequired == GridDataType.MDPPercent) { compactionSummaryInLiftBuildSettings = liftParams.MDPSummaryTypes != MDPSummaryTypes.None; workInProgressSummaryInLiftBuildSettings = compactionSummaryInLiftBuildSettings; thicknessInProgressInLiftBuildSettings = compactionSummaryInLiftBuildSettings; } if (ProfileTypeRequired == GridDataType.All || ProfileTypeRequired == GridDataType.CCA || ProfileTypeRequired == GridDataType.CCAPercent) { compactionSummaryInLiftBuildSettings = true; workInProgressSummaryInLiftBuildSettings = compactionSummaryInLiftBuildSettings; thicknessInProgressInLiftBuildSettings = compactionSummaryInLiftBuildSettings; } else { compactionSummaryInLiftBuildSettings = false; workInProgressSummaryInLiftBuildSettings = false; thicknessInProgressInLiftBuildSettings = false; } }
/// <summary> /// Constructs the context of a pipelined processor based on the project, filters and other common criteria /// of pipelined requests /// </summary> /// <param name="overrideSpatialCellRestriction">A restriction on the cells that are returned via the query that intersects with the spatial selection filtering and criteria</param> public IPipelineProcessor NewInstance <TSubGridsRequestArgument>(Guid requestDescriptor, Guid dataModelID, GridDataType gridDataType, ISubGridsPipelinedReponseBase response, IFilterSet filters, DesignOffset cutFillDesign, ITRexTask task, ISubGridPipelineBase pipeline, IRequestAnalyser requestAnalyser, bool requireSurveyedSurfaceInformation, bool requestRequiresAccessToDesignFileExistenceMap, BoundingIntegerExtent2D overrideSpatialCellRestriction, ILiftParameters liftParams) { var pipelineProcessor = NewInstanceNoBuild <TSubGridsRequestArgument> (requestDescriptor, dataModelID, gridDataType, response, filters, cutFillDesign, task, pipeline, requestAnalyser, requireSurveyedSurfaceInformation, requestRequiresAccessToDesignFileExistenceMap, overrideSpatialCellRestriction, liftParams); if (!pipelineProcessor.Build()) { Log.LogError($"Failed to build pipeline processor for request to model {dataModelID}"); pipelineProcessor = null; } return(pipelineProcessor as IPipelineProcessor); }
/// <summary> /// Constructs the context of a pipelined processor based on the project, filters and other common criteria /// of pipelined requests /// </summary> /// <param name="requestDescriptor"></param> /// <param name="dataModelID"></param> /// <param name="gridDataType"></param> /// <param name="response"></param> /// <param name="filters"></param> /// <param name="cutFillDesign"></param> /// <param name="task"></param> /// <param name="pipeline"></param> /// <param name="requestAnalyser"></param> /// <param name="requireSurveyedSurfaceInformation"></param> /// <param name="requestRequiresAccessToDesignFileExistenceMap"></param> /// <param name="overrideSpatialCellRestriction">A restriction on the cells that are returned via the query that intersects with the spatial selection filtering and criteria</param> /// <param name="liftParams"></param> public PipelineProcessor(Guid requestDescriptor, Guid dataModelID, GridDataType gridDataType, ISubGridsPipelinedReponseBase response, IFilterSet filters, DesignOffset cutFillDesign, ITRexTask task, ISubGridPipelineBase pipeline, IRequestAnalyser requestAnalyser, bool requireSurveyedSurfaceInformation, bool requestRequiresAccessToDesignFileExistenceMap, BoundingIntegerExtent2D overrideSpatialCellRestriction, ILiftParameters liftParams) { RequestDescriptor = requestDescriptor; DataModelID = dataModelID; GridDataType = gridDataType; Response = response; Filters = filters; CutFillDesign = cutFillDesign; Task = task; Pipeline = pipeline; RequestAnalyser = requestAnalyser; RequireSurveyedSurfaceInformation = requireSurveyedSurfaceInformation; RequestRequiresAccessToDesignFileExistenceMap = requestRequiresAccessToDesignFileExistenceMap; OverrideSpatialCellRestriction = overrideSpatialCellRestriction; LiftParams = liftParams; }
/// <summary> /// Creates a new builder responsible for processing cell pass, layer and other information for single cells in a profile /// </summary> public ICellLiftBuilder NewCellLiftBuilder(ISiteModel siteModel, GridDataType gridDataType, IFilteredValuePopulationControl populationControl, IFilterSet filterSet, ICellPassFastEventLookerUpper cellPassFastEventLookerUpper) { return(new CellLiftBuilder(siteModel, gridDataType, populationControl, filterSet, cellPassFastEventLookerUpper)); }
public void SetDataPixel(int x, int y, GridDataType pixelType, ChromaColor color) { if (x < 0 || y < 0 || x >= Width || y >= Height) { throw new IndexOutOfRangeException("x or y coordinates out of range!"); } grid[y, x + 1] = color; gameGrid[y, x] = pixelType; }
public void Test_GenericClientLeafSubgrid_ForEach_Ex(GridDataType gridDataType) { var clientGrid = ClientLeafSubGridFactoryFactory.CreateClientSubGridFactory().GetSubGrid(gridDataType); int Count = 0; clientGrid.ForEach((x, y) => Count++); Assert.True(SubGridTreeConsts.SubGridTreeCellsPerSubGrid == Count, "ForEach did not iterate all cells"); }
/// <summary> /// Register a type implementing IClientLeafSubGrid against a grid data type for the factory to /// create on demand /// </summary> public void RegisterClientLeafSubGridType(GridDataType gridDataType, Func <IClientLeafSubGrid> constructor) { if ((int)gridDataType > _typeMap.Length) { throw new ArgumentException("Unknown grid data type in RegisterClientLeafSubGridType", nameof(gridDataType)); } _typeMap[(int)gridDataType] = constructor; }
public void Test_GenericClientLeafSubgrid_Read_FailWithCorruptData(GridDataType gridDataType) { var clientGrid = ClientLeafSubGridFactoryFactory.CreateClientSubGridFactory().GetSubGrid(gridDataType); byte[] bytes = new byte[100]; // 100 zeros, which will cause the FromBytes call to fail with a TRexSubGridIOException on the grid data type Action act = () => clientGrid.FromBytes(bytes); act.Should().Throw <TRexSubGridIOException>().WithMessage("GridDataType in stream does not match GridDataType of local sub grid instance"); }
public void Resolve_ValueIsEnum_ValueInQuoteInLowerCase() { string key = "valueIsEnum"; GridDataType value = GridDataType.XmlString; KeyValuePair <string, object> x = new KeyValuePair <string, object>(key, value); string expected = string.Format("{0}: 'xmlstring'", key); string actual = PropertyResolver.Resolve(x); Assert.AreEqual(expected, actual); }
public void Resolve_ValueIsEnumArray_ListOfValuesInQuoteInLowerCase() { string key = "enumArray"; GridDataType[] value = new GridDataType[] { GridDataType.Json, GridDataType.Xml }; KeyValuePair <string, object> x = new KeyValuePair <string, object>(key, value); string expected = string.Format("{0}: ['json', 'xml']", key); string actual = PropertyResolver.Resolve(x); Assert.AreEqual(expected, actual); }
/// <summary> /// Determine the type of intermediary data to be assembled to provide the correct response to the request /// </summary> public static GridDataType IntermediaryICGridDataTypeForDataType(GridDataType dataType, bool includeSurveyedSurfacesInResult) { return(dataType switch { GridDataType.Height => includeSurveyedSurfacesInResult ? GridDataType.HeightAndTime : GridDataType.Height, // SimpleVolumeOverlay not supported yet in TRex // GridDataType.SimpleVolumeOverlay => IncludeSurveyedSurfacesInResult ? GridDataType.HeightAndTime : GridDataType.Height; GridDataType.CutFill => includeSurveyedSurfacesInResult ? GridDataType.HeightAndTime : GridDataType.Height, _ => dataType });
/// <summary> /// Construct a concrete instance of a sub grid implementing the IClientLeafSubGrid interface based /// on the role it should play according to the grid data type requested. All aspects of leaf ownership /// by a sub grid tree, parentage, level, cell size, index origin offset are delegated responsibilities /// of the caller or a derived factory class /// </summary> /// <returns>An appropriate instance derived from ClientLeafSubGrid</returns> public IClientLeafSubGrid GetSubGridEx(GridDataType gridDataType, double cellSize, byte level, int originX, int originY) { var result = GetSubGrid(gridDataType); if (result != null) { result.CellSize = cellSize; result.SetAbsoluteLevel(level); result.SetAbsoluteOriginPosition(originX, originY); } return(result); }
public void Test_GenericClientLeafSubgrid_Creation_EX(GridDataType gridDataType, bool expected) { var clientGrid = ClientLeafSubGridFactoryFactory.CreateClientSubGridFactory().GetSubGrid(gridDataType); if (expected) { Assert.NotNull(clientGrid); } else { Assert.Null(clientGrid); } }
/// <summary> /// Constructor the the base client sub grid. This decorates the standard (owner, parent, level) /// constructor from the base with the cell size and index origin offset parameters from the sub grid tree /// this leaf is derived from. /// </summary> protected ClientLeafSubGrid(ISubGridTree owner, ISubGrid parent, byte level, double cellSize, int indexOriginOffset) : base(owner, parent, level) { CellSize = cellSize; IndexOriginOffset = indexOriginOffset; _gridDataType = GridDataType.All; // Default to 'all', descendant specialized classes will set appropriately TopLayerOnly = false; ProfileDisplayMode = DisplayMode.Height; }
public void Test_GenericClientLeafSubgrid_ReadWrite_Ex(GridDataType gridDataType) { var clientGrid = ClientLeafSubGridFactoryFactory.CreateClientSubGridFactory().GetSubGrid(gridDataType); clientGrid.FillWithTestPattern(); byte[] bytes = clientGrid.ToBytes(); Assert.True(bytes.Length > 0); var clientGrid2 = ClientLeafSubGridFactoryFactory.CreateClientSubGridFactory().GetSubGrid(gridDataType); clientGrid2.FromBytes(bytes); Assert.True(clientGrid.LeafContentEquals(clientGrid2), "Client grids not equal after read/write serialisation"); }
public void Test_GenericClientLeafSubgrid_Clear_Ex(GridDataType gridDataType) { var clientGrid = ClientLeafSubGridFactoryFactory.CreateClientSubGridFactory().GetSubGrid(gridDataType); clientGrid.FillWithTestPattern(); clientGrid.Clear(); clientGrid.ForEach((x, y) => { if (gridDataType != GridDataType.CCVPercentChange && gridDataType != GridDataType.ProgressiveVolumes) { Assert.True(!clientGrid.CellHasValue(x, y), "Clear() did not clear all cells"); } }); }
/// <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> /// 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 OpenTest() { SuperGrid target = new SuperGrid(); // TODO: Initialize to an appropriate value string Filename = string.Empty; // TODO: Initialize to an appropriate value GridDataType DataType = new GridDataType(); // TODO: Initialize to an appropriate value bool InRam = false; // TODO: Initialize to an appropriate value GridFileType FileType = new GridFileType(); // TODO: Initialize to an appropriate value ICallback cBack = null; // TODO: Initialize to an appropriate value bool expected = false; // TODO: Initialize to an appropriate value bool actual; actual = target.Open(Filename, DataType, InRam, FileType, cBack); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }
public void Test_GenericClientLeafSubgrid_CellHasValue_False_Ex(GridDataType gridDataType) { var clientGrid = ClientLeafSubGridFactoryFactory.CreateClientSubGridFactory().GetSubGrid(gridDataType); clientGrid.ForEach((x, y) => { if (gridDataType != GridDataType.CCVPercentChange && gridDataType != GridDataType.ProgressiveVolumes) { Assert.False(clientGrid.CellHasValue(x, y), "Cell does have value when it should not"); } else { Assert.True(clientGrid.CellHasValue(x, y), "Cell does not have value when it should"); } }); }
/// <summary> /// Construct a concrete instance of a sub grid implementing the IClientLeafSubGrid interface based /// on the role it should play according to the grid data type requested. All aspects of leaf ownership /// by a sub grid tree, parentage, level, cell size, index origin offset are delegated responsibilities /// of the caller or a derived factory class /// </summary> /// <returns>An appropriate instance derived from ClientLeafSubGrid</returns> public IClientLeafSubGrid GetSubGrid(GridDataType gridDataType) { IClientLeafSubGrid result = null; //* TODO: Don't use repatriated sub grids for now... // if (!ClientLeaves[(int) gridDataType].TryTake(out IClientLeafSubGrid result)) // { if (_typeMap[(int)gridDataType] != null) { result = _typeMap[(int)gridDataType](); } // } result?.Clear(); return(result); }
public void SetDataPixel(int x, int y, GridDataType pixelType) { ChromaColor c = ChromaColor.Black; switch (pixelType) { case GridDataType.WALL: c = ChromaColor.Green; break; case GridDataType.EMPTY: c = ChromaColor.Black; break; } SetDataPixel(x, y, pixelType, c); }
/// <summary> /// Constructs a string representing the fingerprint of a request required spatial data. The fingerprint is designed to identify a context within /// which cached general sub grid results may be stored and accessed during query processing. /// </summary> /// <param name="projectUid">The Guid identifying the project within the fingerprint</param> /// <param name="gridDataType">The type of data being requested in the query</param> /// <param name="filter">The set of filters that govern the query</param> /// <param name="includedSurveyedSurfaces">The list of surveyed surfaces included in the query, expressed as a an array of GUIDs</param> /// <returns>A string representing the uniqueness of this spatial cache element</returns> public static string ConstructFingerprint(Guid projectUid, GridDataType gridDataType, ICombinedFilter filter, Guid[] includedSurveyedSurfaces) { var sb = new StringBuilder(); sb.Append(projectUid).Append('-').Append(gridDataType); if (filter != null) { sb.Append('-').Append(filter.AttributeFilter.SpatialCacheFingerprint()); } if (includedSurveyedSurfaces.Length > 0) { includedSurveyedSurfaces.ForEach(x => sb.Append(x)); } return(sb.ToString()); }
/// <summary> /// Which grid data types have implementations that should be tested? /// </summary> /// <param name="gridDataType"></param> /// <returns></returns> private static bool Include(GridDataType gridDataType) { return(gridDataType == GridDataType.Height || gridDataType == GridDataType.HeightAndTime || gridDataType == GridDataType.CompositeHeights || gridDataType == GridDataType.CCV || gridDataType == GridDataType.CCVPercentChange || gridDataType == GridDataType.CCVPercentChangeIgnoredTopNullValue || gridDataType == GridDataType.MDP || gridDataType == GridDataType.MachineSpeed || gridDataType == GridDataType.MachineSpeedTarget || gridDataType == GridDataType.Temperature || gridDataType == GridDataType.PassCount || gridDataType == GridDataType.CellProfile || gridDataType == GridDataType.CellPasses || gridDataType == GridDataType.CCA || gridDataType == GridDataType.CutFill || gridDataType == GridDataType.ProgressiveVolumes); }
/// <summary> /// Constructs the context of a pipelined processor based on the project, filters and other common criteria /// of pipelined requests, but does not perform the build action on the pipeline processor /// </summary> /// <param name="overrideSpatialCellRestriction">A restriction on the cells that are returned via the query that intersects with the spatial selection filtering and criteria</param> public IPipelineProcessor NewInstanceNoBuild <TSubGridsRequestArgument>(Guid requestDescriptor, Guid dataModelID, GridDataType gridDataType, ISubGridsPipelinedReponseBase response, IFilterSet filters, DesignOffset cutFillDesign, ITRexTask task, ISubGridPipelineBase pipeline, IRequestAnalyser requestAnalyser, bool requireSurveyedSurfaceInformation, bool requestRequiresAccessToDesignFileExistenceMap, BoundingIntegerExtent2D overrideSpatialCellRestriction, ILiftParameters liftParams) { return(new PipelineProcessor <TSubGridsRequestArgument> (requestDescriptor, dataModelID, gridDataType, response, filters, cutFillDesign, task, pipeline, requestAnalyser, requireSurveyedSurfaceInformation, requestRequiresAccessToDesignFileExistenceMap, overrideSpatialCellRestriction, liftParams) as IPipelineProcessor); }
/// <summary> /// Defines in what format to expect the data that fills the grid /// </summary> public GridSettings SetDataType(GridDataType dataType) { properties.Add("datatype", dataType.ToString().ToLower()); return this; }
public void Resolve_ValueIsEnumArray_ListOfValuesInQuoteInLowerCase() { string key = "enumArray"; GridDataType[] value = new GridDataType[] { GridDataType.Json, GridDataType.Xml }; KeyValuePair<string, object> x = new KeyValuePair<string, object>(key, value); string expected = string.Format("{0}: ['json', 'xml']", key); string actual = PropertyResolver.Resolve(x); Assert.AreEqual(expected, actual); }