io板卡兼容优化

This commit is contained in:
hsc
2026-07-20 15:45:36 +08:00
parent 48492973c3
commit 7f2721ab11
6 changed files with 224 additions and 36 deletions

View File

@@ -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);
}
}
}