Skip телеметрий

This commit is contained in:
Степанов Дмитрий 2024-07-26 13:11:03 +03:00
parent 315c259a25
commit 0c7aac40ff
2 changed files with 23 additions and 3 deletions

View File

@ -235,7 +235,12 @@ public class DetectedOperationService : IDetectedOperationService
break; break;
} }
positionBegin += 1; var skip = 1;
while (IsChangingTelemetryInterval(detectableTelemetries[positionBegin], detectableTelemetries[positionBegin + skip]))
skip++;
positionBegin += skip;
} }
return (detectableTelemetries[positionBegin].DateTime, detectedOperations); return (detectableTelemetries[positionBegin].DateTime, detectedOperations);
@ -252,6 +257,21 @@ public class DetectedOperationService : IDetectedOperationService
return result; return result;
} }
private static bool IsChangingTelemetryInterval(DetectableTelemetry telemetryBegin, DetectableTelemetry telemetryEnd)
{
return telemetryBegin.Mode == telemetryEnd.Mode &&
EqualParameter(telemetryBegin.WellDepth, telemetryEnd.WellDepth, 0.01f) &&
EqualParameter(telemetryBegin.Pressure, telemetryEnd.Pressure, 0.1f) &&
EqualParameter(telemetryBegin.HookWeight, telemetryEnd.HookWeight, 0.1f) &&
EqualParameter(telemetryBegin.BlockPosition, telemetryEnd.BlockPosition, 0.01f) &&
EqualParameter(telemetryBegin.BitDepth, telemetryEnd.BitDepth, 0.01f) &&
EqualParameter(telemetryBegin.RotorSpeed, telemetryEnd.RotorSpeed, 0.01f) &&
EqualParameter(telemetryBegin.AxialLoad, telemetryEnd.AxialLoad, 0.1f);
bool EqualParameter(float value, float origin, float tolerance) =>
value <= origin + tolerance && value >= origin - tolerance;
}
private static IEnumerable<DetectedOperationDrillersStatDto> GetOperationsDrillersStat(IEnumerable<DetectedOperationWithDrillerDto> operations) private static IEnumerable<DetectedOperationDrillersStatDto> GetOperationsDrillersStat(IEnumerable<DetectedOperationWithDrillerDto> operations)
{ {
var groups = operations.GroupBy(o => o.Driller); var groups = operations.GroupBy(o => o.Driller);

View File

@ -48,12 +48,12 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
while (positionEnd < end) while (positionEnd < end)
{ {
//TODO: поиск провалов телеметрии
positionEnd += 1; positionEnd += 1;
if (positionEnd > end) if (positionEnd > end)
break; break;
//TODO: поиск провалов телеметрий. Следует обсудить, так как алгоритмы теряют в точности.
idReasonOfEnd = DetectEnd(telemetry, positionEnd, previousOperation); idReasonOfEnd = DetectEnd(telemetry, positionEnd, previousOperation);
if (idReasonOfEnd != IdReasonOfEnd_NotDetected) if (idReasonOfEnd != IdReasonOfEnd_NotDetected)