From eb5fa4a9485d7eb340584ec0f5bc1736a2b51751 Mon Sep 17 00:00:00 2001 From: "GukSang.Jin" Date: Tue, 19 May 2026 20:14:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ViewModels/StationViewModel.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ViewModels/StationViewModel.cs b/ViewModels/StationViewModel.cs index f48e9ed..5204d9a 100644 --- a/ViewModels/StationViewModel.cs +++ b/ViewModels/StationViewModel.cs @@ -1310,14 +1310,14 @@ namespace TabletTester2025.ViewModels await _plc.WriteFloatAsync(_plcConfig.HardnessSudu, (float)HardnessSudu); await _plc.WriteFloatAsync(_plcConfig.HardnessWeiyi, (float)HardnessWeiyi); - bool completeWasActiveBeforeStart = await _plc.ReadCoilAsync(completeCoil); - await PulseCoilAsync(startCoil); - - if (completeWasActiveBeforeStart) - await WaitForCoilStateAsync(completeCoil, false, TimeSpan.FromSeconds(10), "硬度完成信号未复位"); - while (Phase == TestPhase.Running && _hardnessResults.Count < count) { + bool completeWasActiveBeforeStart = await _plc.ReadCoilAsync(completeCoil); + await PulseCoilAsync(startCoil); + + if (completeWasActiveBeforeStart) + await WaitForCoilStateAsync(completeCoil, false, TimeSpan.FromSeconds(10), "硬度完成信号未复位"); + await WaitForCoilStateAsync(completeCoil, true, TimeSpan.FromSeconds(120), "等待硬度完成信号超时"); double value = await ReadHardnessResultAsync(); _hardnessResults.Add(value);