forked from ddrilling/AsbCloudServer
Merge pull request 'Фикс сервиса автоопределения операций' (#296) from fix/detected_operations into dev
Reviewed-on: https://test.digitaldrilling.ru:8443/DDrilling/AsbCloudServer/pulls/296
This commit is contained in:
commit
d999d14c04
@ -195,13 +195,6 @@ public class DetectedOperationService : IDetectedOperationService
|
|||||||
|
|
||||||
var timeZone = telemetryService.GetTimezone(idTelemetry);
|
var timeZone = telemetryService.GetTimezone(idTelemetry);
|
||||||
|
|
||||||
if (telemetries.Count() <= gap)
|
|
||||||
{
|
|
||||||
var lastTelemetry = telemetries.Last();
|
|
||||||
var lastDateTelemetry = new DateTimeOffset(lastTelemetry.DateTime, timeZone.Offset);
|
|
||||||
return (lastDateTelemetry, Enumerable.Empty<DetectedOperationDto>());
|
|
||||||
}
|
|
||||||
|
|
||||||
var detectedOperations = new List<DetectedOperationDto>();
|
var detectedOperations = new List<DetectedOperationDto>();
|
||||||
|
|
||||||
var detectableTelemetries = telemetries
|
var detectableTelemetries = telemetries
|
||||||
@ -219,6 +212,13 @@ public class DetectedOperationService : IDetectedOperationService
|
|||||||
RotorSpeed = t.RotorSpeed,
|
RotorSpeed = t.RotorSpeed,
|
||||||
AxialLoad = t.AxialLoad,
|
AxialLoad = t.AxialLoad,
|
||||||
}).ToArray();
|
}).ToArray();
|
||||||
|
|
||||||
|
if (detectableTelemetries.Length <= gap)
|
||||||
|
{
|
||||||
|
var lastTelemetry = telemetries.Last();
|
||||||
|
var lastDateTelemetry = new DateTimeOffset(lastTelemetry.DateTime, timeZone.Offset);
|
||||||
|
return (lastDateTelemetry, Enumerable.Empty<DetectedOperationDto>());
|
||||||
|
}
|
||||||
|
|
||||||
var positionBegin = 0;
|
var positionBegin = 0;
|
||||||
var positionEnd = detectableTelemetries.Length - gap;
|
var positionEnd = detectableTelemetries.Length - gap;
|
||||||
@ -238,8 +238,9 @@ public class DetectedOperationService : IDetectedOperationService
|
|||||||
}
|
}
|
||||||
|
|
||||||
var point0 = detectableTelemetries[positionBegin];
|
var point0 = detectableTelemetries[positionBegin];
|
||||||
while (positionBegin < positionEnd && IsChangingTelemetryInterval(point0, detectableTelemetries[++positionBegin]))
|
|
||||||
;
|
while (positionBegin < positionEnd && IsChangingTelemetryInterval(point0, detectableTelemetries[positionBegin]))
|
||||||
|
positionBegin++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (detectableTelemetries[positionBegin].DateTime, detectedOperations);
|
return (detectableTelemetries[positionBegin].DateTime, detectedOperations);
|
||||||
|
Loading…
Reference in New Issue
Block a user