2022-07-20 09:49:36 +05:00
|
|
|
|
using AsbCloudDb.Model;
|
2022-08-09 15:55:00 +05:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using System;
|
2022-07-20 09:49:36 +05:00
|
|
|
|
|
|
|
|
|
namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
|
|
|
|
|
{
|
2023-04-18 16:22:53 +05:00
|
|
|
|
|
2022-07-20 09:49:36 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Статический замер телесистемы
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal class DetectorStaticSurveying: DetectorAbstract
|
|
|
|
|
{
|
|
|
|
|
public DetectorStaticSurveying()
|
2022-12-09 14:36:45 +05:00
|
|
|
|
: base(WellOperationCategory.IdStaticSurveying) { }
|
2022-07-20 09:49:36 +05:00
|
|
|
|
|
|
|
|
|
protected override bool DetectBegin(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
|
|
|
|
{
|
|
|
|
|
var point0 = telemetry[position];
|
|
|
|
|
|
|
|
|
|
if (point0.Pressure < 15)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
var delta = point0.WellDepth - point0.BitDepth;
|
2022-08-12 12:36:29 +05:00
|
|
|
|
if (delta > 2.5d || delta < 0.15d)
|
2022-07-20 09:49:36 +05:00
|
|
|
|
return false;
|
|
|
|
|
|
2022-08-05 15:58:40 +05:00
|
|
|
|
if (point0.RotorSpeed > 30)
|
2022-07-20 09:49:36 +05:00
|
|
|
|
return false;
|
|
|
|
|
|
2022-08-11 15:37:24 +05:00
|
|
|
|
if (ContainsDeviation(telemetry, t => t.BlockPosition, position, 120, 0.03))
|
2022-07-20 09:49:36 +05:00
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (ContainsDeviation(telemetry, t => t.Pressure, position, 60, 10))
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-09 18:00:22 +05:00
|
|
|
|
protected override int DetectEnd(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
2022-07-20 09:49:36 +05:00
|
|
|
|
{
|
|
|
|
|
var point0 = telemetry[position];
|
|
|
|
|
|
|
|
|
|
var delta = point0.WellDepth - point0.BitDepth;
|
2022-08-09 15:55:00 +05:00
|
|
|
|
if (delta > 2.5d )
|
2022-08-09 18:00:22 +05:00
|
|
|
|
return IdReasonOfEnd_DeltaDepthIsHi;
|
2022-07-20 09:49:36 +05:00
|
|
|
|
|
2022-08-05 15:58:40 +05:00
|
|
|
|
if (point0.RotorSpeed > 30)
|
2022-08-09 18:00:22 +05:00
|
|
|
|
return IdReasonOfEnd_RotorSpeedIsHi;
|
2022-07-20 09:49:36 +05:00
|
|
|
|
|
2022-08-09 15:55:00 +05:00
|
|
|
|
if (RisesFromBegin(telemetry, t => t.Pressure, position, 10, 15))
|
2022-08-09 18:00:22 +05:00
|
|
|
|
return IdReasonOfEnd_PressureIsRising;
|
2022-07-20 09:49:36 +05:00
|
|
|
|
|
2022-08-05 15:58:40 +05:00
|
|
|
|
if (ContainsDeviation(telemetry, t => t.BlockPosition, position, 10, 0.05))
|
2022-08-09 18:00:22 +05:00
|
|
|
|
return IdReasonOfEnd_BlockPositionDeviates;
|
2022-07-20 09:49:36 +05:00
|
|
|
|
|
2022-08-09 18:00:22 +05:00
|
|
|
|
return IdReasonOfEnd_NotDetected;
|
2022-07-20 09:49:36 +05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override bool IsValid(DetectableTelemetry[] telemetry, int begin, int end)
|
|
|
|
|
=> IsValidByWellDepthDoesNotChange(telemetry, begin, end);
|
|
|
|
|
|
|
|
|
|
protected override double CalcValue(DetectableTelemetry[] telemetry, int begin, int end)
|
|
|
|
|
=> CalcDeltaMinutes(telemetry, begin, end);
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-18 16:22:53 +05:00
|
|
|
|
|
2022-07-20 09:49:36 +05:00
|
|
|
|
}
|
|
|
|
|
|