2024-02-01 16:35:29 +05:00
|
|
|
|
using System;
|
2024-02-12 17:25:18 +05:00
|
|
|
|
using System.Collections.Generic;
|
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 TrajectoryFactManualParser : TrajectoryParser<TrajectoryGeoFactDto>
|
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 columnComment = 6;
|
|
|
|
|
|
|
|
|
|
#endregion
|
2024-01-31 17:20:54 +05:00
|
|
|
|
|
2024-02-08 14:50:14 +05:00
|
|
|
|
public TrajectoryFactManualParser(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 => "TrajectoryFactManualTemplate.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(TrajectoryGeoFactDto.WellboreDepth), columnWellboreDepth },
|
|
|
|
|
{ nameof(TrajectoryGeoFactDto.ZenithAngle), columnZenithAngle },
|
|
|
|
|
{ nameof(TrajectoryGeoFactDto.AzimuthGeo), columnAzimuthGeo },
|
|
|
|
|
{ nameof(TrajectoryGeoFactDto.AzimuthMagnetic), columnAzimuthMagnetic },
|
|
|
|
|
{ nameof(TrajectoryGeoFactDto.VerticalDepth), columnVerticalDepth },
|
|
|
|
|
{ nameof(TrajectoryGeoFactDto.Comment), columnComment }
|
|
|
|
|
};
|
2024-01-29 15:03:53 +05:00
|
|
|
|
|
2024-02-12 17:25:18 +05:00
|
|
|
|
protected override TrajectoryGeoFactDto ParseRow(IXLRow row)
|
|
|
|
|
{
|
|
|
|
|
var dto = new TrajectoryGeoFactDto
|
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>(),
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
}
|