using AsbCloudDb.Model; namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors { #nullable enable class DetectorSlipsTime : DetectorAbstract { public DetectorSlipsTime() :base(14) {} public double HookWeightSP { get; set; } = 20; public double PressureSP { get; set; } = 15; public double PosisionSP { get; set; } = 8; public double DeltaWellDepthMax { get; set; } = 2.5; protected override bool DetectStart(DetectableTelemetry[] telemetry, int position) { var item = telemetry[position]; var result = item.HookWeight < HookWeightSP && item.Pressure < PressureSP && item.BlockPosition < PosisionSP && (item.WellDepth - item.BitDepth) < DeltaWellDepthMax; return result; } protected override bool DetectEnd(DetectableTelemetry[] telemetry, int position) { var item = telemetry[position]; var result = item.Pressure > PressureSP && item.BlockPosition > PosisionSP; return result; } protected override void CalcValue(ref DetectedOperation result) { result.Value = result.DurationMinutes; } } #nullable disable }