2022-06-27 10:20:54 +05:00
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
internal class OperationDrilling : OperationDetector
|
|
|
|
|
{
|
|
|
|
|
public OperationDrilling(int idOperation)
|
|
|
|
|
:base(idOperation)
|
|
|
|
|
{
|
2022-06-29 13:40:06 +05:00
|
|
|
|
isValid = (DetectableTelemetry[] fragment, int begin, int end) =>
|
2022-06-27 10:20:54 +05:00
|
|
|
|
{
|
2022-06-29 13:40:06 +05:00
|
|
|
|
var pBegin = fragment[begin];
|
|
|
|
|
var pEnd = fragment[end];
|
2022-06-27 10:20:54 +05:00
|
|
|
|
if (pBegin.WellDepth >= pEnd.WellDepth)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
};
|
|
|
|
|
|
2022-06-29 13:40:06 +05:00
|
|
|
|
calcValue = (DetectableTelemetry[] fragment, int begin, int end) =>
|
2022-06-27 10:20:54 +05:00
|
|
|
|
{
|
2022-06-29 13:40:06 +05:00
|
|
|
|
var pBegin = fragment[begin];
|
|
|
|
|
var pEnd = fragment[end];
|
2022-06-27 10:20:54 +05:00
|
|
|
|
var result = (double)(pEnd.WellDepth - pBegin.WellDepth) / (pEnd.DateTime - pBegin.DateTime).TotalHours;
|
|
|
|
|
return result;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|