test
This commit is contained in:
@@ -17,7 +17,8 @@
|
|||||||
public ushort HardnessSudu { get; set; }
|
public ushort HardnessSudu { get; set; }
|
||||||
public ushort HardnessWeiyi { get; set; }
|
public ushort HardnessWeiyi { get; set; }
|
||||||
public ushort HardnessPoSun { get; set; }
|
public ushort HardnessPoSun { get; set; }
|
||||||
|
public ushort HardnessForward { get; set; }
|
||||||
|
public ushort HardnessBack { get; set; }
|
||||||
|
|
||||||
// 脆碎度
|
// 脆碎度
|
||||||
public ushort FriabilityStartCoil { get; set; }
|
public ushort FriabilityStartCoil { get; set; }
|
||||||
|
|||||||
@@ -108,7 +108,8 @@ namespace TabletTester2025.ViewModels
|
|||||||
public IAsyncRelayCommand HardnessUpCommand { get; }
|
public IAsyncRelayCommand HardnessUpCommand { get; }
|
||||||
public IAsyncRelayCommand HardnessDownCommand { get; }
|
public IAsyncRelayCommand HardnessDownCommand { get; }
|
||||||
public IAsyncRelayCommand HardnessResetCommand { get; }
|
public IAsyncRelayCommand HardnessResetCommand { get; }
|
||||||
public IAsyncRelayCommand PrintHardnessCommand { get; }
|
public IAsyncRelayCommand HardnessForward { get; }//前进
|
||||||
|
public IAsyncRelayCommand HardnessBack { get; }//后退
|
||||||
|
|
||||||
// 脆碎度新增
|
// 脆碎度新增
|
||||||
[ObservableProperty] private double _friabilityTargetRpm = 25;
|
[ObservableProperty] private double _friabilityTargetRpm = 25;
|
||||||
@@ -244,7 +245,22 @@ namespace TabletTester2025.ViewModels
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
PrintHardnessCommand = new AsyncRelayCommand(async () => await PrintReport("硬度"));
|
// 硬前进按钮命令
|
||||||
|
HardnessForward = new AsyncRelayCommand(async () =>
|
||||||
|
{
|
||||||
|
|
||||||
|
await _plc.WriteCoilAsync(_plcConfig.HardnessForward, true);
|
||||||
|
await Task.Delay(100); // 脉冲宽度,和复位按钮保持一致
|
||||||
|
await _plc.WriteCoilAsync(_plcConfig.HardnessForward, false);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 硬后退按钮命令
|
||||||
|
HardnessForward = new AsyncRelayCommand(async () =>
|
||||||
|
{
|
||||||
|
await _plc.WriteCoilAsync(_plcConfig.HardnessBack, true);
|
||||||
|
await Task.Delay(100); // 脉冲宽度,和复位按钮保持一致
|
||||||
|
await _plc.WriteCoilAsync(_plcConfig.HardnessBack, false);
|
||||||
|
});
|
||||||
|
|
||||||
// 硬度命令停止
|
// 硬度命令停止
|
||||||
StopHardnessCommand = new AsyncRelayCommand(async() => {
|
StopHardnessCommand = new AsyncRelayCommand(async() => {
|
||||||
@@ -309,9 +325,7 @@ namespace TabletTester2025.ViewModels
|
|||||||
{
|
{
|
||||||
switch (CurrentTest)
|
switch (CurrentTest)
|
||||||
{
|
{
|
||||||
case TestType.Hardness:
|
|
||||||
HardnessPoSun = await _plc.ReadFloatAsync(_plcConfig.HardnessPoSun);
|
|
||||||
break;
|
|
||||||
case TestType.Disintegration:
|
case TestType.Disintegration:
|
||||||
DisintegrationTemp = await _plc.ReadFloatAsync(_plcConfig.DisintegrationTemp);
|
DisintegrationTemp = await _plc.ReadFloatAsync(_plcConfig.DisintegrationTemp);
|
||||||
IsBasketMovingUp = await _plc.ReadCoilAsync(_plcConfig.DisintegrationMovingUpCoil);
|
IsBasketMovingUp = await _plc.ReadCoilAsync(_plcConfig.DisintegrationMovingUpCoil);
|
||||||
@@ -814,12 +828,12 @@ namespace TabletTester2025.ViewModels
|
|||||||
|
|
||||||
double currentSpeed = _hardnessSudu;
|
double currentSpeed = _hardnessSudu;
|
||||||
double currentWeiyi = _hardnessWeiyi;
|
double currentWeiyi = _hardnessWeiyi;
|
||||||
double currentPoSun = _hardnessPoSun;
|
|
||||||
|
|
||||||
// 如果你需要把这3个值发给PLC,就在这里发一次(测试开始用当前参数)
|
// 如果你需要把这3个值发给PLC,就在这里发一次(测试开始用当前参数)
|
||||||
await _plc.WriteFloatAsync(_plcConfig.HardnessSudu, (float)currentSpeed);
|
await _plc.WriteFloatAsync(_plcConfig.HardnessSudu, (float)currentSpeed);
|
||||||
await _plc.WriteFloatAsync(_plcConfig.HardnessWeiyi, (float)currentWeiyi);
|
await _plc.WriteFloatAsync(_plcConfig.HardnessWeiyi, (float)currentWeiyi);
|
||||||
await _plc.WriteFloatAsync(_plcConfig.HardnessPoSun, (float)currentPoSun);
|
|
||||||
|
|
||||||
// 开始循环测试
|
// 开始循环测试
|
||||||
for (int i = 0; i < count; i++)
|
for (int i = 0; i < count; i++)
|
||||||
@@ -835,7 +849,7 @@ namespace TabletTester2025.ViewModels
|
|||||||
|
|
||||||
double val = await _plc.ReadFloatAsync(_plcConfig.HardnessPoSun);
|
double val = await _plc.ReadFloatAsync(_plcConfig.HardnessPoSun);
|
||||||
_hardnessResults.Add(val);
|
_hardnessResults.Add(val);
|
||||||
HardnessPoSun = val;
|
//HardnessPoSun = val;
|
||||||
|
|
||||||
await Task.Delay(1000);
|
await Task.Delay(1000);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user