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

31 lines
905 B
C#
Raw Normal View History

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