更新
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -764,7 +764,7 @@
|
||||
<Button Command="{Binding StartDisintegrationCommand}" Content="开始" Style="{StaticResource StartButton}"/>
|
||||
<Button Command="{Binding StopDisintegrationCommand}" Content="停止" Style="{StaticResource StopButton}"/>
|
||||
<Button Command="{Binding SaveDisintegrationResultCommand}" Content="保存记录" Style="{StaticResource SecondaryButton}" IsEnabled="{Binding CanSaveDisintegrationResult}"/>
|
||||
<!--<Button Command="{Binding ResetDisintegrationCommand}" Content="复位" Style="{StaticResource ResetButton}"/>-->
|
||||
<Button Command="{Binding ResetDisintegrationCommand}" Content="复位" Style="{StaticResource ResetButton}"/>
|
||||
</WrapPanel>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
"DisintegrationMovingUpCoil": 30,
|
||||
"DisintegrationStartCoil": 50,
|
||||
"DisintegrationStopCoil": 53,
|
||||
"DisintegrationResetCoil": 100, // 崩解复位M100
|
||||
"DisintegrationSpeed": 330,
|
||||
"DisintegrationTime": 420,
|
||||
"DisintegrationCompleteCoils": [ 200, 201, 202, 203, 204, 205 ],
|
||||
|
||||
Reference in New Issue
Block a user