forked from ddrilling/AsbCloudServer
31 lines
905 B
C#
31 lines
905 B
C#
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;
|
|
};
|
|
}
|
|
}
|
|
}
|