forked from ddrilling/AsbCloudServer
a435dce308
1. Дополнения шаблона для отладки 1.2 Добавлен комментарии 2. Вернул определение операции удержание в клиньях
36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
using System;
|
|
using AsbCloudDb.Model;
|
|
|
|
namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors;
|
|
|
|
public class DetectorSlipsTime : DetectorAbstract
|
|
{
|
|
protected override double CalcValue(DetectableTelemetry[] telemetry, int begin, int end)
|
|
=> CalcDeltaMinutes(telemetry, begin, end);
|
|
|
|
protected override Func<DetectableTelemetry[], int, int, int> GetIdOperation => (_, _, _) => WellOperationCategory.IdSlipsTime;
|
|
|
|
protected override bool DetectBegin(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
|
{
|
|
var point0 = telemetry[position];
|
|
var delta = point0.WellDepth - point0.BitDepth;
|
|
if (delta > 2.5d)
|
|
return false;
|
|
|
|
if (point0.Pressure > 15)
|
|
return false;
|
|
|
|
if (point0.BlockPosition > 8)
|
|
return false;
|
|
|
|
if (point0.HookWeight > 20)
|
|
return false;
|
|
|
|
return true;
|
|
}
|
|
|
|
protected override bool IsValidOperationDetectorResult(OperationDetectorResult operationDetectorResult) =>
|
|
Math.Abs(operationDetectorResult.Operation.DepthStart - operationDetectorResult.Operation.DepthEnd) > 0.01;
|
|
}
|
|
|