forked from ddrilling/AsbCloudServer
Добавлен столбец "Фактический расход"
This commit is contained in:
parent
d73fc5df43
commit
9c69adb10c
@ -13,7 +13,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
namespace AsbCloudDb.Migrations
|
||||
{
|
||||
[DbContext(typeof(AsbCloudDbContext))]
|
||||
[Migration("20240131074638_Add_Table_DataSaubStat")]
|
||||
[Migration("20240131104814_Add_Table_DataSaubStat")]
|
||||
partial class Add_Table_DataSaubStat
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
@ -378,6 +378,11 @@ namespace AsbCloudDb.Migrations
|
||||
.HasColumnName("enabled_subsystems")
|
||||
.HasComment("Флаги подсистем");
|
||||
|
||||
b.Property<double>("Flow")
|
||||
.HasColumnType("double precision")
|
||||
.HasColumnName("flow")
|
||||
.HasComment("Фактический расход");
|
||||
|
||||
b.Property<bool>("HasOscillation")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("has_oscillation")
|
@ -36,6 +36,7 @@ namespace AsbCloudDb.Migrations
|
||||
detected_operation_category_id = table.Column<int>(type: "integer", nullable: false, comment: "Название автоопределённой операции"),
|
||||
enabled_subsystems = table.Column<int>(type: "integer", nullable: false, comment: "Флаги подсистем"),
|
||||
has_oscillation = table.Column<bool>(type: "boolean", nullable: false, comment: "Наличие или отсутствие осцилляции"),
|
||||
flow = table.Column<double>(type: "double precision", nullable: false, comment: "Фактический расход"),
|
||||
id_telemetry = table.Column<int>(type: "integer", nullable: false, comment: "Ключ телеметрии")
|
||||
},
|
||||
constraints: table =>
|
@ -376,6 +376,11 @@ namespace AsbCloudDb.Migrations
|
||||
.HasColumnName("enabled_subsystems")
|
||||
.HasComment("Флаги подсистем");
|
||||
|
||||
b.Property<double>("Flow")
|
||||
.HasColumnType("double precision")
|
||||
.HasColumnName("flow")
|
||||
.HasComment("Фактический расход");
|
||||
|
||||
b.Property<bool>("HasOscillation")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("has_oscillation")
|
||||
|
@ -73,6 +73,9 @@ namespace AsbCloudDb.Model
|
||||
[Column("has_oscillation"), Comment("Наличие или отсутствие осцилляции")]
|
||||
public bool HasOscillation { get; set; }
|
||||
|
||||
[Column("flow"), Comment("Фактический расход")]
|
||||
public double Flow { get; set; }
|
||||
|
||||
[Column("id_telemetry"), Comment("Ключ телеметрии")]
|
||||
public int IdTelemetry { get; set; }
|
||||
|
||||
|
@ -128,6 +128,7 @@ namespace AsbCloudInfrastructure.Background.PeriodicWorks
|
||||
EnabledSubsystems = operation.EnabledSubsystems,
|
||||
HasOscillation = hasOscillation,
|
||||
IdTelemetry = operation.IdTelemetry,
|
||||
Flow = wavg.Flow
|
||||
};
|
||||
return processMapDrillingCacheItem;
|
||||
}
|
||||
@ -136,13 +137,15 @@ namespace AsbCloudInfrastructure.Background.PeriodicWorks
|
||||
double Pressure,
|
||||
double AxialLoad,
|
||||
double RotorTorque,
|
||||
double RotorSpeed
|
||||
double RotorSpeed,
|
||||
double Flow
|
||||
) CalcWavg(Span<TelemetryDataSaub> span)
|
||||
{
|
||||
var sumPressure = 0.0;
|
||||
var sumAxialLoad = 0.0;
|
||||
var sumRotorTorque = 0.0;
|
||||
var sumRotorSpeed = 0.0;
|
||||
var flow = span[0].Flow ?? 0.0;
|
||||
var diffDepthTotal = span[^1].WellDepth - span[0].WellDepth;
|
||||
for (var i = 0; i < span.Length - 1; i++)
|
||||
{
|
||||
@ -151,12 +154,14 @@ namespace AsbCloudInfrastructure.Background.PeriodicWorks
|
||||
sumAxialLoad += weigth * span[i].AxialLoad;
|
||||
sumRotorTorque += weigth * span[i].RotorTorque;
|
||||
sumRotorSpeed += weigth * span[i].RotorSpeed;
|
||||
flow = span[i + 1].Flow > flow ? span[i + 1].Flow ?? 0.0 :flow;
|
||||
}
|
||||
return (
|
||||
Pressure: sumPressure / diffDepthTotal,
|
||||
AxialLoad: sumAxialLoad / diffDepthTotal,
|
||||
RotorTorque: sumRotorTorque / diffDepthTotal,
|
||||
RotorSpeed: sumRotorSpeed / diffDepthTotal
|
||||
RotorSpeed: sumRotorSpeed / diffDepthTotal,
|
||||
Flow: flow
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user