#8636739 Визуализация траектории 3D

This commit is contained in:
ai.astrakhantsev 2023-02-13 12:39:45 +05:00
parent 7d94945c9f
commit 3f2febc022
4 changed files with 9 additions and 9 deletions

View File

@ -4,7 +4,8 @@
/// Визуализация траектории 3D
/// </summary>
public class TrajectoryVisualizationDto
{/// <summary>
{
/// <summary>
/// Координаты по оси X
/// </summary>
public double X { get; set; }

View File

@ -71,9 +71,4 @@
<HintPath>CommonLibs\AsbWitsInfo.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<EditorConfigFiles Remove="D:\Source\AsbCloudInfrastructure\Repository\.editorconfig" />
</ItemGroup>
</Project>

View File

@ -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);

View File

@ -242,6 +242,10 @@ namespace AsbCloudWebApi.Controllers
[ProducesResponseType(typeof(IEnumerable<TrajectoryVisualizationDto>), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetTrajectoryAsync(int idWell, CancellationToken token)
{
if (!await CanUserAccessToWellAsync(idWell,
token).ConfigureAwait(false))
return Forbid();
var result = await trajectoryVisualizationService.GetTrajectoryAsync(idWell, token);
return Ok(result);
}