This commit is contained in:
Фролов 2022-12-08 18:00:01 +05:00
parent 9ebcfbcc28
commit c2b003bf8a
20 changed files with 34522 additions and 106 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,34 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AsbCloudDb.Migrations
{
public partial class WellOperations_delete_categories : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "t_well_operation_category",
keyColumn: "id",
keyValue: 22);
migrationBuilder.DeleteData(
table: "t_well_operation_category",
keyColumn: "id",
keyValue: 1027);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.InsertData(
table: "t_well_operation_category",
columns: new[] { "id", "id_parent", "key_value_name", "key_value_units", "name" },
values: new object[,]
{
{ 22, 4012, "dT", "мин", "Промывка" },
{ 1027, 4012, "dT", "мин", "Промывка" }
});
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AsbCloudDb.Migrations
{
public partial class WellOperations_unite_categiries : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(
"UPDATE public.t_well_operation SET id_category=60018 WHERE id_category=14;" +
"UPDATE public.t_well_operation SET id_category=2027 WHERE id_category = 1018;" +
"UPDATE public.t_well_operation SET id_category=60028 WHERE id_category = 1020;" +
"UPDATE public.t_well_operation SET id_category=60004 WHERE id_category = 1032;" +
"UPDATE public.t_well_operation SET id_category=60026 WHERE id_category = 2001;" +
"UPDATE public.t_well_operation SET id_category=60017 WHERE id_category = 2002;" +
"UPDATE public.t_well_operation SET id_category=60020 WHERE id_category = 2012;" +
"UPDATE public.t_well_operation SET id_category=60019 WHERE id_category = 2014;" +
"UPDATE public.t_well_operation SET id_category=60023 WHERE id_category = 2015;");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,76 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AsbCloudDb.Migrations
{
public partial class WellOperations_delete_categiries : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "t_well_operation_category",
keyColumn: "id",
keyValue: 14);
migrationBuilder.DeleteData(
table: "t_well_operation_category",
keyColumn: "id",
keyValue: 1018);
migrationBuilder.DeleteData(
table: "t_well_operation_category",
keyColumn: "id",
keyValue: 1020);
migrationBuilder.DeleteData(
table: "t_well_operation_category",
keyColumn: "id",
keyValue: 1032);
migrationBuilder.DeleteData(
table: "t_well_operation_category",
keyColumn: "id",
keyValue: 2001);
migrationBuilder.DeleteData(
table: "t_well_operation_category",
keyColumn: "id",
keyValue: 2002);
migrationBuilder.DeleteData(
table: "t_well_operation_category",
keyColumn: "id",
keyValue: 2012);
migrationBuilder.DeleteData(
table: "t_well_operation_category",
keyColumn: "id",
keyValue: 2014);
migrationBuilder.DeleteData(
table: "t_well_operation_category",
keyColumn: "id",
keyValue: 2015);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.InsertData(
table: "t_well_operation_category",
columns: new[] { "id", "id_parent", "key_value_name", "key_value_units", "name" },
values: new object[,]
{
{ 14, 4004, "dT", "мин", "Удержание в клиньях" },
{ 1018, 4013, "dT", "мин", "Перетяжка талевого каната" },
{ 1020, 4005, "dT", "мин", "Подъем инструмента" },
{ 1032, 4005, "dT", "мин", "Спуск инструмента" },
{ 2001, 4003, "dT", "мин", "Проработка во время бурения" },
{ 2002, 4003, "dT", "мин", "Шаблонировка во время бурения" },
{ 2012, 4011, "dT", "мин", "Комплекс ГИС на трубах" },
{ 2014, 4011, "dT", "мин", "Комплекс ГИС на кабеле" },
{ 2015, 4012, "dT", "мин", "Приготовление БР" }
});
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,20 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AsbCloudDb.Migrations
{
public partial class Truncate_detected_operations : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
// требуется для повторного анализа
migrationBuilder.Sql("TRUNCATE t_detected_operation;");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,25 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AsbCloudDb.Migrations
{
public partial class Add_lost_WellOperationCategory : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.InsertData(
table: "t_well_operation_category",
columns: new[] { "id", "id_parent", "key_value_name", "key_value_units", "name" },
values: new object[] { 60029, 4013, "dT", "мин", "Тех.отстой" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "t_well_operation_category",
keyColumn: "id",
keyValue: 60029);
}
}
}

View File

@ -4335,14 +4335,6 @@ namespace AsbCloudDb.Migrations
b.HasComment("Справочник операций на скважине");
b.HasData(
new
{
Id = 14,
IdParent = 4004,
KeyValueName = "dT",
KeyValueUnits = "мин",
Name = "Удержание в клиньях"
},
new
{
Id = 18,
@ -4368,14 +4360,6 @@ namespace AsbCloudDb.Migrations
Name = "Промывка перед наращиванием"
},
new
{
Id = 22,
IdParent = 4012,
KeyValueName = "dT",
KeyValueUnits = "мин",
Name = "Промывка"
},
new
{
Id = 1004,
IdParent = 4013,
@ -4416,22 +4400,6 @@ namespace AsbCloudDb.Migrations
Name = "Опрессовка ПВО"
},
new
{
Id = 1018,
IdParent = 4013,
KeyValueName = "dT",
KeyValueUnits = "мин",
Name = "Перетяжка талевого каната"
},
new
{
Id = 1020,
IdParent = 4005,
KeyValueName = "dT",
KeyValueUnits = "мин",
Name = "Подъем инструмента"
},
new
{
Id = 1025,
IdParent = 4000,
@ -4448,14 +4416,6 @@ namespace AsbCloudDb.Migrations
Name = "Разборка КНБК"
},
new
{
Id = 1027,
IdParent = 4012,
KeyValueName = "dT",
KeyValueUnits = "мин",
Name = "Промывка"
},
new
{
Id = 1030,
IdParent = 4012,
@ -4464,14 +4424,6 @@ namespace AsbCloudDb.Migrations
Name = "Разбуривание тех.оснастки"
},
new
{
Id = 1032,
IdParent = 4005,
KeyValueName = "dT",
KeyValueUnits = "мин",
Name = "Спуск инструмента"
},
new
{
Id = 1044,
IdParent = 4013,
@ -4512,22 +4464,6 @@ namespace AsbCloudDb.Migrations
Name = "Промывка при спуске ОК"
},
new
{
Id = 2001,
IdParent = 4003,
KeyValueName = "dT",
KeyValueUnits = "мин",
Name = "Проработка во время бурения"
},
new
{
Id = 2002,
IdParent = 4003,
KeyValueName = "dT",
KeyValueUnits = "мин",
Name = "Шаблонировка во время бурения"
},
new
{
Id = 2003,
IdParent = 4004,
@ -4600,14 +4536,6 @@ namespace AsbCloudDb.Migrations
Name = "Подъем приборов ГИС (на трубах)"
},
new
{
Id = 2012,
IdParent = 4011,
KeyValueName = "dT",
KeyValueUnits = "мин",
Name = "Комплекс ГИС на трубах"
},
new
{
Id = 2013,
IdParent = 4011,
@ -4616,22 +4544,6 @@ namespace AsbCloudDb.Migrations
Name = "Комплекс ГИС на жестком кабеле"
},
new
{
Id = 2014,
IdParent = 4011,
KeyValueName = "dT",
KeyValueUnits = "мин",
Name = "Комплекс ГИС на кабеле"
},
new
{
Id = 2015,
IdParent = 4012,
KeyValueName = "dT",
KeyValueUnits = "мин",
Name = "Приготовление БР"
},
new
{
Id = 2016,
IdParent = 4012,
@ -5240,6 +5152,14 @@ namespace AsbCloudDb.Migrations
KeyValueName = "dT",
KeyValueUnits = "мин",
Name = "Подъем инструмента"
},
new
{
Id = 60029,
IdParent = 4013,
KeyValueName = "dT",
KeyValueUnits = "мин",
Name = "Тех.отстой"
});
});

