From 9ba05d6650cc64d8e40b1b71bec02ada05c61338 Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Fri, 1 Mar 2024 10:35:43 +0500 Subject: [PATCH] DetectorSlipsTime.DetectBegin reorder conditions --- .../DetectOperations/Detectors/DetectorSlipsTime.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/AsbCloudInfrastructure/Services/DetectOperations/Detectors/DetectorSlipsTime.cs b/AsbCloudInfrastructure/Services/DetectOperations/Detectors/DetectorSlipsTime.cs index 315583f6..a9996a1b 100644 --- a/AsbCloudInfrastructure/Services/DetectOperations/Detectors/DetectorSlipsTime.cs +++ b/AsbCloudInfrastructure/Services/DetectOperations/Detectors/DetectorSlipsTime.cs @@ -13,26 +13,23 @@ public class DetectorSlipsTime : DetectorAbstract protected override bool DetectBegin(DetectableTelemetry[] telemetry, int position, DetectedOperationDto? previousOperation) { var currentPoint = telemetry[position]; - var delta = Math.Abs(currentPoint.WellDepth - currentPoint.BitDepth); - if (currentPoint.BitDepth < 150) return false; - if (delta < 0.1d) - return false; - if (currentPoint.Pressure > 20) return false; - var nextIndexPoint = telemetry.Length <= position ? position : position + 1; + var delta = currentPoint.WellDepth - currentPoint.BitDepth; + if (delta < 0.1d) + return false; + var nextIndexPoint = telemetry.Length <= position ? position : position + 1; var nextPoint = telemetry[nextIndexPoint]; var deltaBitDepth = Math.Abs(currentPoint.BitDepth - nextPoint.BitDepth); - var deltaBlockPosition = Math.Abs(currentPoint.BlockPosition - nextPoint.BlockPosition); - if (deltaBitDepth > 0.001d) return false; + var deltaBlockPosition = Math.Abs(currentPoint.BlockPosition - nextPoint.BlockPosition); if (deltaBlockPosition < 0.001d) return false;