forked from ddrilling/AsbCloudServer
Edit Detectors for rotor and slide.
Add reason of end detecting operation.
This commit is contained in:
parent
a5a31d5d82
commit
499f7cc4e2
6300
AsbCloudDb/Migrations/20220809123505_Add_IdReasonOfEnd_to_DetectedOperation.Designer.cs
generated
Normal file
6300
AsbCloudDb/Migrations/20220809123505_Add_IdReasonOfEnd_to_DetectedOperation.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,27 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace AsbCloudDb.Migrations
|
||||
{
|
||||
public partial class Add_IdReasonOfEnd_to_DetectedOperation : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "id_reason_of_end",
|
||||
table: "t_detected_operation",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0,
|
||||
comment: "Код признака окончания операции");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "id_reason_of_end",
|
||||
table: "t_detected_operation");
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using System.Text.Json;
|
||||
using AsbCloudDb.Model;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
@ -60,7 +61,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("IdDeposit");
|
||||
|
||||
b.ToTable("t_cluster", (string)null);
|
||||
b.ToTable("t_cluster");
|
||||
|
||||
b.HasComment("Кусты");
|
||||
});
|
||||
@ -89,7 +90,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("IdCompanyType");
|
||||
|
||||
b.ToTable("t_company", (string)null);
|
||||
b.ToTable("t_company");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
@ -116,7 +117,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("t_company_type", (string)null);
|
||||
b.ToTable("t_company_type");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
@ -156,7 +157,7 @@ namespace AsbCloudDb.Migrations
|
||||
b.HasKey("IdWell", "StartDate")
|
||||
.HasName("t_id_well_date_start_pk");
|
||||
|
||||
b.ToTable("t_daily_report", (string)null);
|
||||
b.ToTable("t_daily_report");
|
||||
|
||||
b.HasComment("Ежедневные отчёты");
|
||||
});
|
||||
@ -190,7 +191,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("t_deposit", (string)null);
|
||||
b.ToTable("t_deposit");
|
||||
|
||||
b.HasComment("Месторождение");
|
||||
});
|
||||
@ -229,6 +230,11 @@ namespace AsbCloudDb.Migrations
|
||||
.HasColumnName("id_category")
|
||||
.HasComment("Id категории операции");
|
||||
|
||||
b.Property<int>("IdReasonOfEnd")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("id_reason_of_end")
|
||||
.HasComment("Код признака окончания операции");
|
||||
|
||||
b.Property<int>("IdTelemetry")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("id_telemetry");
|
||||
@ -249,7 +255,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("IdTelemetry");
|
||||
|
||||
b.ToTable("t_detected_operation", (string)null);
|
||||
b.ToTable("t_detected_operation");
|
||||
|
||||
b.HasComment("автоматически определенные операции по телеметрии");
|
||||
});
|
||||
@ -286,7 +292,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("t_driller", (string)null);
|
||||
b.ToTable("t_driller");
|
||||
|
||||
b.HasComment("Бурильщик");
|
||||
});
|
||||
@ -381,7 +387,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("IdWellOperationCategory");
|
||||
|
||||
b.ToTable("t_drill_flow_chart", (string)null);
|
||||
b.ToTable("t_drill_flow_chart");
|
||||
|
||||
b.HasComment("Параметры коридоров бурения (диапазоны параметров бурения)");
|
||||
});
|
||||
@ -410,7 +416,7 @@ namespace AsbCloudDb.Migrations
|
||||
b.HasIndex("IdWell", "IdFileCategory")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("t_drilling_program_part", (string)null);
|
||||
b.ToTable("t_drilling_program_part");
|
||||
|
||||
b.HasComment("части программ бурения");
|
||||
});
|
||||
@ -525,7 +531,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("IdWellSectionType");
|
||||
|
||||
b.ToTable("t_drill_params", (string)null);
|
||||
b.ToTable("t_drill_params");
|
||||
|
||||
b.HasComment("Режим бурения в секции (диапазоны параметров бурения)");
|
||||
});
|
||||
@ -551,7 +557,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("t_file_category", (string)null);
|
||||
b.ToTable("t_file_category");
|
||||
|
||||
b.HasComment("Категории файлов");
|
||||
|
||||
@ -725,7 +731,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("IdWell");
|
||||
|
||||
b.ToTable("t_file_info", (string)null);
|
||||
b.ToTable("t_file_info");
|
||||
|
||||
b.HasComment("Файлы всех категорий");
|
||||
});
|
||||
@ -776,7 +782,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("IdUser");
|
||||
|
||||
b.ToTable("t_file_mark", (string)null);
|
||||
b.ToTable("t_file_mark");
|
||||
|
||||
b.HasComment("Действия с файлами.");
|
||||
});
|
||||
@ -821,7 +827,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("IdWell");
|
||||
|
||||
b.ToTable("t_measure", (string)null);
|
||||
b.ToTable("t_measure");
|
||||
|
||||
b.HasComment("Таблица c данными для вкладки 'Последние данные'");
|
||||
});
|
||||
@ -847,7 +853,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("t_measure_category", (string)null);
|
||||
b.ToTable("t_measure_category");
|
||||
|
||||
b.HasComment("Категория последних данных");
|
||||
|
||||
@ -918,7 +924,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("IdWell");
|
||||
|
||||
b.ToTable("t_operationvalue", (string)null);
|
||||
b.ToTable("t_operationvalue");
|
||||
|
||||
b.HasComment("Целевые/нормативные показатели операции");
|
||||
});
|
||||
@ -946,7 +952,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("t_permission", (string)null);
|
||||
b.ToTable("t_permission");
|
||||
|
||||
b.HasComment("Разрешения на доступ к данным");
|
||||
|
||||
@ -1663,7 +1669,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("IdWell");
|
||||
|
||||
b.ToTable("t_relation_company_well", (string)null);
|
||||
b.ToTable("t_relation_company_well");
|
||||
|
||||
b.HasComment("отношение скважин и компаний");
|
||||
});
|
||||
@ -1688,7 +1694,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("IdDrillingProgramPart");
|
||||
|
||||
b.ToTable("t_relation_user_drilling_program_part", (string)null);
|
||||
b.ToTable("t_relation_user_drilling_program_part");
|
||||
|
||||
b.HasComment("Отношение пользователей и частей ПБ");
|
||||
});
|
||||
@ -1707,7 +1713,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("IdPermission");
|
||||
|
||||
b.ToTable("t_relation_user_role_permission", (string)null);
|
||||
b.ToTable("t_relation_user_role_permission");
|
||||
|
||||
b.HasComment("Отношение ролей пользователей и разрешений доступа");
|
||||
|
||||
@ -2289,7 +2295,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("IdInclude");
|
||||
|
||||
b.ToTable("t_relation_user_role_user_role", (string)null);
|
||||
b.ToTable("t_relation_user_role_user_role");
|
||||
|
||||
b.HasComment("Отношение ролей к ролям");
|
||||
|
||||
@ -2580,7 +2586,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("IdUserRole");
|
||||
|
||||
b.ToTable("t_relation_user_user_role", (string)null);
|
||||
b.ToTable("t_relation_user_user_role");
|
||||
|
||||
b.HasComment("Отношение пользователей и ролей");
|
||||
|
||||
@ -2636,7 +2642,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("IdWell");
|
||||
|
||||
b.ToTable("t_report_property", (string)null);
|
||||
b.ToTable("t_report_property");
|
||||
|
||||
b.HasComment("Отчеты с данными по буровым");
|
||||
});
|
||||
@ -2687,7 +2693,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("IdWell");
|
||||
|
||||
b.ToTable("t_schedule", (string)null);
|
||||
b.ToTable("t_schedule");
|
||||
|
||||
b.HasComment("График работы бурильщика");
|
||||
});
|
||||
@ -2741,7 +2747,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("IdWell");
|
||||
|
||||
b.ToTable("t_setpoints_rquest", (string)null);
|
||||
b.ToTable("t_setpoints_rquest");
|
||||
|
||||
b.HasComment("Запросы на изменение уставок панели оператора");
|
||||
});
|
||||
@ -2774,7 +2780,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex(new[] { "RemoteUid" }, "t_telemetry_remote_uid_index");
|
||||
|
||||
b.ToTable("t_telemetry", (string)null);
|
||||
b.ToTable("t_telemetry");
|
||||
|
||||
b.HasComment("таблица привязки телеметрии от комплектов к конкретной скважине.");
|
||||
});
|
||||
@ -2977,7 +2983,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasKey("IdTelemetry", "DateTime");
|
||||
|
||||
b.ToTable("t_telemetry_data_saub", (string)null);
|
||||
b.ToTable("t_telemetry_data_saub");
|
||||
|
||||
b.HasComment("набор основных данных по SAUB");
|
||||
});
|
||||
@ -3318,7 +3324,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasKey("IdTelemetry", "DateTime");
|
||||
|
||||
b.ToTable("t_telemetry_data_spin", (string)null);
|
||||
b.ToTable("t_telemetry_data_spin");
|
||||
|
||||
b.HasComment("набор основных данных по SpinMaster");
|
||||
});
|
||||
@ -3343,7 +3349,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasKey("IdTelemetry", "IdEvent");
|
||||
|
||||
b.ToTable("t_telemetry_event", (string)null);
|
||||
b.ToTable("t_telemetry_event");
|
||||
|
||||
b.HasComment("Справочник событий. События формируют сообщения. Разделено по версиям посылок от телеметрии.");
|
||||
});
|
||||
@ -3403,7 +3409,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("IdTelemetry");
|
||||
|
||||
b.ToTable("t_telemetry_message", (string)null);
|
||||
b.ToTable("t_telemetry_message");
|
||||
|
||||
b.HasComment("Сообщения на буровых");
|
||||
});
|
||||
@ -3439,7 +3445,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasKey("IdTelemetry", "IdUser");
|
||||
|
||||
b.ToTable("t_telemetry_user", (string)null);
|
||||
b.ToTable("t_telemetry_user");
|
||||
|
||||
b.HasComment("Пользователи панели САУБ. Для сообщений.");
|
||||
});
|
||||
@ -3516,7 +3522,7 @@ namespace AsbCloudDb.Migrations
|
||||
b.HasIndex("Login")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("t_user", (string)null);
|
||||
b.ToTable("t_user");
|
||||
|
||||
b.HasComment("Пользователи облака");
|
||||
|
||||
@ -3553,7 +3559,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("t_user_role", (string)null);
|
||||
b.ToTable("t_user_role");
|
||||
|
||||
b.HasComment("Роли пользователей в системе");
|
||||
|
||||
@ -3884,14 +3890,14 @@ namespace AsbCloudDb.Migrations
|
||||
.HasColumnName("key")
|
||||
.HasComment("Ключ настроек пользователя");
|
||||
|
||||
b.Property<object>("Value")
|
||||
b.Property<JsonDocument>("Value")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("setting_value")
|
||||
.HasComment("Значение настроек пользователя");
|
||||
|
||||
b.HasKey("IdUser", "Key");
|
||||
|
||||
b.ToTable("t_user_settings", (string)null);
|
||||
b.ToTable("t_user_settings");
|
||||
|
||||
b.HasComment("настройки интерфейса пользователя");
|
||||
});
|
||||
@ -3949,7 +3955,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("IdWellType");
|
||||
|
||||
b.ToTable("t_well", (string)null);
|
||||
b.ToTable("t_well");
|
||||
|
||||
b.HasComment("скважины");
|
||||
});
|
||||
@ -3977,7 +3983,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("IdWellSrc");
|
||||
|
||||
b.ToTable("t_well_composite", (string)null);
|
||||
b.ToTable("t_well_composite");
|
||||
|
||||
b.HasComment("Композитная скважина");
|
||||
});
|
||||
@ -4053,7 +4059,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("IdWellSectionType");
|
||||
|
||||
b.ToTable("t_well_operation", (string)null);
|
||||
b.ToTable("t_well_operation");
|
||||
|
||||
b.HasComment("Данные по операциям на скважине");
|
||||
});
|
||||
@ -4091,7 +4097,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("t_well_operation_category", (string)null);
|
||||
b.ToTable("t_well_operation_category");
|
||||
|
||||
b.HasComment("Справочник операций на скважине");
|
||||
|
||||
@ -4700,7 +4706,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("t_well_section_type", (string)null);
|
||||
b.ToTable("t_well_section_type");
|
||||
|
||||
b.HasComment("конструкция секции скважины");
|
||||
|
||||
@ -4875,7 +4881,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("t_well_type", (string)null);
|
||||
b.ToTable("t_well_type");
|
||||
|
||||
b.HasComment("конструкция скважины");
|
||||
|
||||
@ -4932,7 +4938,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasKey("IdTelemetry", "DateTime");
|
||||
|
||||
b.ToTable("t_telemetry_wits_base", (string)null);
|
||||
b.ToTable("t_telemetry_wits_base");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("AsbCloudDb.Model.WITS.Record1", b =>
|
||||
@ -5096,7 +5102,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("TelemetryId");
|
||||
|
||||
b.ToTable("t_telemetry_wits_1", (string)null);
|
||||
b.ToTable("t_telemetry_wits_1");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("AsbCloudDb.Model.WITS.Record50", b =>
|
||||
@ -5184,7 +5190,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("TelemetryId");
|
||||
|
||||
b.ToTable("t_telemetry_wits_50", (string)null);
|
||||
b.ToTable("t_telemetry_wits_50");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("AsbCloudDb.Model.WITS.Record60", b =>
|
||||
@ -5236,7 +5242,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("TelemetryId");
|
||||
|
||||
b.ToTable("t_telemetry_wits_60", (string)null);
|
||||
b.ToTable("t_telemetry_wits_60");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("AsbCloudDb.Model.WITS.Record61", b =>
|
||||
@ -5292,7 +5298,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("TelemetryId");
|
||||
|
||||
b.ToTable("t_telemetry_wits_61", (string)null);
|
||||
b.ToTable("t_telemetry_wits_61");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("AsbCloudDb.Model.WITS.Record7", b =>
|
||||
@ -5380,7 +5386,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("TelemetryId");
|
||||
|
||||
b.ToTable("t_telemetry_wits_7", (string)null);
|
||||
b.ToTable("t_telemetry_wits_7");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("AsbCloudDb.Model.WITS.Record8", b =>
|
||||
@ -5584,7 +5590,7 @@ namespace AsbCloudDb.Migrations
|
||||
|
||||
b.HasIndex("TelemetryId");
|
||||
|
||||
b.ToTable("t_telemetry_wits_8", (string)null);
|
||||
b.ToTable("t_telemetry_wits_8");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("AsbCloudDb.Model.Cluster", b =>
|
||||
|
@ -41,6 +41,9 @@ namespace AsbCloudDb.Model
|
||||
[Column("value"), Comment("Ключевой показатель операции")]
|
||||
public double Value { get; set; }
|
||||
|
||||
[Column("id_reason_of_end"), Comment("Код признака окончания операции")]
|
||||
public int IdReasonOfEnd { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey(nameof(IdTelemetry))]
|
||||
public virtual Telemetry Telemetry { get; set; }
|
||||
|
@ -1,6 +1,5 @@
|
||||
using AsbCloudDb.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
|
||||
@ -11,6 +10,30 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
|
||||
private readonly int idOperation;
|
||||
private readonly int stepLength = 3;
|
||||
|
||||
protected const int IdReasonOfEnd_NotDetected = 0;
|
||||
protected const int IdReasonOfEnd_NotDetectBegin = 1;
|
||||
|
||||
protected const int IdReasonOfEnd_DeltaDepthIsLo = 100;
|
||||
protected const int IdReasonOfEnd_DeltaDepthIsHi = 101;
|
||||
protected const int IdReasonOfEnd_DeltaDepthOutOfRange = 102;
|
||||
protected const int IdReasonOfEnd_WellDepthDeviates = 200;
|
||||
|
||||
protected const int IdReasonOfEnd_PressureIsLo = 300;
|
||||
protected const int IdReasonOfEnd_PressureIsHi = 301;
|
||||
protected const int IdReasonOfEnd_PressureOutOfRange = 302;
|
||||
protected const int IdReasonOfEnd_PressureIsRising = 303;
|
||||
|
||||
protected const int IdReasonOfEnd_RotorSpeedIsLo = 400;
|
||||
protected const int IdReasonOfEnd_RotorSpeedIsHi = 401;
|
||||
protected const int IdReasonOfEnd_AvgRotorSpeedIsHi = 402;
|
||||
protected const int IdReasonOfEnd_AvgRotorSpeedIsLo = 403;
|
||||
|
||||
protected const int IdReasonOfEnd_BlockPositionIsLo = 500;
|
||||
protected const int IdReasonOfEnd_BlockPositionIsHi = 501;
|
||||
protected const int IdReasonOfEnd_BlockPositionDeviates = 502;
|
||||
|
||||
protected const int IdReasonOfEnd_Custom1 = 10_000;
|
||||
|
||||
protected DetectorAbstract(int idOperation)
|
||||
{
|
||||
this.idOperation = idOperation;
|
||||
@ -29,9 +52,10 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
|
||||
if ((positionEnd > end))
|
||||
break;
|
||||
|
||||
if (DetectEnd(telemetry, positionEnd, previousOperation))
|
||||
var idReasonOfEnd = DetectEnd(telemetry, positionEnd, previousOperation);
|
||||
if (idReasonOfEnd != IdReasonOfEnd_NotDetected)
|
||||
{
|
||||
result = MakeOperation(idTelemetry, telemetry, begin, positionEnd);
|
||||
result = MakeOperation(idTelemetry, telemetry, begin, positionEnd, idReasonOfEnd);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -41,10 +65,12 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
|
||||
}
|
||||
|
||||
protected abstract bool DetectBegin(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation);
|
||||
protected virtual bool DetectEnd(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
||||
=> !DetectBegin(telemetry, position, previousOperation);
|
||||
protected virtual int DetectEnd(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
||||
=> DetectBegin(telemetry, position, previousOperation)
|
||||
? IdReasonOfEnd_NotDetected
|
||||
: IdReasonOfEnd_NotDetectBegin;
|
||||
|
||||
private OperationDetectorResult MakeOperation(int idTelemetry, DetectableTelemetry[] telemetry, int begin, int end)
|
||||
private OperationDetectorResult MakeOperation(int idTelemetry, DetectableTelemetry[] telemetry, int begin, int end, int idReasonOfEnd)
|
||||
{
|
||||
var pBegin = telemetry[begin];
|
||||
var pEnd = telemetry[end];
|
||||
@ -62,6 +88,7 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
|
||||
DepthStart = (double)pBegin.WellDepth,
|
||||
DepthEnd = (double)pEnd.WellDepth,
|
||||
Value = CalcValue(telemetry, begin, end),
|
||||
IdReasonOfEnd = idReasonOfEnd,
|
||||
},
|
||||
};
|
||||
return result;
|
||||
|
@ -36,23 +36,23 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override bool DetectEnd(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
||||
protected override int DetectEnd(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
||||
{
|
||||
var point0 = telemetry[position];
|
||||
var delta = point0.WellDepth - point0.BitDepth;
|
||||
if (delta < 0.03d || delta > 30)
|
||||
return true;
|
||||
return IdReasonOfEnd_DeltaDepthOutOfRange;
|
||||
|
||||
if (point0.Pressure < 15)
|
||||
return true;
|
||||
return IdReasonOfEnd_PressureIsLo;
|
||||
|
||||
if (point0.BlockPosition > 31)
|
||||
return true;
|
||||
return IdReasonOfEnd_BlockPositionIsHi;
|
||||
|
||||
if (point0.RotorSpeed < 10)
|
||||
return true;
|
||||
return IdReasonOfEnd_RotorSpeedIsLo;
|
||||
|
||||
return false;
|
||||
return IdReasonOfEnd_NotDetected;
|
||||
}
|
||||
|
||||
protected override bool IsValid(DetectableTelemetry[] telemetry, int begin, int end)
|
||||
|
@ -34,16 +34,16 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override bool DetectEnd(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
||||
protected override int DetectEnd(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
||||
{
|
||||
var point0 = telemetry[position];
|
||||
var delta = point0.WellDepth - point0.BitDepth;
|
||||
if ((delta > 0.03d )
|
||||
&& (point0.Pressure > 15)
|
||||
&& ContainsDeviationApprox(telemetry, t=>t.BlockPosition, position, 60, 0.03))
|
||||
return true;
|
||||
return IdReasonOfEnd_Custom1;
|
||||
|
||||
return false;
|
||||
return IdReasonOfEnd_NotDetected;
|
||||
}
|
||||
|
||||
protected override bool IsValid(DetectableTelemetry[] telemetry, int begin, int end)
|
||||
|
@ -34,16 +34,16 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override bool DetectEnd(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
||||
protected override int DetectEnd(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
||||
{
|
||||
var point0 = telemetry[position];
|
||||
var delta = point0.WellDepth - point0.BitDepth;
|
||||
if ((delta > 0.03d )
|
||||
&& (point0.Pressure > 15)
|
||||
&& ContainsDeviationApprox(telemetry, t=>t.BlockPosition, position, 60, 0.03))
|
||||
return true;
|
||||
return IdReasonOfEnd_Custom1;
|
||||
|
||||
return false;
|
||||
return IdReasonOfEnd_NotDetected;
|
||||
}
|
||||
|
||||
protected override bool IsValid(DetectableTelemetry[] telemetry, int begin, int end)
|
||||
|
@ -28,25 +28,25 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override bool DetectEnd(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
||||
protected override int DetectEnd(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
||||
{
|
||||
var point0 = telemetry[position];
|
||||
var delta = point0.WellDepth - point0.BitDepth;
|
||||
if (delta > 0.03d)
|
||||
return true;
|
||||
return IdReasonOfEnd_DeltaDepthIsHi;
|
||||
|
||||
if (point0.Pressure < 25)
|
||||
return true;
|
||||
return IdReasonOfEnd_PressureIsLo;
|
||||
|
||||
var lineRotorSpeed = MakeInterpolationLine(d => d.RotorSpeed, telemetry, position, 10);
|
||||
|
||||
if (lineRotorSpeed.IsAverageYLessThan(5))
|
||||
return true;
|
||||
return IdReasonOfEnd_AvgRotorSpeedIsLo;
|
||||
|
||||
if (!DeviatesFromBegin(telemetry, t => t.WellDepth, position, 60, 0.003))
|
||||
return true;
|
||||
if (!DeviatesFromBegin(telemetry, t => t.WellDepth, position, 150, 0.003))
|
||||
return IdReasonOfEnd_WellDepthDeviates;
|
||||
|
||||
return false;
|
||||
return IdReasonOfEnd_NotDetected;
|
||||
}
|
||||
|
||||
protected override bool IsValid(DetectableTelemetry[] telemetry, int begin, int end)
|
||||
|
@ -28,25 +28,25 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override bool DetectEnd(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
||||
protected override int DetectEnd(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
||||
{
|
||||
var point0 = telemetry[position];
|
||||
var delta = point0.WellDepth - point0.BitDepth;
|
||||
if (delta > 0.03d)
|
||||
return true;
|
||||
return IdReasonOfEnd_DeltaDepthIsHi;
|
||||
|
||||
if (point0.Pressure < 25)
|
||||
return true;
|
||||
return IdReasonOfEnd_PressureIsLo;
|
||||
|
||||
var lineRotorSpeed = MakeInterpolationLine(d => d.RotorSpeed, telemetry, position, 10);
|
||||
|
||||
if (lineRotorSpeed.IsAverageYGreaterThan(5))
|
||||
return true;
|
||||
return IdReasonOfEnd_AvgRotorSpeedIsHi;
|
||||
|
||||
if (!DeviatesFromBegin(telemetry, t => t.WellDepth, position, 60, 0.003))
|
||||
return true;
|
||||
if (!DeviatesFromBegin(telemetry, t => t.WellDepth, position, 150, 0.003))
|
||||
return IdReasonOfEnd_WellDepthDeviates;
|
||||
|
||||
return false;
|
||||
return IdReasonOfEnd_NotDetected;
|
||||
}
|
||||
|
||||
protected override bool IsValid(DetectableTelemetry[] telemetry, int begin, int end)
|
||||
|
@ -37,24 +37,24 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override bool DetectEnd(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
||||
protected override int DetectEnd(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
||||
{
|
||||
var point0 = telemetry[position];
|
||||
|
||||
var delta = point0.WellDepth - point0.BitDepth;
|
||||
if (delta > 2.5d )
|
||||
return true;
|
||||
return IdReasonOfEnd_DeltaDepthIsHi;
|
||||
|
||||
if (point0.RotorSpeed > 30)
|
||||
return true;
|
||||
return IdReasonOfEnd_RotorSpeedIsHi;
|
||||
|
||||
if (RisesFromBegin(telemetry, t => t.Pressure, position, 10, 15))
|
||||
return true;
|
||||
return IdReasonOfEnd_PressureIsRising;
|
||||
|
||||
if (ContainsDeviation(telemetry, t => t.BlockPosition, position, 10, 0.05))
|
||||
return true;
|
||||
return IdReasonOfEnd_BlockPositionDeviates;
|
||||
|
||||
return false;
|
||||
return IdReasonOfEnd_NotDetected;
|
||||
}
|
||||
|
||||
protected override bool IsValid(DetectableTelemetry[] telemetry, int begin, int end)
|
||||
|
@ -37,23 +37,23 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override bool DetectEnd(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
||||
protected override int DetectEnd(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
|
||||
{
|
||||
var point0 = telemetry[position];
|
||||
var delta = point0.WellDepth - point0.BitDepth;
|
||||
if (delta < 0.03d || delta > 30)
|
||||
return true;
|
||||
return IdReasonOfEnd_DeltaDepthOutOfRange;
|
||||
|
||||
if (point0.Pressure < 15)
|
||||
return true;
|
||||
return IdReasonOfEnd_PressureIsLo;
|
||||
|
||||
if (point0.BlockPosition > 31)
|
||||
return true;
|
||||
return IdReasonOfEnd_BlockPositionIsHi;
|
||||
|
||||
if (point0.RotorSpeed > 10)
|
||||
return true;
|
||||
return IdReasonOfEnd_RotorSpeedIsHi;
|
||||
|
||||
return false;
|
||||
return IdReasonOfEnd_NotDetected;
|
||||
}
|
||||
|
||||
protected override bool IsValid(DetectableTelemetry[] telemetry, int begin, int end)
|
||||
|
@ -13,7 +13,7 @@
|
||||
( расстояние от долота до забоя > 0.03м ) ИЛИ
|
||||
( давление < 25атм ) ИЛИ
|
||||
( среднее арифметическое оборотов ротора за 10 сек < 5 об/м ) ИЛИ
|
||||
( глубина забоя в течении следующих 60 сек не изменяется больше чем на 0.003 );
|
||||
( глубина забоя в течении следующих 150 сек не изменяется больше чем на 0.003 );
|
||||
|
||||
## Метод определения бурения в слайде
|
||||
Повторяет метод определения бурения в роторе, за исключением условия с оборотами ротора. Это уловие нужно инвертировать.
|
||||
|
Loading…
Reference in New Issue
Block a user