io板卡兼容优化
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using System.IO;
|
||||
using System.Windows.Input;
|
||||
using DeviceCommand.Device;
|
||||
using DeviceCommand.Devices;
|
||||
using Logger;
|
||||
using Prism.Ioc;
|
||||
using TestingModule.ViewModels;
|
||||
@@ -84,18 +85,22 @@ namespace MainModule.ViewModels
|
||||
|
||||
private async Task SilenceBuzzer(string scope)
|
||||
{
|
||||
if (_deviceManager.DeviceMap.TryGetValue("IO板卡(蜂鸣器)", out var lazyIoBoard))
|
||||
if (_deviceManager.IOGroup == null) return;
|
||||
|
||||
if (scope == "default")
|
||||
{
|
||||
if (lazyIoBoard is IOBoard io)
|
||||
for(int i = 1; i <= 8; i++)
|
||||
{
|
||||
if (scope == "default")
|
||||
await io.批量写输出开关(1, 0, [false, false, false, false, false, false, false, false]);
|
||||
else if (scope != TestStatus) return;
|
||||
else
|
||||
{
|
||||
int index = _systemConfig.SharedParameterList.Where(x => x.ParameterName == "蜂鸣器").FirstOrDefault().Value;
|
||||
await io.写输出开关(1, (ushort)index, false);
|
||||
}
|
||||
await _deviceManager.IOGroup.执行台架动作Async(i, 功能动作.蜂鸣器报警, false);
|
||||
}
|
||||
}
|
||||
else if (scope == TestStatus)
|
||||
{
|
||||
int 台架号 = _systemConfig.SharedParameterList
|
||||
.FirstOrDefault(x => x.ParameterName == "台架序号")?.Value ?? 0;
|
||||
if (台架号 >= 1 && 台架号 <= 8)
|
||||
{
|
||||
await _deviceManager.IOGroup.执行台架动作Async(台架号, 功能动作.蜂鸣器报警, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user