forked from ddrilling/AsbCloudServer
71 lines
2.1 KiB
C#
71 lines
2.1 KiB
C#
|
using AsbCloudDb.Model;
|
|||
|
|
|||
|
namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
|
|||
|
{
|
|||
|
#nullable enable
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Статический замер телесистемы
|
|||
|
/// </summary>
|
|||
|
internal class DetectorStaticSurveying: DetectorAbstract
|
|||
|
{
|
|||
|
public DetectorStaticSurveying()
|
|||
|
: base(21) { }
|
|||
|
|
|||
|
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;
|
|||
|
if (delta > 2.5d)
|
|||
|
return false;
|
|||
|
|
|||
|
if (point0.RotorSpeed > 15)
|
|||
|
return false;
|
|||
|
|
|||
|
if (ContainsDeviation(telemetry, t => t.BlockPosition, position, 60, 0.03))
|
|||
|
return false;
|
|||
|
|
|||
|
if (ContainsDeviation(telemetry, t => t.Pressure, position, 60, 10))
|
|||
|
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 > 2.5d)
|
|||
|
return true;
|
|||
|
|
|||
|
if (point0.RotorSpeed > 15)
|
|||
|
return true;
|
|||
|
|
|||
|
if (RisesFromBegin(telemetry, t => t.Pressure, position, 10, 10))
|
|||
|
return true;
|
|||
|
|
|||
|
if (ContainsDeviation(telemetry, t => t.BlockPosition, position, 10, 0.03))
|
|||
|
return false;
|
|||
|
|
|||
|
//if (DeviatesFromBegin(telemetry, t => t.Pressure, position, 60, 10))
|
|||
|
// return false;
|
|||
|
|
|||
|
return false;
|
|||
|
}
|
|||
|
|
|||
|
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);
|
|||
|
}
|
|||
|
|
|||
|
#nullable disable
|
|||
|
}
|
|||
|
|