forked from ddrilling/AsbCloudServer
#8636739 Визуализация траектории 3D
This commit is contained in:
parent
7d94945c9f
commit
3f2febc022
@ -4,7 +4,8 @@
|
||||
/// Визуализация траектории 3D
|
||||
/// </summary>
|
||||
public class TrajectoryVisualizationDto
|
||||
{/// <summary>
|
||||
{
|
||||
/// <summary>
|
||||
/// Координаты по оси X
|
||||
/// </summary>
|
||||
public double X { get; set; }
|
||||
|
@ -71,9 +71,4 @@
|
||||
<HintPath>CommonLibs\AsbWitsInfo.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EditorConfigFiles Remove="D:\Source\AsbCloudInfrastructure\Repository\.editorconfig" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user