This commit is contained in:
2026-05-18 11:28:52 +08:00
parent bcf689c0fb
commit d924fbce45
5 changed files with 16 additions and 16 deletions

View File

@@ -70,6 +70,7 @@ namespace TabletTester2025.ViewModels
[ObservableProperty] private double _hardnessWeiyi = 100; // 硬度位移输入mm
//[ObservableProperty] private double _hardnessPoSun = 400; // 硬度破损判定输入N
[ObservableProperty] private double _hardnessMaxN = 72; //最大力采集
//[ObservableProperty] private double HardnessShishilizhi = 72; //最大力采集
@@ -100,6 +101,7 @@ namespace TabletTester2025.ViewModels
[ObservableProperty] private int _hardnessCurrentCount;
[ObservableProperty] private double _hardnessMax;
[ObservableProperty] private double _hardnessMin;
[ObservableProperty] private bool _disintegrationPass; // 新增
@@ -828,18 +830,9 @@ namespace TabletTester2025.ViewModels
await _plc.WriteFloatAsync(_plcConfig.HardnessWeiyi, (float)currentWeiyi);
await _plc.WriteCoilAsync(_plcConfig.HardnessStartCoil, true);
await _plc.WriteCoilAsync(_plcConfig.HardnessStartCoil, true);//启动
bool completed = false;
while (!completed && Phase == TestPhase.Running)
{
await Task.Delay(200);
completed = await _plc.ReadCoilAsync(_plcConfig.HardnessCompleteCoil);
}
HardnessMax = await _plc.ReadFloatAsync(_plcConfig.HardnessMax);
Phase = TestPhase.Completed;
}
catch (Exception ex)
{