2023-11-28 11:23:30 +05:00
|
|
|
|
using System;
|
2023-12-05 10:56:49 +05:00
|
|
|
|
using System.Collections.Generic;
|
2023-11-28 11:23:30 +05:00
|
|
|
|
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 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;
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-05 10:56:49 +05:00
|
|
|
|
protected override (int IdCategory, IDictionary<string, object> ExtraData) GetSpecificInformation(DetectableTelemetry[] telemetry, int begin, int end)
|
2023-12-04 17:36:00 +05:00
|
|
|
|
{
|
2023-12-05 10:56:49 +05:00
|
|
|
|
return (WellOperationCategory.IdSlipsTime, new Dictionary<string, object>());
|
2023-12-04 17:36:00 +05:00
|
|
|
|
}
|
2023-12-05 10:56:49 +05:00
|
|
|
|
|
|
|
|
|
protected override bool IsValidOperationDetectorResult(OperationDetectorResult operationDetectorResult) =>
|
|
|
|
|
Math.Abs(operationDetectorResult.Operation.DepthStart - operationDetectorResult.Operation.DepthEnd) > 0.01;
|
2023-11-28 11:23:30 +05:00
|
|
|
|
}
|
|
|
|
|
|