diff --git a/ViewModels/StationViewModel.cs b/ViewModels/StationViewModel.cs
index 87af4eb..deecf3c 100644
--- a/ViewModels/StationViewModel.cs
+++ b/ViewModels/StationViewModel.cs
@@ -1642,8 +1642,11 @@ namespace TabletTester2025.ViewModels
}
catch (Exception ex)
{
- await App.Current.Dispatcher.InvokeAsync(() =>
- MessageBox.Show($"硬度测试出错: {ex.Message}"));
+ if (!IsHardnessCompleteResetTimeout(ex))
+ {
+ await App.Current.Dispatcher.InvokeAsync(() =>
+ MessageBox.Show($"硬度测试出错: {ex.Message}"));
+ }
}
finally
{
@@ -1668,6 +1671,12 @@ namespace TabletTester2025.ViewModels
: (ushort)70;
}
+ private static bool IsHardnessCompleteResetTimeout(Exception ex)
+ {
+ return ex is TimeoutException
+ && string.Equals(ex.Message, "硬度完成信号未复位", StringComparison.Ordinal);
+ }
+
private ushort ResolveHardnessLiveForceRegister()
{
return _plcConfig.HardnessShishilizhi != 0
@@ -2151,7 +2160,7 @@ namespace TabletTester2025.ViewModels
try
{
- await PulseCoilAsync(_plcConfig.DisintegrationResetCoil);
+ await PulseCoilAsync(ResolveDisintegrationResetCoil());
}
finally
{
@@ -2171,6 +2180,13 @@ namespace TabletTester2025.ViewModels
}
}
+ private ushort ResolveDisintegrationResetCoil()
+ {
+ return _plcConfig.DisintegrationResetCoil != 0
+ ? _plcConfig.DisintegrationResetCoil
+ : (ushort)100;
+ }
+
private async Task StartDissolution1Async()
{
if (_isDissolution1Running)
diff --git a/Views/MainWindow.xaml b/Views/MainWindow.xaml
index 2061fbc..61a04e4 100644
--- a/Views/MainWindow.xaml
+++ b/Views/MainWindow.xaml
@@ -764,7 +764,7 @@
-
+
diff --git a/appsettings.json b/appsettings.json
index dc59634..466aa7d 100644
--- a/appsettings.json
+++ b/appsettings.json
@@ -51,6 +51,7 @@
"DisintegrationMovingUpCoil": 30,
"DisintegrationStartCoil": 50,
"DisintegrationStopCoil": 53,
+ "DisintegrationResetCoil": 100, // 崩解复位M100
"DisintegrationSpeed": 330,
"DisintegrationTime": 420,
"DisintegrationCompleteCoils": [ 200, 201, 202, 203, 204, 205 ],