2024-02-01 16:35:29 +05:00
|
|
|
|
using System;
|
2024-02-12 17:25:18 +05:00
|
|
|
|
using System.Collections.Generic;
|
2024-02-01 16:35:29 +05:00
|
|
|
|
using AsbCloudApp.Data;
|
2024-01-29 15:03:53 +05:00
|
|
|
|
using AsbCloudApp.Data.Trajectory;
|
|
|
|
|
using ClosedXML.Excel;
|
|
|
|
|
|
|
|
|
|
namespace AsbCloudInfrastructure.Services.Trajectory.Parser;
|
|
|
|
|
|
2024-02-08 14:50:14 +05:00
|
|
|
|
public class TrajectoryPlanParser : TrajectoryParser<TrajectoryGeoPlanDto>
|
2024-01-29 15:03:53 +05:00
|
|
|
|
{
|
2024-02-12 17:25:18 +05:00
|
|
|
|
#region Columns
|
|
|
|
|
|
|
|
|
|
private const int columnWellboreDepth = 1;
|
|
|
|
|
private const int columnZenithAngle = 2;
|
|
|
|
|
private const int columnAzimuthGeo = 3;
|
|
|
|
|
private const int columnAzimuthMagnetic = 4;
|
|
|
|
|
private const int columnVerticalDepth = 5;
|
|
|
|
|
private const int columnRadius = 6;
|
|
|
|
|
private const int columnComment = 7;
|
|
|
|
|
|
|
|
|
|
#endregion
|
2024-01-31 17:20:54 +05:00
|
|
|
|
|
2024-02-08 14:50:14 +05:00
|
|
|
|
public TrajectoryPlanParser(IServiceProvider serviceProvider)
|
2024-02-01 16:35:29 +05:00
|
|
|
|
: base(serviceProvider)
|
|
|
|
|
{
|
|
|
|
|
}
|
2024-02-12 17:25:18 +05:00
|
|
|
|
|
|
|
|
|
protected override string SheetName => "Плановая траектория";
|
|
|
|
|
|
|
|
|
|
protected override string TemplateFileName => "TrajectoryPlanTemplate.xlsx";
|
|
|
|
|
|
|
|
|
|
protected override IDictionary<string, int> PropertyColumnNumbers => new Dictionary<string, int>
|
2024-01-29 15:03:53 +05:00
|
|
|
|
{
|
2024-02-12 17:25:18 +05:00
|
|
|
|
{ nameof(TrajectoryGeoPlanDto.WellboreDepth), columnWellboreDepth },
|
|
|
|
|
{ nameof(TrajectoryGeoPlanDto.ZenithAngle), columnZenithAngle },
|
|
|
|
|
{ nameof(TrajectoryGeoPlanDto.AzimuthGeo), columnAzimuthGeo },
|
|
|
|
|
{ nameof(TrajectoryGeoPlanDto.AzimuthMagnetic), columnAzimuthMagnetic },
|
|
|
|
|
{ nameof(TrajectoryGeoPlanDto.VerticalDepth), columnVerticalDepth },
|
|
|
|
|
{ nameof(TrajectoryGeoPlanDto.Radius), columnRadius },
|
|
|
|
|
{ nameof(TrajectoryGeoPlanDto.Comment), columnComment }
|
|
|
|
|
};
|
2024-01-29 15:03:53 +05:00
|
|
|
|
|
2024-02-12 17:25:18 +05:00
|
|
|
|
protected override TrajectoryGeoPlanDto ParseRow(IXLRow row)
|
|
|
|
|
{
|
|
|
|
|
var dto = new TrajectoryGeoPlanDto
|
2024-01-29 15:03:53 +05:00
|
|
|
|
{
|
2024-02-12 17:25:18 +05:00
|
|
|
|
WellboreDepth = row.Cell(columnWellboreDepth).GetCellValue<double>(),
|
|
|
|
|
ZenithAngle = row.Cell(columnZenithAngle).GetCellValue<double>(),
|
|
|
|
|
AzimuthGeo = row.Cell(columnAzimuthGeo).GetCellValue<double>(),
|
|
|
|
|
AzimuthMagnetic = row.Cell(columnAzimuthMagnetic).GetCellValue<double>(),
|
|
|
|
|
VerticalDepth = row.Cell(columnVerticalDepth).GetCellValue<double>(),
|
|
|
|
|
Radius = row.Cell(columnRadius).GetCellValue<double>(),
|
|
|
|
|
Comment = row.Cell(columnComment).GetCellValue<string?>()
|
2024-01-29 15:03:53 +05:00
|
|
|
|
};
|
2024-02-01 16:35:29 +05:00
|
|
|
|
|
2024-02-12 17:25:18 +05:00
|
|
|
|
return dto;
|
2024-01-29 15:03:53 +05:00
|
|
|
|
}
|
|
|
|
|
}
|