From 3f2febc0225dd4e1f463e33174174ffeae5e6d2c Mon Sep 17 00:00:00 2001 From: "ai.astrakhantsev" Date: Mon, 13 Feb 2023 12:39:45 +0500 Subject: [PATCH] =?UTF-8?q?#8636739=20=D0=92=D0=B8=D0=B7=D1=83=D0=B0=D0=BB?= =?UTF-8?q?=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D1=8F=20=D1=82=D1=80=D0=B0=D0=B5?= =?UTF-8?q?=D0=BA=D1=82=D0=BE=D1=80=D0=B8=D0=B8=203D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Data/TrajectoryVisualizationDto.cs | 3 ++- AsbCloudInfrastructure/AsbCloudInfrastructure.csproj | 5 ----- .../Services/TrajectoryVisualizationService.cs | 6 +++--- AsbCloudWebApi/Controllers/PlannedTrajectoryController.cs | 4 ++++ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/AsbCloudApp/Data/TrajectoryVisualizationDto.cs b/AsbCloudApp/Data/TrajectoryVisualizationDto.cs index bc67f9c0..8c92470a 100644 --- a/AsbCloudApp/Data/TrajectoryVisualizationDto.cs +++ b/AsbCloudApp/Data/TrajectoryVisualizationDto.cs @@ -4,7 +4,8 @@ /// Визуализация траектории 3D /// public class TrajectoryVisualizationDto - {/// + { + /// /// Координаты по оси X /// public double X { get; set; } diff --git a/AsbCloudInfrastructure/AsbCloudInfrastructure.csproj b/AsbCloudInfrastructure/AsbCloudInfrastructure.csproj index 3e674968..d5ec4e0a 100644 --- a/AsbCloudInfrastructure/AsbCloudInfrastructure.csproj +++ b/AsbCloudInfrastructure/AsbCloudInfrastructure.csproj @@ -71,9 +71,4 @@ CommonLibs\AsbWitsInfo.dll - - - - - diff --git a/AsbCloudInfrastructure/Services/TrajectoryVisualizationService.cs b/AsbCloudInfrastructure/Services/TrajectoryVisualizationService.cs index 36ed5106..ee40b693 100644 --- a/AsbCloudInfrastructure/Services/TrajectoryVisualizationService.cs +++ b/AsbCloudInfrastructure/Services/TrajectoryVisualizationService.cs @@ -28,9 +28,9 @@ namespace AsbCloudInfrastructure.Services for (var i = 1; i < dtos.Length; i++) { var data = dtos[i]; - var flat = GetFlat(data.WellboreDepth, prevData.WellboreDepth, data.ZenithAngle); + var flat = GetFlat(data.WellboreDepth, prevData.WellboreDepth, prevData.ZenithAngle); var x = prevCoordinates.X = GetX(data.AzimuthGeo, flat, prevCoordinates.X); - var y = prevCoordinates.Y = GetY(data.AzimuthGeo, flat, prevCoordinates.Y); + var y = prevCoordinates.Y = GetY(data.AzimuthGeo, flat, prevCoordinates.X); var z = prevCoordinates.Z = GetZ(data.WellboreDepth, prevData.WellboreDepth, data.ZenithAngle, prevCoordinates.Z); prevData = data; @@ -51,7 +51,7 @@ namespace AsbCloudInfrastructure.Services (depthEnd - depthStart) * Math.Sin(zenit * Math.PI / 180); private double GetX(double azimuth, double flat, double prev) => - (prev + flat) * Math.Sin(azimuth * Math.PI / 180); + prev + flat * Math.Sin(azimuth * Math.PI / 180); private double GetY(double azimuth, double flat, double prev) => prev + flat * Math.Cos(azimuth * Math.PI / 180); diff --git a/AsbCloudWebApi/Controllers/PlannedTrajectoryController.cs b/AsbCloudWebApi/Controllers/PlannedTrajectoryController.cs index 258dae7a..ef50518c 100644 --- a/AsbCloudWebApi/Controllers/PlannedTrajectoryController.cs +++ b/AsbCloudWebApi/Controllers/PlannedTrajectoryController.cs @@ -242,6 +242,10 @@ namespace AsbCloudWebApi.Controllers [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] public async Task GetTrajectoryAsync(int idWell, CancellationToken token) { + if (!await CanUserAccessToWellAsync(idWell, + token).ConfigureAwait(false)) + return Forbid(); + var result = await trajectoryVisualizationService.GetTrajectoryAsync(idWell, token); return Ok(result); }