DD.WellWorkover.Cloud/AsbCloudInfrastructure/Services/DetectOperations/Detectors/OperationDrilling.cs

31 lines
932 B
C#
Raw Normal View History

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;
};
}
}
}