2022-06-30 17:37:57 +05:00
|
|
|
|
using AsbCloudDb.Model;
|
|
|
|
|
|
|
|
|
|
namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
|
|
|
|
|
{
|
2023-04-18 16:22:53 +05:00
|
|
|
|
|
2022-12-08 18:00:01 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Проработка перед наращиванием
|
|
|
|
|
/// </summary>
|
2022-06-30 17:37:57 +05:00
|
|
|
|
internal class DetectorDevelopment : DetectorAbstract
|
|
|
|
|
{
|
|
|
|
|
public DetectorDevelopment()
|
2022-12-09 14:36:45 +05:00
|
|
|
|
: base(WellOperationCategory.IdDevelopment) { }
|
2022-06-30 17:37:57 +05:00
|
|
|
|
|
|
|
|
|
protected override double CalcValue(DetectableTelemetry[] telemetry, int begin, int end)
|
2022-07-07 08:57:52 +05:00
|
|
|
|
=> CalcDeltaMinutes(telemetry, begin, end);
|
2022-06-30 17:37:57 +05:00
|
|
|
|
|
|
|
|
|
protected override bool DetectBegin(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
|
|
|
|
{
|
2022-12-09 14:36:45 +05:00
|
|
|
|
if (previousOperation?.IdCategory == WellOperationCategory.IdSlipsTime)
|
2022-06-30 17:37:57 +05:00
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
var point0 = telemetry[position];
|
|
|
|
|
var delta = point0.WellDepth - point0.BitDepth;
|
|
|
|
|
if (delta < 0.03d || delta > 30)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (point0.Pressure < 15)
|
|
|
|
|
return false;
|
|
|
|
|
|
2022-07-05 13:24:40 +05:00
|
|
|
|
if (point0.BlockPosition > 2.5)
|
2022-06-30 17:37:57 +05:00
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (point0.RotorSpeed < 10)
|
|
|
|
|
return false;
|
|
|
|
|
|
2022-07-01 17:04:44 +05:00
|
|
|
|
if (!ContainsDeviationApprox(telemetry, d => d.BlockPosition, position, 60, 0.03))
|
|
|
|
|
return false;
|
|
|
|
|
|
2022-06-30 17:37:57 +05:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-09 18:00:22 +05:00
|
|
|
|
protected override int DetectEnd(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
2022-07-01 17:04:44 +05:00
|
|
|
|
{
|
|
|
|
|
var point0 = telemetry[position];
|
|
|
|
|
var delta = point0.WellDepth - point0.BitDepth;
|
|
|
|
|
if (delta < 0.03d || delta > 30)
|
2022-08-09 18:00:22 +05:00
|
|
|
|
return IdReasonOfEnd_DeltaDepthOutOfRange;
|
2022-07-01 17:04:44 +05:00
|
|
|
|
|
|
|
|
|
if (point0.Pressure < 15)
|
2022-08-09 18:00:22 +05:00
|
|
|
|
return IdReasonOfEnd_PressureIsLo;
|
2022-07-01 17:04:44 +05:00
|
|
|
|
|
|
|
|
|
if (point0.BlockPosition > 31)
|
2022-08-09 18:00:22 +05:00
|
|
|
|
return IdReasonOfEnd_BlockPositionIsHi;
|
2022-07-01 17:04:44 +05:00
|
|
|
|
|
|
|
|
|
if (point0.RotorSpeed < 10)
|
2022-08-09 18:00:22 +05:00
|
|
|
|
return IdReasonOfEnd_RotorSpeedIsLo;
|
2022-07-01 17:04:44 +05:00
|
|
|
|
|
2022-08-09 18:00:22 +05:00
|
|
|
|
return IdReasonOfEnd_NotDetected;
|
2022-07-01 17:04:44 +05:00
|
|
|
|
}
|
|
|
|
|
|
2022-06-30 17:37:57 +05:00
|
|
|
|
protected override bool IsValid(DetectableTelemetry[] telemetry, int begin, int end)
|
|
|
|
|
=> IsValidByWellDepthDoesNotChange(telemetry, begin, end);
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-18 16:22:53 +05:00
|
|
|
|
|
2022-06-30 17:37:57 +05:00
|
|
|
|
}
|
|
|
|
|
|