From aa87cb1c35401008d1e37e6a19b214c967afc4a4 Mon Sep 17 00:00:00 2001 From: KharchenkoVV Date: Thu, 19 Aug 2021 14:13:08 +0500 Subject: [PATCH] CS2-54: Fixed 'route speed' calculation --- .../Services/WellSectionService.cs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/AsbCloudInfrastructure/Services/WellSectionService.cs b/AsbCloudInfrastructure/Services/WellSectionService.cs index 364f31cf..ee24c0cb 100644 --- a/AsbCloudInfrastructure/Services/WellSectionService.cs +++ b/AsbCloudInfrastructure/Services/WellSectionService.cs @@ -222,14 +222,6 @@ namespace AsbCloudInfrastructure.Services return CalculateResult(mechSpeedBase); } - private static IEnumerable<(double BhaUpSpeedPlan, double BhaUpSpeedFact)> GetWellBhaUpSpeedPlanFact( - IEnumerable> groupedOperations) - { - var bhaUpSpeedBase = GetParams(groupedOperations, 1072); - - return CalculateResult(bhaUpSpeedBase); - } - private static IEnumerable<(double BhaDownSpeedPlan, double BhaDownSpeedFact)> GetWellBhaDownSpeedPlanFact( IEnumerable> groupedOperations) { @@ -238,6 +230,14 @@ namespace AsbCloudInfrastructure.Services return CalculateResult(bhaDownSpeedBase); } + private static IEnumerable<(double BhaUpSpeedPlan, double BhaUpSpeedFact)> GetWellBhaUpSpeedPlanFact( + IEnumerable> groupedOperations) + { + var bhaUpSpeedBase = GetParams(groupedOperations, 1072); + + return CalculateResult(bhaUpSpeedBase); + } + private static IEnumerable<(double CasingDownSpeedPlan, double CasingDownSpeedFact)> GetWellCasingDownPlanFact( IEnumerable> groupedOperations) { @@ -279,8 +279,8 @@ namespace AsbCloudInfrastructure.Services var routeSpeedsBase = bhaRaiseDecreaseCollection.Select(el => ( - RouteDepthPlan: (el.FirstBhaPositionDecreasePlan?.WellDepth - el.LastBhaPositionIncreasePlan?.WellDepth) ?? 0, - RouteDepthFact: (el.FirstBhaPositionDecreaseFact?.WellDepth - el.LastBhaPositionIncreaseFact?.WellDepth) ?? 0, + RouteDepthPlan: (el.LastBhaPositionIncreasePlan?.WellDepth - el.FirstBhaPositionDecreasePlan?.WellDepth) ?? 0, + RouteDepthFact: (el.LastBhaPositionIncreaseFact?.WellDepth - el.FirstBhaPositionDecreaseFact?.WellDepth) ?? 0, RouteDurationPlan: (el.LastBhaPositionIncreasePlan?.StartDate + TimeSpan.FromHours(el.LastBhaPositionIncreasePlan?.DurationHours ?? 0) - el.FirstBhaPositionDecreasePlan?.StartDate)?.TotalHours ?? 0,