2024-07-04 11:02:45 +05:00
|
|
|
using AsbCloudApp.Data.DetectedOperation;
|
2024-04-01 09:30:40 +05:00
|
|
|
using AsbCloudDb.Model;
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Text;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors;
|
|
|
|
|
|
|
|
public class DetectorConditioning : DetectorAbstract
|
2024-04-01 09:30:40 +05:00
|
|
|
{
|
2024-08-19 10:01:07 +05:00
|
|
|
protected override double CalcValue(DetectableTelemetry[] telemetry, int begin, int end) =>
|
|
|
|
CalcDeltaMinutes(telemetry, begin, end);
|
|
|
|
|
|
|
|
protected override bool DetectBegin(DetectableTelemetry[] telemetry, int position, DetectedOperationDto? previousOperation)
|
|
|
|
{
|
|
|
|
var currentPoint = telemetry[position];
|
|
|
|
if (currentPoint.Pressure < 10)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (currentPoint.RotorSpeed <= 8)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
var delta = currentPoint.WellDepth - currentPoint.BitDepth;
|
|
|
|
if (delta < 0.03d)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (currentPoint.BitDepth < 150)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override int DetectEnd(DetectableTelemetry[] telemetry, int position, DetectedOperationDto? previousOperation)
|
|
|
|
{
|
|
|
|
var currentPoint = telemetry[position];
|
|
|
|
|
|
|
|
if (currentPoint.Pressure < 10)
|
|
|
|
return IdReasonOfEnd_PressureIsLo;
|
|
|
|
if (currentPoint.RotorSpeed <=8)
|
|
|
|
return IdReasonOfEnd_RotorSpeedIsHi;
|
|
|
|
if ((currentPoint.WellDepth - currentPoint.BitDepth) < 0.03d)
|
|
|
|
return IdReasonOfEnd_DeltaWellDepthAndBitDepthIsLo;
|
|
|
|
if (currentPoint.BitDepth < 150)
|
|
|
|
return IdReasonOfEnd_BitDepthIsLo;
|
|
|
|
return IdReasonOfEnd_NotDetected;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override (int IdCategory, IDictionary<string, object> ExtraData) GetSpecificInformation(DetectableTelemetry[] telemetry, int begin, int end)
|
2024-04-01 09:30:40 +05:00
|
|
|
{
|
2024-08-19 10:01:07 +05:00
|
|
|
return (WellOperationCategory.IdConditioning, new Dictionary<string, object>());
|
2024-04-01 09:30:40 +05:00
|
|
|
}
|
|
|
|
}
|