View File

@ -3,8 +3,7 @@
internal class EntityFillerWellOperationCategory : EntityFiller<WellOperationCategory>
{
public override WellOperationCategory[] GetData() => new WellOperationCategory[]{
// Автоматически определяемые операции
new () {Id = 14, IdParent = 4004, Name = "Удержание в клиньях" , KeyValueName = "dT", KeyValueUnits = "мин" },
// Автоматически определяемые операции
new () {Id = 18, IdParent = 4003, Name = "Проработка перед наращиванием" , KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 19, IdParent = 4003, Name = "Шаблонировка перед наращиванием" , KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 20, IdParent = 4003, Name = "Промывка перед наращиванием" , KeyValueName = "dT", KeyValueUnits = "мин" },
@ -14,20 +13,15 @@
new () {Id = 1007, IdParent = 4013, Name = "Оборудование устья" , KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 1008, IdParent = 4007, Name = "ОЗЦ" , KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 1013, IdParent = 4013, Name = "Опрессовка ПВО" , KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 1018, IdParent = 4013, Name = "Перетяжка талевого каната" , KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 1020, IdParent = 4005, Name = "Подъем инструмента" , KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 1025, IdParent = 4000, Name = "Сборка КНБК" , KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 1026, IdParent = 4000, Name = "Разборка КНБК" , KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 1030, IdParent = 4012, Name = "Разбуривание тех.оснастки" , KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 1032, IdParent = 4005, Name = "Спуск инструмента" , KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 1044, IdParent = 4013, Name = "ВМР" , KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 1046, IdParent = 4005, Name = "Спуск КНБК" , KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 1047, IdParent = 4005, Name = "Подъем КНБК" , KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 1048, IdParent = 4006, Name = "Спуск ОК" , KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 1050, IdParent = 4006, Name = "Промывка при спуске ОК" , KeyValueName = "dT", KeyValueUnits = "мин" },
//Добавленные согласно постановке задачи
new () {Id = 2001 ,IdParent=4003, Name = "Проработка во время бурения", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 2002 ,IdParent=4003, Name = "Шаблонировка во время бурения", KeyValueName = "dT", KeyValueUnits = "мин" },
//Добавленные согласно постановке задачи
new () {Id = 2003, IdParent=4004, Name = "Наращивание", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 2004, IdParent=4008, Name = "ПЗР при спуске ОК", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 2005, IdParent=4008, Name = "ПЗР при цементировании", KeyValueName = "dT", KeyValueUnits = "мин" },
@ -37,10 +31,7 @@
new () {Id = 2009,IdParent=4009, Name = "Разборка комплекса приборов ГИС", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 2010,IdParent=4010, Name = "Спуск приборов ГИС (на трубах)", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 2011,IdParent=4010, Name = "Подъем приборов ГИС (на трубах)", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 2012,IdParent=4011, Name = "Комплекс ГИС на трубах", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 2013,IdParent=4011, Name = "Комплекс ГИС на жестком кабеле", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 2014,IdParent=4011, Name = "Комплекс ГИС на кабеле", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 2015,IdParent=4012, Name = "Приготовление БР", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 2016,IdParent=4012, Name = "Ориентирование ТС при бурении", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 2017,IdParent=4013, Name = "Наработка жёлоба", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 2018,IdParent=4013, Name = "Тайм-дриллинг", KeyValueName = "dT", KeyValueUnits = "мин" },
@ -127,6 +118,7 @@
new () {Id = 60023, IdParent=4012, Name = "Приготовление БР", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 60026 ,IdParent=4003, Name = "Проработка во время бурения", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 60028, IdParent=4005, Name = "Подъем инструмента", KeyValueName = "dT", KeyValueUnits = "мин" },
new () {Id = 60029, IdParent=4013, Name = "Тех.отстой", KeyValueName = "dT", KeyValueUnits = "мин" },
};
}
}

