DetectedOperationExportService fix comment

This commit is contained in:
ngfrolov 2023-12-05 12:10:30 +05:00
parent 2ceac00a4f
commit 371083bd38
Signed by untrusted user who does not match committer: ng.frolov
GPG Key ID: E99907A0357B29A7

View File

@ -6,12 +6,10 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using AsbCloudInfrastructure.Services.DetectOperations.Detectors;
using AsbCloudApp.Repositories;
using AsbCloudInfrastructure.Repository;
namespace AsbCloudInfrastructure.Services.DetectOperations;
@ -69,8 +67,7 @@ public class DetectedOperationExportService
if (!well.IdTelemetry.HasValue)
throw new ArgumentNullException(nameof(well));
var operations = await DetectOperationsAsync(well.IdTelemetry.Value, new DateTime(2023, 10, 14)
.ToUtcDateTimeOffset(well.Timezone.Hours), cancellationToken);
var operations = await DetectOperationsAsync(well.IdTelemetry.Value, DateTime.UnixEpoch, cancellationToken);
return await GenerateExcelFileStreamAsync(well, idDomain, operations, cancellationToken);
}
@ -200,19 +197,15 @@ public class DetectedOperationExportService
{
case WellOperationCategory.IdRotor:
case WellOperationCategory.IdSlide:
{
var avgRotorSpeed = operation.ExtraData[DetectorDrilling.ExtraDataKeyAvgRotorSpeed];
var dispersionOfNormalizedRotorSpeed = operation.ExtraData[DetectorDrilling.ExtraDataKeyDispersionOfNormalizedRotorSpeed];
var isAfbEnabledObject = operation.ExtraData[DetectorDrilling.ExtraDataKeyIsAfbEnabled];
var AfbState = "";
if (isAfbEnabledObject is bool isAfbEnabled && isAfbEnabled)
AfbState = "АКБ - вкл";
var comment = "";
if (operation.ExtraData.TryGetValue(DetectorDrilling.ExtraDataKeyAvgRotorSpeed, out object? oAvgRotorSpeed))
comment += $"Средняя скорость оборотов ротора: {oAvgRotorSpeed}\r\n";
var comment = $"Средняя скорость оборотов ротора: {avgRotorSpeed}\r\n" +
$"Дисперсия нормированных оборотов ротора: {dispersionOfNormalizedRotorSpeed} \r\n" +
$"{AfbState}";
if (operation.ExtraData.TryGetValue(DetectorDrilling.ExtraDataKeyDispersionOfNormalizedRotorSpeed, out object? oDispersionOfNormalizedRotorSpeed))
comment += $"Дисперсия нормированных оборотов ротора: {oDispersionOfNormalizedRotorSpeed}";
return comment;
}
default:
return string.Empty;
}