using System.Linq; namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors { internal class OperationDrilling : OperationDetector { public OperationDrilling(int idOperation) :base(idOperation) { isValid = (DetectableTelemetry[] fragment, int begin, int end) => { var pBegin = fragment[begin]; var pEnd = fragment[end]; if (pBegin.WellDepth >= pEnd.WellDepth) return false; return true; }; calcValue = (DetectableTelemetry[] fragment, int begin, int end) => { var pBegin = fragment[begin]; var pEnd = fragment[end]; var result = (double)(pEnd.WellDepth - pBegin.WellDepth) / (pEnd.DateTime - pBegin.DateTime).TotalHours; return result; }; } } }