View File

@ -3,6 +3,9 @@
namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
{
#nullable enable
/// <summary>
/// Проработка перед наращиванием
/// </summary>
internal class DetectorDevelopment : DetectorAbstract
{
public DetectorDevelopment()

View File

@ -9,7 +9,7 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
internal class DetectorFlashing : DetectorAbstract
{
public DetectorFlashing()
: base(22) { }
: base(60014) { }
protected override double CalcValue(DetectableTelemetry[] telemetry, int begin, int end)
=> CalcDeltaMinutes(telemetry, begin, end);

View File

@ -6,7 +6,7 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
internal class DetectorRotor : DetectorAbstract
{
public DetectorRotor()
: base(2) { }
: base(60001) { }
protected override bool DetectBegin(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
{

View File

@ -6,7 +6,7 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
internal class DetectorSlide : DetectorAbstract
{
public DetectorSlide()
: base(3) { }
: base(60002) { }
protected override bool DetectBegin(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
{

View File

@ -6,7 +6,8 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
internal class DetectorSlipsTime : DetectorAbstract
{
public DetectorSlipsTime()
: base(14) { }
: base(60018)
{ }
protected override double CalcValue(DetectableTelemetry[] telemetry, int begin, int end)
=> CalcDeltaMinutes(telemetry, begin, end);

View File

@ -12,7 +12,7 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
internal class DetectorStaticSurveying: DetectorAbstract
{
public DetectorStaticSurveying()
: base(21) { }
: base(60003) { }
protected override bool DetectBegin(DetectableTelemetry[] telemetry, int position, DetectedOperation? previousOperation)
{

View File

@ -9,7 +9,7 @@ namespace AsbCloudInfrastructure.Services.DetectOperations.Detectors
internal class DetectorTemplatingWhileDrilling : DetectorAbstract
{
public DetectorTemplatingWhileDrilling()
: base(23) { }
: base(60017) { }
protected override double CalcValue(DetectableTelemetry[] telemetry, int begin, int end)
=> CalcDeltaMinutes(telemetry, begin, end);

View File

@ -1,4 +1,4 @@
# Алгоритм определения шаблонировки перед наращиванием
# Алгоритм определения проработки перед наращиванием
## Описание
Проработка перед наращиванием бурильного инструмента операция, во время которой после добуривания очередной трубы/ свечи начинается подъем и спуск бурильного инструмента с вращением. Следующей операцией после проработки будет либо шаблонировка (аналогично проработке, но без вращения), либо разгрузка инструмента в клинья (снижение веса на крюке) - наращивание