DetectorSlipsTime.DetectBegin reorder conditions

This commit is contained in:
ngfrolov 2024-03-01 10:35:43 +05:00
parent 93f22c5b5b
commit 9ba05d6650
Signed by untrusted user who does not match committer: ng.frolov
GPG Key ID: E99907A0357B29A7

View File

@ -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;