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

31 lines
952 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[] telemetryFragment) =>
{
var pBegin = telemetryFragment.First();
var pEnd = telemetryFragment.Last();
if (pBegin.WellDepth >= pEnd.WellDepth)
return false;
return true;
};
calcValue = (DetectableTelemetry[] telemetryFragment) =>
{
var pBegin = telemetryFragment.First();
var pEnd = telemetryFragment.Last();
var result = (double)(pEnd.WellDepth - pBegin.WellDepth) / (pEnd.DateTime - pBegin.DateTime).TotalHours;
return result;
};
}
}
}