diff --git a/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs b/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs index 7edb68fe..1eeb1e3a 100644 --- a/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs +++ b/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs @@ -288,7 +288,8 @@ namespace AsbCloudInfrastructure.Services.WellOperationService while (iterator.MoveNext()) { if (iterator.Current.IdCategory == WellOperationService.idOperationTypeRepair) - race.Repair += iterator.Current.DurationHours; + race.RepairHours += iterator.Current.DurationHours; + if (iterator.Current.IdCategory == WellOperationService.idOperationNonProductiveTime) race.NonProductiveHours += iterator.Current.DurationHours; @@ -312,7 +313,7 @@ namespace AsbCloudInfrastructure.Services.WellOperationService var dHours = 0d; foreach (var race in races) { - dHours += race.DeltaHoursTimeNoNptAndRepair; + dHours += race.DeltaHours - race.NonProductiveHours - race.RepairHours; dDepth += race.DeltaDepth; } return dDepth / (dHours + double.Epsilon); @@ -431,8 +432,6 @@ namespace AsbCloudInfrastructure.Services.WellOperationService var lastMatchPlan = merged[iLastMatch].Item1; var lastMatchPlanOperationEnd = lastMatchPlan.DateStart.AddHours(lastMatchPlan.DurationHours); - //var lastMatchFact = merged[iLastMatch].Item2; - //var lastMatchFactDateEnd = lastMatchFact.DateStart.AddHours(lastMatchFact.DurationHours); var lastFact = merged[iLastFact].Item2; var lastFactDateEnd = lastFact.DateStart.AddHours(lastFact.DurationHours); var startOffset = lastFactDateEnd - lastMatchPlanOperationEnd; diff --git a/AsbCloudInfrastructure/Services/WellOperationService/Race.cs b/AsbCloudInfrastructure/Services/WellOperationService/Race.cs index 6377e597..e279111d 100644 --- a/AsbCloudInfrastructure/Services/WellOperationService/Race.cs +++ b/AsbCloudInfrastructure/Services/WellOperationService/Race.cs @@ -13,7 +13,7 @@ namespace AsbCloudInfrastructure.Services.WellOperationService public DateTime StartDate { get; set; } /// - /// Глубина начала рейса + /// Глубина начала рейса, м /// public double StartWellDepth { get; set; } @@ -23,7 +23,7 @@ namespace AsbCloudInfrastructure.Services.WellOperationService public DateTime EndDate { get; set; } /// - /// Глубина окончания рейса + /// Глубина окончания рейса, м /// public double EndWellDepth { get; set; } @@ -38,15 +38,28 @@ namespace AsbCloudInfrastructure.Services.WellOperationService public double NonProductiveHours { get; set; } /// - /// Ремонт + /// Ремонт, часы /// - public double Repair { get; set; } + public double RepairHours { get; set; } + /// + /// проходка за рейс, м + /// public double DeltaDepth => EndWellDepth - StartWellDepth; - public double DeltaHoursTimeNoNpt => (EndDate - StartDate).TotalHours - NonProductiveHours; - public double DeltaHoursTimeNoNptAndRepair => DeltaHoursTimeNoNpt - Repair; - public double Speed => DeltaDepth / (DeltaHoursTimeNoNpt + double.Epsilon); + + /// + /// Полное время рейса, часы + /// + public double DeltaHours => (EndDate - StartDate).TotalHours; + + /// + /// Скорость за рейс, м/час + /// + public double Speed => DeltaDepth / (DeltaHours - NonProductiveHours - RepairHours + double.Epsilon); + /// + /// Список операций за рейс + /// public List? Operations { get; internal set; } } #nullable disable