forked from ddrilling/AsbCloudServer
Правки по результатам:
- правки алгоритмов от Димы З. - ревью от Димы С
This commit is contained in:
parent
ee22d1c487
commit
cfb31fcbed
@ -4,8 +4,19 @@ namespace AsbCloudInfrastructure.Services.DetectOperations;
|
||||
|
||||
public class DetectableTelemetry
|
||||
{
|
||||
/// <summary>
|
||||
/// Дата начала
|
||||
/// </summary>
|
||||
public DateTimeOffset DateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Режим
|
||||
/// </summary>
|
||||
public int Mode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Ключ пользователя
|
||||
/// </summary>
|
||||
public int? IdUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
@ -155,18 +155,18 @@ public class DetectedOperationService : IDetectedOperationService
|
||||
var detectableTelemetries = (await telemetryDataSaubService.GetByTelemetryAsync(idTelemetry, request, token))
|
||||
.Where(t => t.BlockPosition >= 0)
|
||||
.Select(t => new DetectableTelemetry
|
||||
{
|
||||
DateTime = t.DateTime,
|
||||
IdUser = t.IdUser,
|
||||
Mode = t.Mode,
|
||||
WellDepth = t.WellDepth,
|
||||
Pressure = t.Pressure,
|
||||
HookWeight = t.HookWeight,
|
||||
BlockPosition = t.BlockPosition,
|
||||
BitDepth = t.BitDepth,
|
||||
RotorSpeed = t.RotorSpeed,
|
||||
AxialLoad = t.AxialLoad,
|
||||
}).ToArray();
|
||||
{
|
||||
DateTime = t.DateTime,
|
||||
IdUser = t.IdUser,
|
||||
Mode = t.Mode,
|
||||
WellDepth = t.WellDepth,
|
||||
Pressure = t.Pressure,
|
||||
HookWeight = t.HookWeight,
|
||||
BlockPosition = t.BlockPosition,
|
||||
BitDepth = t.BitDepth,
|
||||
RotorSpeed = t.RotorSpeed,
|
||||
AxialLoad = t.AxialLoad,
|
||||
}).ToArray();
|
||||
|
||||
if (detectableTelemetries.Length <= gap)
|
||||
break;
|
||||
@ -174,7 +174,7 @@ public class DetectedOperationService : IDetectedOperationService
|
||||
var isDetected = false;
|
||||
var positionBegin = 0;
|
||||
var positionEnd = detectableTelemetries.Length - gap;
|
||||
while (positionEnd > positionBegin)
|
||||
while (positionEnd > positionBegin)
|
||||
{
|
||||
foreach (var detector in detectors)
|
||||
{
|
||||
|
@ -19,14 +19,14 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
|
||||
{
|
||||
|
||||
var currentPoint = telemetry[position];
|
||||
if (currentPoint.Pressure <= 10)
|
||||
if (currentPoint.Pressure < 10)
|
||||
return false;
|
||||
|
||||
var delta = currentPoint.WellDepth - currentPoint.BitDepth;
|
||||
if (delta < 0.03d)
|
||||
return false;
|
||||
|
||||
if (currentPoint.RotorSpeed > 10.5)
|
||||
if (currentPoint.RotorSpeed > 8)
|
||||
return false;
|
||||
|
||||
var nextIndexPoint = telemetry.Length <= position ? position : position + 1;
|
||||
@ -34,7 +34,7 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
|
||||
if (Math.Abs(currentPoint.WellDepth - nextPoint.WellDepth) > 0)
|
||||
return false;
|
||||
|
||||
if (currentPoint.BitDepth <= 150)
|
||||
if (currentPoint.BitDepth < 150)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@ -49,7 +49,7 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
|
||||
return IdReasonOfEnd_PressureIsLo;
|
||||
if ((currentPoint.WellDepth - currentPoint.BitDepth) < 0.03d)
|
||||
return IdReasonOfEnd_DeltaWellDepthAndBithDepthIsLo;
|
||||
if (currentPoint.RotorSpeed > 10.5)
|
||||
if (currentPoint.RotorSpeed > 8)
|
||||
return IdReasonOfEnd_RotorSpeedIsHi;
|
||||
if (currentPoint.BitDepth < 150)
|
||||
return IdReasonOfEnd_BithDepthIsLo;
|
||||
|
@ -5,26 +5,22 @@
|
||||
Промывка – операция, во время которой давление условно постоянное, а вращение колонны отсутствует, талевый блок при этом может быть как в движении, так и статичным.
|
||||
|
||||
Промывка определяется как время между:
|
||||
- окончанием операции бурения или выходом на режим буровых насосов
|
||||
- началом операции проработки/шаблонировки перед наращиванием или остановкой буровых насосов
|
||||
- окончанием операции бурения или выходом на режим буровых насосов (рост давления)
|
||||
- началом операции проработки/шаблонировки перед наращиванием или остановкой буровых насосов (снижение давления).
|
||||
|
||||
## Метод определения
|
||||
|
||||
Признак начала операции =
|
||||
( давление > 10 атм ) И
|
||||
( обороты ротора <= 10.5 об/мин) И
|
||||
( давление >= 10 атм ) И
|
||||
( обороты ротора <= 8 об/мин) И
|
||||
( расстояние от долота до забоя >= 0.03 м) И
|
||||
( глубина забоя не изменяется) И
|
||||
( глубина долота > 150 м) И
|
||||
( положение блока не меняется) ИЛИ
|
||||
( положение блока уменьшается) ИЛИ
|
||||
( положение блока увеличивается --> дальше смотрим: если после остановки блока обороты ротора <= 10.5 об/мин);
|
||||
( глубина долота >= 150 м);
|
||||
|
||||
Признак окончания операции =
|
||||
( давление < 10 атм ) ИЛИ
|
||||
( расстояние от долота до забоя < 0.03 м ) ИЛИ
|
||||
( обороты ротора > 10.5 об/мин) ИЛИ
|
||||
( положение блока увеличивается --> дальше смотрим: если после остановки блока обороты ротора > 10.5 об/мин) ИЛИ
|
||||
( обороты ротора > 8 об/мин) ИЛИ
|
||||
( глубина долота < 150 м);
|
||||
|
||||
|
||||
|
@ -20,16 +20,11 @@ public class DetectorFlashingTests : DetectorFlashing
|
||||
Pressure = 21,
|
||||
WellDepth = 152,
|
||||
BitDepth = 151,
|
||||
RotorSpeed = 9,
|
||||
RotorSpeed = 8,
|
||||
DateTime = System.DateTimeOffset.Now
|
||||
};
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Тестирование операций, попадающей под автоопределение операции промывки, при этом
|
||||
/// - найден признак начала операции
|
||||
/// - не найден признак окончания операции
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void DetectOperation_find_startOperation_notFind_endOperation()
|
||||
{
|
||||
@ -50,9 +45,6 @@ public class DetectorFlashingTests : DetectorFlashing
|
||||
Assert.Equal(IdReasonOfEnd_NotDetected, result.Operation.ExtraData["IdReasonOfEnd"]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Операция, у которой глубина долота = 150м, не является промывкой
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void DetectOperation_with_BitDepth_LE_150_is_fail()
|
||||
{
|
||||
@ -70,13 +62,12 @@ public class DetectorFlashingTests : DetectorFlashing
|
||||
|
||||
//assert
|
||||
Assert.False(isDetectOperation);
|
||||
Assert.Null(result);
|
||||
Assert.NotNull(result);
|
||||
Assert.Equal(WellOperationCategory.IdFlashing, result.Operation.IdCategory);
|
||||
Assert.Equal(IdReasonOfEnd_NotDetected, result.Operation.ExtraData["IdReasonOfEnd"]);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Операция, у которой меняется глубина забоя, не является промывкой
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void DetectOperation_with_DeltaWellDepth_NotEqual_0_is_fail()
|
||||
{
|
||||
@ -95,12 +86,8 @@ public class DetectorFlashingTests : DetectorFlashing
|
||||
Assert.Null(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Найдены начальная и конечная операции промывки,
|
||||
/// Признак окончания операции - снижение давления менее 10 атм
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void DetectOperations_Begin_And_End_by_Pressure_Less_20_is_success()
|
||||
public void DetectOperations_Begin_And_End_by_Pressure_Less_10_is_success()
|
||||
{
|
||||
//arrange
|
||||
var point0 = telemetry.Copy();
|
||||
@ -120,6 +107,4 @@ public class DetectorFlashingTests : DetectorFlashing
|
||||
Assert.Equal(WellOperationCategory.IdFlashing, result.Operation.IdCategory);
|
||||
Assert.Equal(IdReasonOfEnd_PressureIsLo, result.Operation.ExtraData["IdReasonOfEnd"]);
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user