2022-07-19 10:29:38 +05:00
|
|
|
|
using AsbCloudDb.Model;
|
|
|
|
|
|
|
|
|
|
namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
|
|
|
|
|
{
|
2022-08-03 11:13:23 +05:00
|
|
|
|
#nullable enable
|
2022-07-19 10:29:38 +05:00
|
|
|
|
/// <summary>
|
2022-08-05 17:16:34 +05:00
|
|
|
|
/// Промывка
|
2022-07-19 10:29:38 +05:00
|
|
|
|
/// </summary>
|
|
|
|
|
internal class DetectorFlashing : DetectorAbstract
|
|
|
|
|
{
|
|
|
|
|
public DetectorFlashing()
|
2022-08-05 17:16:34 +05:00
|
|
|
|
: base(22) { }
|
2022-07-19 10:29:38 +05:00
|
|
|
|
|
|
|
|
|
protected override double CalcValue(DetectableTelemetry[] telemetry, int begin, int end)
|
|
|
|
|
=> CalcDeltaMinutes(telemetry, begin, end);
|
|
|
|
|
|
|
|
|
|
protected override bool DetectBegin(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
|
|
|
|
{
|
|
|
|
|
if (!((previousOperation?.IdCategory == 2) ||
|
|
|
|
|
(previousOperation?.IdCategory == 3)))
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
var point0 = telemetry[position];
|
|
|
|
|
var delta = point0.WellDepth - point0.BitDepth;
|
|
|
|
|
if (delta > 0.05d)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (point0.Pressure < 15)
|
|
|
|
|
return false;
|
|
|
|
|
|
2022-08-05 17:16:34 +05:00
|
|
|
|
if (point0.BlockPosition < 3)
|
2022-07-19 10:29:38 +05:00
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override bool DetectEnd(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
|
|
|
|
{
|
|
|
|
|
var point0 = telemetry[position];
|
|
|
|
|
var delta = point0.WellDepth - point0.BitDepth;
|
|
|
|
|
if ((delta > 0.03d )
|
|
|
|
|
&& (point0.Pressure > 15)
|
2022-07-20 09:49:36 +05:00
|
|
|
|
&& ContainsDeviationApprox(telemetry, t=>t.BlockPosition, position, 60, 0.03))
|
2022-07-19 10:29:38 +05:00
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override bool IsValid(DetectableTelemetry[] telemetry, int begin, int end)
|
|
|
|
|
=> IsValidByWellDepthDoesNotChange(telemetry, begin, end);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#nullable disable
|
|
|
|
|
}
|
|
|
|
|
|