Изменены некоторые имена полей TelemetryAnalysis

This commit is contained in:
KharchenkoVV 2021-07-21 17:57:59 +05:00
parent 9c5c1fc9c5
commit eaafc7fd04
3 changed files with 12 additions and 12 deletions

View File

@ -36,7 +36,7 @@ namespace AsbCloudDb.Model
public long UnixDate { get; set; }
[Column("duration_sec"), Comment("Кол-во секунд после предыдущей операции")]
public int Duration { get; set; }
public int DurationSec { get; set; }
[Column("operation_start_depth"), Comment("Глубина, на которой началась операция")]
public double? OperationStartDepth { get; set; }
@ -57,7 +57,7 @@ namespace AsbCloudDb.Model
public bool IsBitPositionDecreasing { get; set; }
[Column("is_bit_posision_lt_20"), Comment("Положение долота меньше 20м")]
public bool IsBitDepthLess20 { get; set; }
public bool IsBitPositionLt20 { get; set; }
[Column("is_block_posision_incresing"), Comment("Талевый блок спускается")]
public bool IsBlockPositionIncreasing { get; set; }

View File

@ -116,7 +116,7 @@ namespace AsbCloudInfrastructure.Services
if (end != default)
{
var unixEnd = (end - new DateTime(1970, 1, 1)).TotalSeconds;
operations = operations.Where(m => (m.UnixDate + m.Duration) <= unixEnd);
operations = operations.Where(m => (m.UnixDate + m.DurationSec) <= unixEnd);
}
result.Count = operations.Count();
@ -136,7 +136,7 @@ namespace AsbCloudInfrastructure.Services
Id = operation.Id,
Name = operation.Operation.Name,
BeginDate = DateTimeOffset.FromUnixTimeSeconds(operation.UnixDate).DateTime,
EndDate = DateTimeOffset.FromUnixTimeSeconds(operation.UnixDate + operation.Duration).DateTime,
EndDate = DateTimeOffset.FromUnixTimeSeconds(operation.UnixDate + operation.DurationSec).DateTime,
StartWellDepth = operation.OperationStartDepth ?? 0.0,
EndWellDepth = operation.OperationEndDepth ?? 0.0
};
@ -166,8 +166,8 @@ namespace AsbCloudInfrastructure.Services
select new OperationDurationDto
{
OperationName = g.Key.Name,
Duration = g.Where(g => g.Duration > 0)
.Sum(a => a.Duration)
Duration = g.Where(g => g.DurationSec > 0)
.Sum(a => a.DurationSec)
}).ToList();
return operations;
@ -198,7 +198,7 @@ namespace AsbCloudInfrastructure.Services
{
IntervalStart = g.Min(d => d.UnixDate),
OperationName = g.Key.Name,
OperationsDuration = g.Sum(an => an.Duration)
OperationsDuration = g.Sum(an => an.DurationSec)
}).ToList();
var operationsGroupedByInterval = operations.GroupBy(op => op.IntervalStart)
@ -232,8 +232,8 @@ namespace AsbCloudInfrastructure.Services
if (saubDataCache.CurrentAnalysis.IdOperation == telemetryAnalysis.IdOperation)
{
saubDataCache.CurrentAnalysis.Duration +=
telemetryAnalysis.Duration;
saubDataCache.CurrentAnalysis.DurationSec +=
telemetryAnalysis.DurationSec;
saubDataCache.CurrentAnalysis.OperationEndDepth = dataSaub.WellDepth;
}
else
@ -283,14 +283,14 @@ namespace AsbCloudInfrastructure.Services
{
IdTelemetry = dataSaubBases.First().IdTelemetry,
UnixDate = (long)(lastSaubDate - new DateTime(1970, 1, 1, 0, 0, 0)).TotalSeconds,
Duration = (int)(dataSaubBases.Last().Date - dataSaubBases.ElementAt(dataSaubBases.Count() - 2).Date).TotalSeconds,
DurationSec = (int)(dataSaubBases.Last().Date - dataSaubBases.ElementAt(dataSaubBases.Count() - 2).Date).TotalSeconds,
OperationStartDepth = null,
OperationEndDepth = null,
IsWellDepthDecreasing = InterpolationLine.IsValueDecreases(wellDepthChangingIndex, -0.0001),
IsWellDepthIncreasing = InterpolationLine.IsValueIncreases(wellDepthChangingIndex, 0.0001),
IsBitPositionDecreasing = InterpolationLine.IsValueDecreases(bitPositionChangingIndex, -0.0001),
IsBitPositionIncreasing = InterpolationLine.IsValueIncreases(bitPositionChangingIndex, 0.0001),
IsBitDepthLess20 = InterpolationLine.IsAverageLessThanBound(saubBitDepths, 20),
IsBitPositionLt20 = InterpolationLine.IsAverageLessThanBound(saubBitDepths, 20),
IsBlockPositionDecreasing = InterpolationLine.IsValueDecreases(blockPositionChangingIndex, -0.0001),
IsBlockPositionIncreasing = InterpolationLine.IsValueIncreases(blockPositionChangingIndex, 0.0001),
IsRotorSpeedLt3 = InterpolationLine.IsAverageLessThanBound(saubRotorSpeeds, 3),

View File

@ -19,7 +19,7 @@ namespace AsbCloudInfrastructure.Services
Detect = (data) =>
{
return !data.IsWellDepthDecreasing && !data.IsWellDepthIncreasing
&& data.IsBitDepthLess20 && data.IsHookWeightLt3;
&& data.IsBitPositionLt20 && data.IsHookWeightLt3;
}
},
new OperationDetector