forked from ddrilling/AsbCloudServer
41 lines
1.5 KiB
C#
41 lines
1.5 KiB
C#
|
using AsbCloudApp.Data.Trajectory;
|
|||
|
using ClosedXML.Excel;
|
|||
|
|
|||
|
namespace AsbCloudInfrastructure.Services.Trajectory.Import
|
|||
|
{
|
|||
|
|
|||
|
public class TrajectoryPlannedParserService : TrajectoryParserService<TrajectoryGeoPlanDto>
|
|||
|
{
|
|||
|
/*
|
|||
|
* password for PlannedTrajectoryTemplate.xlsx is Drill2022
|
|||
|
*/
|
|||
|
public override string templateFileName { get; } = "TrajectoryPlannedTemplate.xlsx";
|
|||
|
public override string usingTemplateFile { get; } = "AsbCloudInfrastructure.Services.Trajectory.Templates";
|
|||
|
public override string sheetNameTrajectory { get; } = "Плановая траектория";
|
|||
|
public override int headerRowsCount { get; } = 2;
|
|||
|
|
|||
|
public TrajectoryPlannedParserService() : base()
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
protected override TrajectoryGeoPlanDto ParseRow(IXLRow row)
|
|||
|
{
|
|||
|
var trajectoryRow = new TrajectoryGeoPlanDto
|
|||
|
{
|
|||
|
WellboreDepth = row.Cell(1).GetCellValue<double>(),
|
|||
|
ZenithAngle = row.Cell(2).GetCellValue<double>(),
|
|||
|
AzimuthGeo = row.Cell(3).GetCellValue<double>(),
|
|||
|
AzimuthMagnetic = row.Cell(4).GetCellValue<double>(),
|
|||
|
VerticalDepth = row.Cell(5).GetCellValue<double>(),
|
|||
|
Radius = row.Cell(6).GetCellValue<double>(),
|
|||
|
Comment = row.Cell(7).GetCellValue<string?>()
|
|||
|
};
|
|||
|
|
|||
|
//TODO: Добавить валидацию модели IValidatableObject
|
|||
|
return trajectoryRow;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
|