using System; using System.Collections.Generic; using System.Linq; using AsbCloudApp.Data.ProcessMaps.Report; namespace AsbCloudApp.Data.WellReport; //TODO: комментарии public class DrillingBySetpointsDto { public DrillingBySetpointsDto(IEnumerable processMapReport) { if (processMapReport.All(x => x.IdWellSectionType != processMapReport.ElementAt(0).IdWellSectionType)) throw new ArgumentException("Not all entries belong to the same well section", nameof(processMapReport)); Pressure = processMapReport.Sum(x => x.DeltaDepth * x.PressureDiff.SetpointUsage / 100), AxialLoad = processMapReport.Sum(x => x.DeltaDepth * x.AxialLoad.SetpointUsage / 100), TopDriveTorque = processMapReport.Sum(x => x.DeltaDepth * x.TopDriveTorque.SetpointUsage / 100), SpeedLimit = processMapReport.Sum(x => x.DeltaDepth * x.SpeedLimit.SetpointUsage / 100) } public double? Pressure { get; set; } public double? AxialLoad { get; set; } public double? TopDriveTorque { get; set; } public double? SpeedLimit { get; set; } }