forked from amkovkov/GranuSightSoftware2
feat: massive rework
1) GSS2.Core: - strip prefixes in GSS2.Core.Analysis.AmineContent namespace class names - add IEnumerable<double>.Variance extension - remake analysis + update database so not needed to store all every file, calibration data also stored in database, also currently capturing images stored in system temporary directory and rewriting every time 2) GSS.UI.Core: AsyncImageRecordViewModel make zoom and pans public 3) GSS: - remove image-storage-clear command - remove ResultsView and ResultsViewModel, results presented in analysis - rework calibration views - add analysis views - add text and number fields editors view - add confirmation view on danger buttons
This commit is contained in:
-80
@@ -1,80 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration;
|
||||
|
||||
public class AmineContentCalibrationContext : DbContext
|
||||
{
|
||||
public DbSet<ImageRecord> ImageRecords => Set<ImageRecord>();
|
||||
public DbSet<SeparatorRecord> SeparatorRecords => Set<SeparatorRecord>();
|
||||
public DbSet<CalibrationRecord> CalibrationRecords => Set<CalibrationRecord>();
|
||||
|
||||
public AmineContentCalibrationContext(DbContextOptions<AmineContentCalibrationContext> options)
|
||||
: base(options)
|
||||
{ }
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
modelBuilder.Entity<ImageRecord>(entity =>
|
||||
{
|
||||
entity.HasKey(x => x.Id);
|
||||
entity.Property(x => x.ImagePath)
|
||||
.IsRequired()
|
||||
.HasMaxLength(1024);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<SeparatorRecord>(entity =>
|
||||
{
|
||||
entity.HasKey(x => x.Id);
|
||||
entity.HasMany(x => x.Images)
|
||||
.WithOne(x => x.UsedInSeparatorRecord)
|
||||
.HasForeignKey(x => x.UsedInSeparatorRecordId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
entity.Property(x => x.Type)
|
||||
.IsRequired()
|
||||
.HasMaxLength(256);
|
||||
entity.Property(x => x.Batch)
|
||||
.IsRequired()
|
||||
.HasMaxLength(256);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<CalibrationRecord>(entity =>
|
||||
{
|
||||
entity.HasKey(x => x.Id);
|
||||
entity.HasMany(x => x.SampleImages)
|
||||
.WithOne(x => x.UsedInCalibrationRecordSample)
|
||||
.HasForeignKey(x => x.UsedInCalibrationRecordSampleId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
entity.HasMany(x => x.SeparatorImages)
|
||||
.WithMany(x => x.UsedInCalibrationRecordsSeparator)
|
||||
.UsingEntity<Dictionary<string, object>>(
|
||||
"CalibrationSeparatorImage",
|
||||
j => j
|
||||
.HasOne<ImageRecord>()
|
||||
.WithMany()
|
||||
.HasForeignKey("ImageRecordId")
|
||||
.OnDelete(DeleteBehavior.Cascade),
|
||||
j => j
|
||||
.HasOne<CalibrationRecord>()
|
||||
.WithMany()
|
||||
.HasForeignKey("CalibrationRecordId")
|
||||
.OnDelete(DeleteBehavior.Cascade),
|
||||
j =>
|
||||
{
|
||||
j.HasKey("CalibrationRecordId", "ImageRecordId");
|
||||
j.ToTable("CalibrationSeparatorImages");
|
||||
});
|
||||
entity.Property(x => x.SampleName)
|
||||
.HasMaxLength(512);
|
||||
entity.Property(x => x.SampleComment)
|
||||
.HasMaxLength(2048);
|
||||
entity.Property(x => x.SampleBrand)
|
||||
.HasMaxLength(512);
|
||||
entity.Property(x => x.SamplingPlace)
|
||||
.HasMaxLength(512);
|
||||
entity.Property(x => x.MixtureName)
|
||||
.HasMaxLength(512);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration;
|
||||
|
||||
public class CalibrationContext : DbContext
|
||||
{
|
||||
public DbSet<SeparatorRecord> SeparatorRecords => Set<SeparatorRecord>();
|
||||
public DbSet<SampleRecord> SampleRecords => Set<SampleRecord>();
|
||||
public DbSet<VectorRecord> VectorRecords => Set<VectorRecord>();
|
||||
|
||||
public CalibrationContext(DbContextOptions<CalibrationContext> options)
|
||||
: base(options)
|
||||
{ }
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<SeparatorRecord>()
|
||||
.HasMany(x => x.VectorRecords)
|
||||
.WithOne(x => x.SeparatorRecord)
|
||||
.HasForeignKey(x => x.SeparatorRecordId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
modelBuilder.Entity<SampleRecord>()
|
||||
.HasMany(x => x.VectorRecords)
|
||||
.WithOne(x => x.SampleRecord)
|
||||
.HasForeignKey(x => x.SampleRecordId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -3,16 +3,16 @@ using Microsoft.EntityFrameworkCore.Design;
|
||||
|
||||
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration;
|
||||
|
||||
public class AmineContentCalibrationContextFactory : IDesignTimeDbContextFactory<AmineContentCalibrationContext>
|
||||
public class CalibrationContextFactory : IDesignTimeDbContextFactory<CalibrationContext>
|
||||
{
|
||||
public AmineContentCalibrationContext CreateDbContext(string[] args)
|
||||
public CalibrationContext CreateDbContext(string[] args)
|
||||
{
|
||||
var optionsBuilder = new DbContextOptionsBuilder<AmineContentCalibrationContext>();
|
||||
var optionsBuilder = new DbContextOptionsBuilder<CalibrationContext>();
|
||||
|
||||
// Строка подключения для миграций в design-time
|
||||
// в runtime должна использоваться настоящая ConnectionString
|
||||
// в runtime должна использоваться настоящая ConnectionString
|
||||
optionsBuilder.UseSqlite("Data Source=AmineContentCalibration.db");
|
||||
|
||||
return new AmineContentCalibrationContext(optionsBuilder.Options);
|
||||
return new CalibrationContext(optionsBuilder.Options);
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration;
|
||||
|
||||
public record ImageRecord
|
||||
{
|
||||
[Comment("Уникальный идентификатор")]
|
||||
public int Id { get; set; }
|
||||
[Comment("Интенсивность видимого света (0..1)")]
|
||||
public required double VisibleIntensity { get; set; }
|
||||
[Comment("Интенсивность УФ излучения 365 нм (0..1)")]
|
||||
public required double Uv365Intensity { get; set; }
|
||||
[Comment("Интенсивность УФ излучения 254 нм (0..1)")]
|
||||
public required double Uv254Intensity { get; set; }
|
||||
[Comment("Путь к файлу изображения")]
|
||||
public required string ImagePath { get; set; }
|
||||
|
||||
// 1:N
|
||||
public int? UsedInSeparatorRecordId { get; set; }
|
||||
public SeparatorRecord? UsedInSeparatorRecord { get; set; }
|
||||
|
||||
public int? UsedInCalibrationRecordSampleId { get; set; }
|
||||
public CalibrationRecord? UsedInCalibrationRecordSample { get; set; }
|
||||
|
||||
// M:N
|
||||
public List<CalibrationRecord> UsedInCalibrationRecordsSeparator { get; set; } = new();
|
||||
}
|
||||
-137
@@ -1,137 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AmineContentCalibration0 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CalibrationRecords",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false, comment: "Уникальный идентификатор")
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
SampleName = table.Column<string>(type: "TEXT", maxLength: 512, nullable: true, comment: "Название пробы"),
|
||||
SampleComment = table.Column<string>(type: "TEXT", maxLength: 2048, nullable: true, comment: "Дополнительная информация о пробе"),
|
||||
SampleBrand = table.Column<string>(type: "TEXT", maxLength: 512, nullable: true, comment: "Марка пробы"),
|
||||
SampleMass = table.Column<double>(type: "REAL", nullable: true, comment: "Масса пробы (кг)"),
|
||||
SamplingDateTime = table.Column<DateTime>(type: "TEXT", nullable: true, comment: "Дата и время отбора пробы"),
|
||||
SamplingPlace = table.Column<string>(type: "TEXT", maxLength: 512, nullable: true, comment: "Место отбора пробы"),
|
||||
MixtureName = table.Column<string>(type: "TEXT", maxLength: 512, nullable: true, comment: "Название используемой кондиционирующей смеси"),
|
||||
MixtureAmineContent = table.Column<double>(type: "REAL", nullable: true, comment: "Содержание аминов в кондиционирующей смеси (%)"),
|
||||
MixtureNormalRate = table.Column<double>(type: "REAL", nullable: true, comment: "Норма расхода кондиционирующей смеси (кг/т | гр/кг)"),
|
||||
MixtureActualRate = table.Column<double>(type: "REAL", nullable: true, comment: "Фактический расход кондиционирующей смеси (кг/т | гр/кг)"),
|
||||
MeasuredContent = table.Column<double>(type: "REAL", nullable: true, comment: "Измеренное количество масла (кг/т | гр/кг)")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CalibrationRecords", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "SeparatorRecords",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false, comment: "Уникальный идентификатор")
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Type = table.Column<string>(type: "TEXT", maxLength: 256, nullable: false, comment: "Тип сепаратора"),
|
||||
Batch = table.Column<string>(type: "TEXT", maxLength: 256, nullable: false, comment: "Партия сепаратора")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_SeparatorRecords", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ImageRecords",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false, comment: "Уникальный идентификатор")
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
VisibleIntensity = table.Column<double>(type: "REAL", nullable: false, comment: "Интенсивность видимого света (0..1)"),
|
||||
Uv365Intensity = table.Column<double>(type: "REAL", nullable: false, comment: "Интенсивность УФ излучения 365 нм (0..1)"),
|
||||
Uv254Intensity = table.Column<double>(type: "REAL", nullable: false, comment: "Интенсивность УФ излучения 254 нм (0..1)"),
|
||||
ImagePath = table.Column<string>(type: "TEXT", maxLength: 1024, nullable: false, comment: "Путь к файлу изображения"),
|
||||
UsedInSeparatorRecordId = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
UsedInCalibrationRecordSampleId = table.Column<int>(type: "INTEGER", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ImageRecords", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ImageRecords_CalibrationRecords_UsedInCalibrationRecordSampleId",
|
||||
column: x => x.UsedInCalibrationRecordSampleId,
|
||||
principalTable: "CalibrationRecords",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_ImageRecords_SeparatorRecords_UsedInSeparatorRecordId",
|
||||
column: x => x.UsedInSeparatorRecordId,
|
||||
principalTable: "SeparatorRecords",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CalibrationSeparatorImages",
|
||||
columns: table => new
|
||||
{
|
||||
CalibrationRecordId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
ImageRecordId = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CalibrationSeparatorImages", x => new { x.CalibrationRecordId, x.ImageRecordId });
|
||||
table.ForeignKey(
|
||||
name: "FK_CalibrationSeparatorImages_CalibrationRecords_CalibrationRecordId",
|
||||
column: x => x.CalibrationRecordId,
|
||||
principalTable: "CalibrationRecords",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_CalibrationSeparatorImages_ImageRecords_ImageRecordId",
|
||||
column: x => x.ImageRecordId,
|
||||
principalTable: "ImageRecords",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CalibrationSeparatorImages_ImageRecordId",
|
||||
table: "CalibrationSeparatorImages",
|
||||
column: "ImageRecordId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ImageRecords_UsedInCalibrationRecordSampleId",
|
||||
table: "ImageRecords",
|
||||
column: "UsedInCalibrationRecordSampleId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ImageRecords_UsedInSeparatorRecordId",
|
||||
table: "ImageRecords",
|
||||
column: "UsedInSeparatorRecordId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "CalibrationSeparatorImages");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ImageRecords");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "CalibrationRecords");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "SeparatorRecords");
|
||||
}
|
||||
}
|
||||
}
|
||||
+68
-94
@@ -10,9 +10,9 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration.Migrations
|
||||
{
|
||||
[DbContext(typeof(AmineContentCalibrationContext))]
|
||||
[Migration("20260313083001_AmineContentCalibration0")]
|
||||
partial class AmineContentCalibration0
|
||||
[DbContext(typeof(CalibrationContext))]
|
||||
[Migration("20260428223237_Calibration0")]
|
||||
partial class Calibration0
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
@@ -20,120 +20,76 @@ namespace GSS2.Core.Analysis.AmineContent.Database.Calibration.Migrations
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "10.0.0");
|
||||
|
||||
modelBuilder.Entity("CalibrationSeparatorImage", b =>
|
||||
{
|
||||
b.Property<int>("CalibrationRecordId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("ImageRecordId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("CalibrationRecordId", "ImageRecordId");
|
||||
|
||||
b.HasIndex("ImageRecordId");
|
||||
|
||||
b.ToTable("CalibrationSeparatorImages", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.CalibrationRecord", b =>
|
||||
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.SampleRecord", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasComment("Уникальный идентификатор");
|
||||
|
||||
b.Property<double?>("MeasuredContent")
|
||||
b.Property<string>("Image")
|
||||
.IsRequired()
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("TEXT")
|
||||
.HasComment("Изображение");
|
||||
|
||||
b.Property<double>("MeasuredContent")
|
||||
.HasColumnType("REAL")
|
||||
.HasComment("Измеренное количество масла (кг/т | гр/кг)");
|
||||
|
||||
b.Property<double?>("MixtureActualRate")
|
||||
b.Property<double>("MixtureActualRate")
|
||||
.HasColumnType("REAL")
|
||||
.HasComment("Фактический расход кондиционирующей смеси (кг/т | гр/кг)");
|
||||
|
||||
b.Property<double?>("MixtureAmineContent")
|
||||
b.Property<double>("MixtureAmineContent")
|
||||
.HasColumnType("REAL")
|
||||
.HasComment("Содержание аминов в кондиционирующей смеси (%)");
|
||||
|
||||
b.Property<string>("MixtureName")
|
||||
.HasMaxLength(512)
|
||||
.IsRequired()
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("TEXT")
|
||||
.HasComment("Название используемой кондиционирующей смеси");
|
||||
|
||||
b.Property<double?>("MixtureNormalRate")
|
||||
b.Property<double>("MixtureNormalRate")
|
||||
.HasColumnType("REAL")
|
||||
.HasComment("Норма расхода кондиционирующей смеси (кг/т | гр/кг)");
|
||||
|
||||
b.Property<string>("SampleBrand")
|
||||
.HasMaxLength(512)
|
||||
.IsRequired()
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("TEXT")
|
||||
.HasComment("Марка пробы");
|
||||
|
||||
b.Property<string>("SampleComment")
|
||||
.HasMaxLength(2048)
|
||||
.IsRequired()
|
||||
.HasMaxLength(512)
|
||||
.HasColumnType("TEXT")
|
||||
.HasComment("Дополнительная информация о пробе");
|
||||
|
||||
b.Property<double?>("SampleMass")
|
||||
b.Property<double>("SampleMass")
|
||||
.HasColumnType("REAL")
|
||||
.HasComment("Масса пробы (кг)");
|
||||
|
||||
b.Property<string>("SampleName")
|
||||
.HasMaxLength(512)
|
||||
.IsRequired()
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("TEXT")
|
||||
.HasComment("Название пробы");
|
||||
|
||||
b.Property<DateTime?>("SamplingDateTime")
|
||||
b.Property<DateTime>("SamplingDateTime")
|
||||
.HasColumnType("TEXT")
|
||||
.HasComment("Дата и время отбора пробы");
|
||||
|
||||
b.Property<string>("SamplingPlace")
|
||||
.HasMaxLength(512)
|
||||
.IsRequired()
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("TEXT")
|
||||
.HasComment("Место отбора пробы");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("CalibrationRecords");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.ImageRecord", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasComment("Уникальный идентификатор");
|
||||
|
||||
b.Property<string>("ImagePath")
|
||||
.IsRequired()
|
||||
.HasMaxLength(1024)
|
||||
.HasColumnType("TEXT")
|
||||
.HasComment("Путь к файлу изображения");
|
||||
|
||||
b.Property<int?>("UsedInCalibrationRecordSampleId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("UsedInSeparatorRecordId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<double>("Uv254Intensity")
|
||||
.HasColumnType("REAL")
|
||||
.HasComment("Интенсивность УФ излучения 254 нм (0..1)");
|
||||
|
||||
b.Property<double>("Uv365Intensity")
|
||||
.HasColumnType("REAL")
|
||||
.HasComment("Интенсивность УФ излучения 365 нм (0..1)");
|
||||
|
||||
b.Property<double>("VisibleIntensity")
|
||||
.HasColumnType("REAL")
|
||||
.HasComment("Интенсивность видимого света (0..1)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UsedInCalibrationRecordSampleId");
|
||||
|
||||
b.HasIndex("UsedInSeparatorRecordId");
|
||||
|
||||
b.ToTable("ImageRecords");
|
||||
b.ToTable("SampleRecords");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.SeparatorRecord", b =>
|
||||
@@ -149,6 +105,12 @@ namespace GSS2.Core.Analysis.AmineContent.Database.Calibration.Migrations
|
||||
.HasColumnType("TEXT")
|
||||
.HasComment("Партия сепаратора");
|
||||
|
||||
b.Property<string>("Image")
|
||||
.IsRequired()
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("TEXT")
|
||||
.HasComment("Изображение");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasMaxLength(256)
|
||||
@@ -160,46 +122,58 @@ namespace GSS2.Core.Analysis.AmineContent.Database.Calibration.Migrations
|
||||
b.ToTable("SeparatorRecords");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CalibrationSeparatorImage", b =>
|
||||
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.VectorRecord", b =>
|
||||
{
|
||||
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.CalibrationRecord", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("CalibrationRecordId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasComment("Уникальный идентификатор");
|
||||
|
||||
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.ImageRecord", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("ImageRecordId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
b.Property<int?>("SampleRecordId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("SeparatorRecordId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.PrimitiveCollection<string>("Values")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasComment("Значения вектора");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SampleRecordId");
|
||||
|
||||
b.HasIndex("SeparatorRecordId");
|
||||
|
||||
b.ToTable("VectorRecords");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.ImageRecord", b =>
|
||||
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.VectorRecord", b =>
|
||||
{
|
||||
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.CalibrationRecord", "UsedInCalibrationRecordSample")
|
||||
.WithMany("SampleImages")
|
||||
.HasForeignKey("UsedInCalibrationRecordSampleId")
|
||||
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.SampleRecord", "SampleRecord")
|
||||
.WithMany("VectorRecords")
|
||||
.HasForeignKey("SampleRecordId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.SeparatorRecord", "UsedInSeparatorRecord")
|
||||
.WithMany("Images")
|
||||
.HasForeignKey("UsedInSeparatorRecordId")
|
||||
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.SeparatorRecord", "SeparatorRecord")
|
||||
.WithMany("VectorRecords")
|
||||
.HasForeignKey("SeparatorRecordId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.Navigation("UsedInCalibrationRecordSample");
|
||||
b.Navigation("SampleRecord");
|
||||
|
||||
b.Navigation("UsedInSeparatorRecord");
|
||||
b.Navigation("SeparatorRecord");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.CalibrationRecord", b =>
|
||||
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.SampleRecord", b =>
|
||||
{
|
||||
b.Navigation("SampleImages");
|
||||
b.Navigation("VectorRecords");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.SeparatorRecord", b =>
|
||||
{
|
||||
b.Navigation("Images");
|
||||
b.Navigation("VectorRecords");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Calibration0 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "SampleRecords",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false, comment: "Уникальный идентификатор")
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
SampleName = table.Column<string>(type: "TEXT", maxLength: 256, nullable: false, comment: "Название пробы"),
|
||||
SampleComment = table.Column<string>(type: "TEXT", maxLength: 512, nullable: false, comment: "Дополнительная информация о пробе"),
|
||||
SampleBrand = table.Column<string>(type: "TEXT", maxLength: 256, nullable: false, comment: "Марка пробы"),
|
||||
SampleMass = table.Column<double>(type: "REAL", nullable: false, comment: "Масса пробы (кг)"),
|
||||
SamplingDateTime = table.Column<DateTime>(type: "TEXT", nullable: false, comment: "Дата и время отбора пробы"),
|
||||
SamplingPlace = table.Column<string>(type: "TEXT", maxLength: 256, nullable: false, comment: "Место отбора пробы"),
|
||||
MixtureName = table.Column<string>(type: "TEXT", maxLength: 256, nullable: false, comment: "Название используемой кондиционирующей смеси"),
|
||||
MixtureAmineContent = table.Column<double>(type: "REAL", nullable: false, comment: "Содержание аминов в кондиционирующей смеси (%)"),
|
||||
MixtureNormalRate = table.Column<double>(type: "REAL", nullable: false, comment: "Норма расхода кондиционирующей смеси (кг/т | гр/кг)"),
|
||||
MixtureActualRate = table.Column<double>(type: "REAL", nullable: false, comment: "Фактический расход кондиционирующей смеси (кг/т | гр/кг)"),
|
||||
MeasuredContent = table.Column<double>(type: "REAL", nullable: false, comment: "Измеренное количество масла (кг/т | гр/кг)"),
|
||||
Image = table.Column<string>(type: "TEXT", maxLength: 256, nullable: false, comment: "Изображение")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_SampleRecords", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "SeparatorRecords",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false, comment: "Уникальный идентификатор")
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Type = table.Column<string>(type: "TEXT", maxLength: 256, nullable: false, comment: "Тип сепаратора"),
|
||||
Batch = table.Column<string>(type: "TEXT", maxLength: 256, nullable: false, comment: "Партия сепаратора"),
|
||||
Image = table.Column<string>(type: "TEXT", maxLength: 256, nullable: false, comment: "Изображение")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_SeparatorRecords", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "VectorRecords",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false, comment: "Уникальный идентификатор")
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
SeparatorRecordId = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
SampleRecordId = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
Values = table.Column<string>(type: "TEXT", nullable: false, comment: "Значения вектора")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_VectorRecords", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_VectorRecords_SampleRecords_SampleRecordId",
|
||||
column: x => x.SampleRecordId,
|
||||
principalTable: "SampleRecords",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_VectorRecords_SeparatorRecords_SeparatorRecordId",
|
||||
column: x => x.SeparatorRecordId,
|
||||
principalTable: "SeparatorRecords",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_VectorRecords_SampleRecordId",
|
||||
table: "VectorRecords",
|
||||
column: "SampleRecordId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_VectorRecords_SeparatorRecordId",
|
||||
table: "VectorRecords",
|
||||
column: "SeparatorRecordId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "VectorRecords");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "SampleRecords");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "SeparatorRecords");
|
||||
}
|
||||
}
|
||||
}
|
||||
+67
-93
@@ -9,128 +9,84 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration.Migrations
|
||||
{
|
||||
[DbContext(typeof(AmineContentCalibrationContext))]
|
||||
partial class AmineContentCalibrationContextModelSnapshot : ModelSnapshot
|
||||
[DbContext(typeof(CalibrationContext))]
|
||||
partial class CalibrationContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "10.0.0");
|
||||
|
||||
modelBuilder.Entity("CalibrationSeparatorImage", b =>
|
||||
{
|
||||
b.Property<int>("CalibrationRecordId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("ImageRecordId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("CalibrationRecordId", "ImageRecordId");
|
||||
|
||||
b.HasIndex("ImageRecordId");
|
||||
|
||||
b.ToTable("CalibrationSeparatorImages", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.CalibrationRecord", b =>
|
||||
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.SampleRecord", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasComment("Уникальный идентификатор");
|
||||
|
||||
b.Property<double?>("MeasuredContent")
|
||||
b.Property<string>("Image")
|
||||
.IsRequired()
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("TEXT")
|
||||
.HasComment("Изображение");
|
||||
|
||||
b.Property<double>("MeasuredContent")
|
||||
.HasColumnType("REAL")
|
||||
.HasComment("Измеренное количество масла (кг/т | гр/кг)");
|
||||
|
||||
b.Property<double?>("MixtureActualRate")
|
||||
b.Property<double>("MixtureActualRate")
|
||||
.HasColumnType("REAL")
|
||||
.HasComment("Фактический расход кондиционирующей смеси (кг/т | гр/кг)");
|
||||
|
||||
b.Property<double?>("MixtureAmineContent")
|
||||
b.Property<double>("MixtureAmineContent")
|
||||
.HasColumnType("REAL")
|
||||
.HasComment("Содержание аминов в кондиционирующей смеси (%)");
|
||||
|
||||
b.Property<string>("MixtureName")
|
||||
.HasMaxLength(512)
|
||||
.IsRequired()
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("TEXT")
|
||||
.HasComment("Название используемой кондиционирующей смеси");
|
||||
|
||||
b.Property<double?>("MixtureNormalRate")
|
||||
b.Property<double>("MixtureNormalRate")
|
||||
.HasColumnType("REAL")
|
||||
.HasComment("Норма расхода кондиционирующей смеси (кг/т | гр/кг)");
|
||||
|
||||
b.Property<string>("SampleBrand")
|
||||
.HasMaxLength(512)
|
||||
.IsRequired()
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("TEXT")
|
||||
.HasComment("Марка пробы");
|
||||
|
||||
b.Property<string>("SampleComment")
|
||||
.HasMaxLength(2048)
|
||||
.IsRequired()
|
||||
.HasMaxLength(512)
|
||||
.HasColumnType("TEXT")
|
||||
.HasComment("Дополнительная информация о пробе");
|
||||
|
||||
b.Property<double?>("SampleMass")
|
||||
b.Property<double>("SampleMass")
|
||||
.HasColumnType("REAL")
|
||||
.HasComment("Масса пробы (кг)");
|
||||
|
||||
b.Property<string>("SampleName")
|
||||
.HasMaxLength(512)
|
||||
.IsRequired()
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("TEXT")
|
||||
.HasComment("Название пробы");
|
||||
|
||||
b.Property<DateTime?>("SamplingDateTime")
|
||||
b.Property<DateTime>("SamplingDateTime")
|
||||
.HasColumnType("TEXT")
|
||||
.HasComment("Дата и время отбора пробы");
|
||||
|
||||
b.Property<string>("SamplingPlace")
|
||||
.HasMaxLength(512)
|
||||
.IsRequired()
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("TEXT")
|
||||
.HasComment("Место отбора пробы");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("CalibrationRecords");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.ImageRecord", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasComment("Уникальный идентификатор");
|
||||
|
||||
b.Property<string>("ImagePath")
|
||||
.IsRequired()
|
||||
.HasMaxLength(1024)
|
||||
.HasColumnType("TEXT")
|
||||
.HasComment("Путь к файлу изображения");
|
||||
|
||||
b.Property<int?>("UsedInCalibrationRecordSampleId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("UsedInSeparatorRecordId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<double>("Uv254Intensity")
|
||||
.HasColumnType("REAL")
|
||||
.HasComment("Интенсивность УФ излучения 254 нм (0..1)");
|
||||
|
||||
b.Property<double>("Uv365Intensity")
|
||||
.HasColumnType("REAL")
|
||||
.HasComment("Интенсивность УФ излучения 365 нм (0..1)");
|
||||
|
||||
b.Property<double>("VisibleIntensity")
|
||||
.HasColumnType("REAL")
|
||||
.HasComment("Интенсивность видимого света (0..1)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UsedInCalibrationRecordSampleId");
|
||||
|
||||
b.HasIndex("UsedInSeparatorRecordId");
|
||||
|
||||
b.ToTable("ImageRecords");
|
||||
b.ToTable("SampleRecords");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.SeparatorRecord", b =>
|
||||
@@ -146,6 +102,12 @@ namespace GSS2.Core.Analysis.AmineContent.Database.Calibration.Migrations
|
||||
.HasColumnType("TEXT")
|
||||
.HasComment("Партия сепаратора");
|
||||
|
||||
b.Property<string>("Image")
|
||||
.IsRequired()
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("TEXT")
|
||||
.HasComment("Изображение");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasMaxLength(256)
|
||||
@@ -157,46 +119,58 @@ namespace GSS2.Core.Analysis.AmineContent.Database.Calibration.Migrations
|
||||
b.ToTable("SeparatorRecords");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CalibrationSeparatorImage", b =>
|
||||
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.VectorRecord", b =>
|
||||
{
|
||||
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.CalibrationRecord", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("CalibrationRecordId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER")
|
||||
.HasComment("Уникальный идентификатор");
|
||||
|
||||
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.ImageRecord", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("ImageRecordId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
b.Property<int?>("SampleRecordId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("SeparatorRecordId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.PrimitiveCollection<string>("Values")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasComment("Значения вектора");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("SampleRecordId");
|
||||
|
||||
b.HasIndex("SeparatorRecordId");
|
||||
|
||||
b.ToTable("VectorRecords");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.ImageRecord", b =>
|
||||
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.VectorRecord", b =>
|
||||
{
|
||||
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.CalibrationRecord", "UsedInCalibrationRecordSample")
|
||||
.WithMany("SampleImages")
|
||||
.HasForeignKey("UsedInCalibrationRecordSampleId")
|
||||
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.SampleRecord", "SampleRecord")
|
||||
.WithMany("VectorRecords")
|
||||
.HasForeignKey("SampleRecordId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.SeparatorRecord", "UsedInSeparatorRecord")
|
||||
.WithMany("Images")
|
||||
.HasForeignKey("UsedInSeparatorRecordId")
|
||||
b.HasOne("GSS2.Core.Analysis.AmineContent.Database.Calibration.SeparatorRecord", "SeparatorRecord")
|
||||
.WithMany("VectorRecords")
|
||||
.HasForeignKey("SeparatorRecordId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.Navigation("UsedInCalibrationRecordSample");
|
||||
b.Navigation("SampleRecord");
|
||||
|
||||
b.Navigation("UsedInSeparatorRecord");
|
||||
b.Navigation("SeparatorRecord");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.CalibrationRecord", b =>
|
||||
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.SampleRecord", b =>
|
||||
{
|
||||
b.Navigation("SampleImages");
|
||||
b.Navigation("VectorRecords");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GSS2.Core.Analysis.AmineContent.Database.Calibration.SeparatorRecord", b =>
|
||||
{
|
||||
b.Navigation("Images");
|
||||
b.Navigation("VectorRecords");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
+24
-16
@@ -1,35 +1,43 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration;
|
||||
|
||||
public record CalibrationRecord
|
||||
public record SampleRecord
|
||||
{
|
||||
[Comment("Уникальный идентификатор")]
|
||||
public int Id { get; set; }
|
||||
[Comment("Название пробы")]
|
||||
public required string? SampleName { get; set; }
|
||||
[MaxLength(256)]
|
||||
public required string SampleName { get; set; }
|
||||
[Comment("Дополнительная информация о пробе")]
|
||||
public required string? SampleComment { get; set; }
|
||||
[MaxLength(512)]
|
||||
public required string SampleComment { get; set; }
|
||||
[Comment("Марка пробы")]
|
||||
public required string? SampleBrand { get; set; }
|
||||
[MaxLength(256)]
|
||||
public required string SampleBrand { get; set; }
|
||||
[Comment("Масса пробы (кг)")]
|
||||
public required double? SampleMass { get; set; }
|
||||
public required double SampleMass { get; set; }
|
||||
[Comment("Дата и время отбора пробы")]
|
||||
public required DateTime? SamplingDateTime { get; set; }
|
||||
public required DateTime SamplingDateTime { get; set; }
|
||||
[Comment("Место отбора пробы")]
|
||||
public required string? SamplingPlace { get; set; }
|
||||
[MaxLength(256)]
|
||||
public required string SamplingPlace { get; set; }
|
||||
[Comment("Название используемой кондиционирующей смеси")]
|
||||
public required string? MixtureName { get; set; }
|
||||
[MaxLength(256)]
|
||||
public required string MixtureName { get; set; }
|
||||
[Comment("Содержание аминов в кондиционирующей смеси (%)")]
|
||||
public required double? MixtureAmineContent { get; set; }
|
||||
public required double MixtureAmineContent { get; set; }
|
||||
[Comment("Норма расхода кондиционирующей смеси (кг/т | гр/кг)")]
|
||||
public required double? MixtureNormalRate { get; set; }
|
||||
public required double MixtureNormalRate { get; set; }
|
||||
[Comment("Фактический расход кондиционирующей смеси (кг/т | гр/кг)")]
|
||||
public required double? MixtureActualRate { get; set; }
|
||||
public required double MixtureActualRate { get; set; }
|
||||
[Comment("Измеренное количество масла (кг/т | гр/кг)")]
|
||||
public required double? MeasuredContent { get; set; }
|
||||
[Comment("Изображения пробы")]
|
||||
public required List<ImageRecord> SampleImages { get; set; }
|
||||
[Comment("Изображения пустого сепаратора")]
|
||||
public required List<ImageRecord> SeparatorImages { get; set; }
|
||||
public required double MeasuredContent { get; set; }
|
||||
[Comment("Изображение")]
|
||||
[MaxLength(256)]
|
||||
public required string Image { get; set; }
|
||||
[Comment("Векторы")]
|
||||
public required List<VectorRecord> VectorRecords { get; set; } = new();
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.IO.Pipelines;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
@@ -9,9 +9,14 @@ public record SeparatorRecord
|
||||
[Comment("Уникальный идентификатор")]
|
||||
public int Id { get; set; }
|
||||
[Comment("Тип сепаратора")]
|
||||
[MaxLength(256)]
|
||||
public required string Type { get; set; }
|
||||
[Comment("Партия сепаратора")]
|
||||
[MaxLength(256)]
|
||||
public required string Batch { get; set; }
|
||||
[Comment("Изображения сепаратора")]
|
||||
public required List<ImageRecord> Images { get; set; }
|
||||
[Comment("Изображение")]
|
||||
[MaxLength(256)]
|
||||
public required string Image { get; set; }
|
||||
[Comment("Векторы")]
|
||||
public required List<VectorRecord> VectorRecords { get; set; } = new();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace GSS2.Core.Analysis.AmineContent.Database.Calibration;
|
||||
|
||||
public record VectorRecord
|
||||
{
|
||||
[Comment("Уникальный идентификатор")]
|
||||
public int Id { get; set; }
|
||||
[Comment("Значения вектора")]
|
||||
public required float[] Values { get; set; }
|
||||
|
||||
public int? SeparatorRecordId { get; set; }
|
||||
public SeparatorRecord? SeparatorRecord { get; set; }
|
||||
|
||||
public int? SampleRecordId { get; set; }
|
||||
public SampleRecord? SampleRecord { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user