Beispiel #1
0
        public void CPR_CellPassesRequestValidateTest()
        {
            // test that all three cell address types are not set
            CellPassesRequest cpRequest = CellPassesRequest.CreateCellPassRequest(544, null, null, null, null, 0, 0, null);

            Assert.ThrowsException <ServiceException>(() => cpRequest.Validate());
        }
Beispiel #2
0
        public async Task <CellPassesResult> CellPassesTbc([FromBody] CellPassesRequest request)
        {
            request.Validate();

            return(await RequestExecutorContainerFactory.Build <CellPassesExecutor>(
                       LoggerFactory,
                       configStore : ConfigStore,
                       trexCompactionDataProxy : TRexCompactionDataProxy,
                       fileImportProxy : FileImportProxy, customHeaders : CustomHeaders, userId : GetUserId()
                       ).ProcessAsync(request) as CellPassesResult);
        }
Beispiel #3
0
        public async Task <List <CellPassesV2Result.FilteredPassData> > CellPassesV2(
            [FromQuery] Guid projectUid,
            [FromQuery] Guid?filterUid,
            [FromQuery] double lat,
            [FromQuery] double lon)
        {
            Log.LogInformation("GetProductionDataCellsDatum: " + Request.QueryString);

            var projectId = ((RaptorPrincipal)User).GetLegacyProjectId(projectUid);
            var filter    = GetCompactionFilter(projectUid, filterUid, filterMustExist: true);

            await Task.WhenAll(projectId, filter);

            var request = new CellPassesRequest
            {
                ProjectId         = await projectId,
                ProjectUid        = projectUid,
                filter            = await filter,
                liftBuildSettings = new LiftBuildSettings
                {
                    LiftDetectionType = LiftDetectionType.None
                },
                probePositionLL = new WGSPoint(lat.LatDegreesToRadians(), lon.LonDegreesToRadians())
            };

            request.Validate();
            var result = await RequestExecutorContainerFactory.Build <CellPassesV2Executor>(LoggerFactory,
#if RAPTOR
                                                                                            RaptorClient,
#endif
                                                                                            configStore : ConfigStore, trexCompactionDataProxy : TRexCompactionDataProxy, customHeaders : CustomHeaders,
                                                                                            userId : GetUserId(), fileImportProxy : FileImportProxy)
                         .ProcessAsync(request) as CellPassesV2Result;

            if (result?.Layers == null || result?.Layers.Length == 0)
            {
                throw new ServiceException(HttpStatusCode.NoContent, new ContractExecutionResult(ContractExecutionStatesEnum.FailedToGetResults, "No layers found"));
            }

            if (result?.Layers.Length > 1)
            {
                throw new ServiceException(HttpStatusCode.BadRequest, new ContractExecutionResult(ContractExecutionStatesEnum.FailedToGetResults, "Multiple layers found"));
            }

            if (result?.Layers[0].PassData == null)
            {
                throw new ServiceException(HttpStatusCode.NoContent, new ContractExecutionResult(ContractExecutionStatesEnum.FailedToGetResults, "No cell passes found"));
            }

            // With our lift settings set to None, we should have exactly 1 layer
            return(result.Layers[0].PassData.ToList());
        }