2022-06-30 17:37:57 +05:00
|
|
|
|
using AsbCloudDb.Model;
|
|
|
|
|
|
|
|
|
|
namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
|
|
|
|
|
{
|
|
|
|
|
#nullable enable
|
|
|
|
|
internal class DetectorSlide : DetectorAbstract
|
|
|
|
|
{
|
|
|
|
|
public DetectorSlide()
|
2022-12-09 14:36:45 +05:00
|
|
|
|
: base(WellOperationCategory.IdSlide) { }
|
2022-06-30 17:37:57 +05:00
|
|
|
|
|
|
|
|
|
protected override bool DetectBegin(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
|
|
|
|
{
|
|
|
|
|
var point0 = telemetry[position];
|
|
|
|
|
var delta = point0.WellDepth - point0.BitDepth;
|
|
|
|
|
if (delta > 0.03d)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (point0.Pressure < 25)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (point0.RotorSpeed > 5)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
var point1 = telemetry[position + 1];
|
|
|
|
|
if (point1.WellDepth - point0.WellDepth <= 0.003)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-09 18:00:22 +05:00
|
|
|
|
protected override int DetectEnd(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
2022-06-30 17:37:57 +05:00
|
|
|
|
{
|
|
|
|
|
var point0 = telemetry[position];
|
|
|
|
|
var delta = point0.WellDepth - point0.BitDepth;
|
|
|
|
|
if (delta > 0.03d)
|
2022-08-09 18:00:22 +05:00
|
|
|
|
return IdReasonOfEnd_DeltaDepthIsHi;
|
2022-06-30 17:37:57 +05:00
|
|
|
|
|
|
|
|
|
if (point0.Pressure < 25)
|
2022-08-09 18:00:22 +05:00
|
|
|
|
return IdReasonOfEnd_PressureIsLo;
|
2022-06-30 17:37:57 +05:00
|
|
|
|
|
2022-12-20 11:57:29 +05:00
|
|
|
|
var avgRotorSpeed = CalcAvgAppr(d => d.RotorSpeed, telemetry, position, 60);
|
2022-06-30 17:37:57 +05:00
|
|
|
|
|
2022-12-20 11:57:29 +05:00
|
|
|
|
if (avgRotorSpeed > 10)
|
2022-08-09 18:00:22 +05:00
|
|
|
|
return IdReasonOfEnd_AvgRotorSpeedIsHi;
|
2022-06-30 17:37:57 +05:00
|
|
|
|
|
2022-08-09 18:00:22 +05:00
|
|
|
|
if (!DeviatesFromBegin(telemetry, t => t.WellDepth, position, 150, 0.003))
|
|
|
|
|
return IdReasonOfEnd_WellDepthDeviates;
|
2022-06-30 17:37:57 +05:00
|
|
|
|
|
2022-08-09 18:00:22 +05:00
|
|
|
|
return IdReasonOfEnd_NotDetected;
|
2022-06-30 17:37:57 +05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override bool IsValid(DetectableTelemetry[] telemetry, int begin, int end)
|
|
|
|
|
=> IsValidByWellDepthIncreasing(telemetry, begin, end);
|
|
|
|
|
|
|
|
|
|
protected override double CalcValue(DetectableTelemetry[] telemetry, int begin, int end)
|
|
|
|
|
=> CalcRop(telemetry, begin, end);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#nullable disable
|
|
|
|
|
}
|
|
|
|
|
|