Esempio n. 1
0
        [InlineData(247680.000 + 100, 193054.000, Consts.NullDouble, 100.1)] // Outside of surface so returns NullDouble
        public async Task Test_DesignElevationSpotRequest_EmptySiteModel_SpotLookup_WithOffset(double spotX, double spotY, double expectedHeight, double offset)
        {
            AddDesignProfilerGridRouting();

            var siteModel       = DITAGFileAndSubGridRequestsWithIgniteFixture.NewEmptyModel();
            var designUid       = DITAGFileAndSubGridRequestsWithIgniteFixture.AddDesignToSiteModel(ref siteModel, TestHelper.CommonTestDataPath, "Bug36372.ttm", false);
            var referenceDesign = new DesignOffset(designUid, offset);

            var request  = new DesignElevationSpotRequest();
            var response = await request.ExecuteAsync(new CalculateDesignElevationSpotArgument
            {
                ProjectID       = siteModel.ID,
                ReferenceDesign = referenceDesign,
                SpotX           = spotX,
                SpotY           = spotY,
            });

            if (expectedHeight == Consts.NullDouble)
            {
                response.CalcResult.Should().Be(DesignProfilerRequestResult.NoElevationsInRequestedPatch);
                response.Elevation.Should().Be(Consts.NullDouble);
            }
            else
            {
                response.CalcResult.Should().Be(DesignProfilerRequestResult.OK);
                response.Elevation.Should().BeApproximately(expectedHeight + offset, 0.001);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Calculates a spot elevation designated location on this design
        /// </summary>
        public async Task <(double spotHeight, DesignProfilerRequestResult errorCode)> GetDesignSpotHeight(Guid siteModelId, double offset, double spotX, double spotY)
        {
            // Query the DesignProfiler service to get the spot elevation calculated
            var elevSpotRequest = new DesignElevationSpotRequest();

            var response = await elevSpotRequest.ExecuteAsync(new CalculateDesignElevationSpotArgument
                                                              (siteModelId, spotX, spotY, new DesignOffset(DesignDescriptor.DesignID, offset)));

            return(response.Elevation, response.CalcResult);
        }