forked from ddrilling/AsbCloudServer
Merge branch 'feature/8636739' of http://test.digitaldrilling.ru:8080/DDrilling/AsbCloudServer into feature/8636739
This commit is contained in:
commit
ff6c5d7751
@ -20,18 +20,21 @@ namespace AsbCloudInfrastructure.Services
|
|||||||
|
|
||||||
public async Task<IEnumerable<TrajectoryVisualizationDto>> GetTrajectoryAsync(int idWell, CancellationToken token)
|
public async Task<IEnumerable<TrajectoryVisualizationDto>> GetTrajectoryAsync(int idWell, CancellationToken token)
|
||||||
{
|
{
|
||||||
var result = new List<TrajectoryVisualizationDto>();
|
var result = new List<TrajectoryVisualizationDto> {
|
||||||
|
new ()
|
||||||
|
};
|
||||||
var dtos = (await repository.GetAsync(idWell, token)).ToArray();
|
var dtos = (await repository.GetAsync(idWell, token)).ToArray();
|
||||||
|
|
||||||
var prevData = dtos[0];
|
var prevData = dtos[0];
|
||||||
var prevCoordinates = new TrajectoryVisualizationDto();
|
var prevCoordinates = new TrajectoryVisualizationDto();
|
||||||
|
|
||||||
for (var i = 1; i < dtos.Length; i++)
|
for (var i = 1; i < dtos.Length; i++)
|
||||||
{
|
{
|
||||||
var data = dtos[i];
|
var data = dtos[i];
|
||||||
var flat = GetFlat(data.WellboreDepth, prevData.WellboreDepth, prevData.ZenithAngle);
|
var flat = GetFlat(data.WellboreDepth, prevData.WellboreDepth, prevData.ZenithAngle);
|
||||||
var x = prevCoordinates.X = GetX(data.AzimuthGeo, flat, prevCoordinates.X);
|
var x = prevCoordinates.X = GetX(prevData.AzimuthGeo, flat, prevCoordinates.X);
|
||||||
var y = prevCoordinates.Y = GetY(data.AzimuthGeo, flat, prevCoordinates.X);
|
var y = prevCoordinates.Y = GetY(prevData.AzimuthGeo, flat, prevCoordinates.X);
|
||||||
var z = prevCoordinates.Z = GetZ(data.WellboreDepth, prevData.WellboreDepth, data.ZenithAngle, prevCoordinates.Z);
|
var z = prevCoordinates.Z = GetZ(data.WellboreDepth, prevData.WellboreDepth, prevData.ZenithAngle, prevCoordinates.Z);
|
||||||
prevData = data;
|
prevData = data;
|
||||||
|
|
||||||
var coordinates = new TrajectoryVisualizationDto
|
var coordinates = new TrajectoryVisualizationDto
|
||||||
@ -57,6 +60,6 @@ namespace AsbCloudInfrastructure.Services
|
|||||||
prev + flat * Math.Cos(azimuth * Math.PI / 180);
|
prev + flat * Math.Cos(azimuth * Math.PI / 180);
|
||||||
|
|
||||||
private double GetZ(double depthEnd, double depthStart, double zenit, double prev) =>
|
private double GetZ(double depthEnd, double depthStart, double zenit, double prev) =>
|
||||||
prev - (depthEnd - depthStart) * Math.Cos(zenit * Math.PI / 180);
|
prev + (depthEnd - depthStart) * Math.Cos(zenit * Math.PI / 180);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user