2026-05-05 15:31:24 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
|
2026-05-18 14:06:04 +08:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
2026-05-05 15:31:24 +08:00
|
|
|
|
namespace TabletTester2025.Models
|
|
|
|
|
|
{
|
|
|
|
|
|
public class TestBatch
|
|
|
|
|
|
{
|
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
public DateTime TestTime { get; set; }
|
|
|
|
|
|
public int StationId { get; set; }
|
|
|
|
|
|
public string SampleName { get; set; }
|
2026-05-06 16:41:32 +08:00
|
|
|
|
|
|
|
|
|
|
// 硬度
|
2026-05-05 15:31:24 +08:00
|
|
|
|
public double HardnessAvg { get; set; }
|
|
|
|
|
|
public double HardnessRSD { get; set; }
|
2026-05-06 16:41:32 +08:00
|
|
|
|
public double HardnessMax { get; set; }
|
|
|
|
|
|
public double HardnessMin { get; set; }
|
|
|
|
|
|
public int HardnessTestCount { get; set; }
|
2026-05-18 14:06:04 +08:00
|
|
|
|
public double HardnessInternalMin { get; set; }
|
|
|
|
|
|
public double HardnessInternalMax { get; set; }
|
2026-05-06 16:41:32 +08:00
|
|
|
|
|
|
|
|
|
|
// 脆碎度
|
2026-05-05 15:31:24 +08:00
|
|
|
|
public double FriabilityLoss { get; set; }
|
2026-05-06 16:41:32 +08:00
|
|
|
|
public double FriabilityTargetRpm { get; set; }
|
|
|
|
|
|
public int FriabilityTargetTimeSec { get; set; }
|
2026-05-18 14:06:04 +08:00
|
|
|
|
public int FriabilityTargetRounds { get; set; }
|
2026-05-06 16:41:32 +08:00
|
|
|
|
public bool FriabilityClockwise { get; set; }
|
|
|
|
|
|
public int FriabilityRemainingRounds { get; set; }
|
|
|
|
|
|
public double WeightBefore { get; set; }
|
|
|
|
|
|
public double WeightAfter { get; set; }
|
|
|
|
|
|
|
2026-05-18 18:54:32 +08:00
|
|
|
|
[NotMapped]
|
|
|
|
|
|
public double FriabilityTargetTimeMin => FriabilityTargetTimeSec / 60.0;
|
|
|
|
|
|
|
2026-05-06 16:41:32 +08:00
|
|
|
|
// 崩解
|
2026-05-05 15:31:24 +08:00
|
|
|
|
public double DisintegrationTimeSec { get; set; }
|
2026-05-06 16:41:32 +08:00
|
|
|
|
public int RemainingTubesAtEnd { get; set; }
|
|
|
|
|
|
public double DisintegrationTargetFreq { get; set; }
|
|
|
|
|
|
public double DisintegrationTemp { get; set; }
|
2026-05-18 14:06:04 +08:00
|
|
|
|
public string DisintegrationDosageForm { get; set; } = "";
|
|
|
|
|
|
public int DisintegrationLimitSeconds { get; set; }
|
2026-05-06 16:41:32 +08:00
|
|
|
|
|
|
|
|
|
|
// 溶出
|
2026-05-16 16:58:57 +08:00
|
|
|
|
public string DissolutionChannel { get; set; } = "";
|
2026-05-05 15:31:24 +08:00
|
|
|
|
public double DissolutionRate30Min { get; set; }
|
2026-05-06 16:41:32 +08:00
|
|
|
|
public double DissolutionTargetRpm { get; set; }
|
|
|
|
|
|
public double DissolutionRSquared { get; set; }
|
|
|
|
|
|
public int DissolutionSampleInterval { get; set; }
|
2026-05-18 09:47:22 +08:00
|
|
|
|
public double Dissolution1SampleInterval { get; set; }
|
|
|
|
|
|
public double Dissolution2SampleInterval { get; set; }
|
2026-05-06 16:41:32 +08:00
|
|
|
|
public double DissolutionUpDownFreq { get; set; }
|
2026-05-18 14:06:04 +08:00
|
|
|
|
public List<DissolutionSamplePoint> DissolutionSamples { get; set; } = new();
|
|
|
|
|
|
|
|
|
|
|
|
[NotMapped]
|
|
|
|
|
|
public string DissolutionSampleSummary => DissolutionSamples == null || DissolutionSamples.Count == 0
|
|
|
|
|
|
? ""
|
|
|
|
|
|
: string.Join(";", DissolutionSamples
|
|
|
|
|
|
.OrderBy(s => s.Channel)
|
|
|
|
|
|
.ThenBy(s => s.ScheduledTimeMin)
|
|
|
|
|
|
.Select(s => $"{s.ChannelName} {s.ScheduledTimeMin:0.#}min={s.Percent:0.##}%"));
|
2026-05-06 16:41:32 +08:00
|
|
|
|
|
|
|
|
|
|
// 综合
|
2026-05-05 15:31:24 +08:00
|
|
|
|
public bool IsQualified { get; set; }
|
2026-05-06 16:41:32 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public bool HardnessPass { get; set; }
|
|
|
|
|
|
public bool FriabilityPass { get; set; }
|
|
|
|
|
|
public bool DisintegrationPass { get; set; }
|
|
|
|
|
|
public bool DissolutionPass { get; set; }
|
|
|
|
|
|
|
2026-05-18 16:53:29 +08:00
|
|
|
|
[NotMapped]
|
|
|
|
|
|
public string HardnessPassText => ToPassText(HardnessPass);
|
|
|
|
|
|
|
|
|
|
|
|
[NotMapped]
|
|
|
|
|
|
public string FriabilityPassText => ToPassText(FriabilityPass);
|
|
|
|
|
|
|
|
|
|
|
|
[NotMapped]
|
|
|
|
|
|
public string DisintegrationPassText => ToPassText(DisintegrationPass);
|
|
|
|
|
|
|
|
|
|
|
|
[NotMapped]
|
|
|
|
|
|
public string DissolutionPassText => ToPassText(DissolutionPass);
|
|
|
|
|
|
|
2026-05-06 16:41:32 +08:00
|
|
|
|
public string TestType { get; set; } // "硬度", "脆碎度", "崩解", "溶出"
|
2026-05-18 16:53:29 +08:00
|
|
|
|
|
|
|
|
|
|
private static string ToPassText(bool value) => value ? "合格" : "不合格";
|
2026-05-05 15:31:24 +08:00
|
|
|
|
}
|
2026-05-16 16:58:57 +08:00
|
|
|
|
}
|