更新290
This commit is contained in:
@@ -19,6 +19,7 @@ namespace TabletTester2025.Services
|
||||
{
|
||||
72 => 40 + (float)_rand.NextDouble() * 20, // 硬度最大采集力
|
||||
100 => 40 + (float)_rand.NextDouble() * 20, // 硬度 40~60N
|
||||
1314 => 40 + (float)_rand.NextDouble() * 20, // 硬度实时力显示
|
||||
82 => _rand.Next(0, 101), // 脆碎实时圈数
|
||||
410 => 100f, // 脆碎圈数
|
||||
412 => 5.0f + (float)_rand.NextDouble() * 2, // 脆碎度前重
|
||||
|
||||
@@ -1529,7 +1529,7 @@ namespace TabletTester2025.ViewModels
|
||||
_hardnessGlobalTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(500) };
|
||||
_hardnessGlobalTimer.Tick += async (_, _) =>
|
||||
{
|
||||
if (_isReadingHardnessLiveForce || _isHardnessRunning)
|
||||
if (_isReadingHardnessLiveForce)
|
||||
return;
|
||||
|
||||
try
|
||||
@@ -1621,9 +1621,9 @@ namespace TabletTester2025.ViewModels
|
||||
if (completeWasActiveBeforeStart)
|
||||
await WaitForCoilStateAsync(completeCoil, false, TimeSpan.FromSeconds(10), "硬度完成信号未复位");
|
||||
|
||||
double value = await WaitForHardnessSamplePeakAsync(completeCoil);
|
||||
await WaitForHardnessSampleCompleteAsync(completeCoil);
|
||||
double value = await ReadHardnessMaxCaptureAsync();
|
||||
AddHardnessSample(value);
|
||||
await ReadHardnessMaxCaptureAsync();
|
||||
ApplyHardnessStatistics(count);
|
||||
await TryWaitForCoilStateAsync(completeCoil, false, TimeSpan.FromSeconds(2));
|
||||
}
|
||||
@@ -1631,7 +1631,6 @@ namespace TabletTester2025.ViewModels
|
||||
if (_hardnessResults.Count < count)
|
||||
throw new InvalidOperationException("硬度测试已停止,未保存结果");
|
||||
|
||||
await ReadHardnessMaxCaptureAsync();
|
||||
ApplyHardnessStatistics(count);
|
||||
AddHardnessGroupSummaryRow();
|
||||
resultReady = true;
|
||||
@@ -1712,28 +1711,14 @@ namespace TabletTester2025.ViewModels
|
||||
HardnessSudu = value;
|
||||
}
|
||||
|
||||
private async Task<double> WaitForHardnessSamplePeakAsync(ushort completeCoil)
|
||||
private async Task WaitForHardnessSampleCompleteAsync(ushort completeCoil)
|
||||
{
|
||||
double peak = 0;
|
||||
DateTime deadline = DateTime.Now.AddSeconds(120);
|
||||
|
||||
while (_isHardnessRunning && DateTime.Now <= deadline)
|
||||
{
|
||||
double liveForce = await ReadHardnessLiveForceAsync();
|
||||
if (liveForce > peak)
|
||||
peak = liveForce;
|
||||
|
||||
if (await _plc.ReadCoilAsync(completeCoil))
|
||||
{
|
||||
double finalForce = await ReadHardnessLiveForceAsync();
|
||||
if (finalForce > peak)
|
||||
peak = finalForce;
|
||||
|
||||
if (peak <= 0)
|
||||
throw new InvalidOperationException("硬度实时力数据异常");
|
||||
|
||||
return peak;
|
||||
}
|
||||
return;
|
||||
|
||||
await Task.Delay(100);
|
||||
}
|
||||
@@ -1812,6 +1797,8 @@ namespace TabletTester2025.ViewModels
|
||||
HardnessAvg = stats.Average;
|
||||
HardnessAverageDeviation = stats.AverageDeviation;
|
||||
HardnessRSD = stats.RsdPercent;
|
||||
HardnessMax = stats.Maximum;
|
||||
HardnessMin = stats.Minimum;
|
||||
HardnessCurrentCount = stats.Count;
|
||||
HardnessPass = stats.IsPass;
|
||||
|
||||
|
||||
@@ -571,10 +571,6 @@
|
||||
<TextBlock Text="溶出2间隔取样时间(min):" Style="{StaticResource ParamLabel}"/>
|
||||
<TextBlock Text="{Binding Dissolution2SampleIntervalMin, StringFormat=F0}" FontSize="18" FontWeight="SemiBold" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
<StackPanel Style="{StaticResource ParamRow}">
|
||||
<TextBlock Text="30min最低溶出度Q(%):" Style="{StaticResource ParamLabel}"/>
|
||||
<TextBlock Text="{Binding DissolutionMinPercentAt30Min, StringFormat=F1}" FontSize="18" FontWeight="SemiBold" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
<StackPanel Style="{StaticResource ParamRow}">
|
||||
<TextBlock Text="介质温度(℃):" Style="{StaticResource ParamLabel}"/>
|
||||
<TextBlock Text="{Binding DisintegrationTemp, StringFormat=F1}" FontSize="18" FontWeight="SemiBold" VerticalAlignment="Center"/>
|
||||
|
||||
Reference in New Issue
Block a user