盘点添加35类型写数量

This commit is contained in:
maqiao 2024-12-10 09:44:02 +08:00
parent 5f021e8a3d
commit a3eb3a702f
2 changed files with 13 additions and 4 deletions

View File

@ -54,9 +54,9 @@
<!-- 抽屉串口使用的协议232或者485 -->
<add key="DrawerProtocol" value="485" />
<!-- 抽屉串口的串口号 -->
<add key="DrawerPortPath" value="COM1" />
<add key="DrawerPortPath" value="COM3" />
<!-- can总线串口的串口号 -->
<add key="CanBusPortPath" value="COM17" />
<add key="CanBusPortPath" value="COM11" />
<!-- 条码枪串口的串口号 -->
<add key="ScanCodePortPath" value="COM8" />
<!-- 冰箱的串口号 -->

View File

@ -141,7 +141,7 @@ namespace DM_Weight.ViewModels
// 完成按钮
public DelegateCommand TakeFinish
{
get => new DelegateCommand(() =>
get => new DelegateCommand(async() =>
{
_isFinishClick = true;
List<ChannelStock> record = ChannelStocks.FindAll(it => it.Quantity != it.CheckQuantity).ToList();
@ -206,7 +206,16 @@ namespace DM_Weight.ViewModels
_portUtil.WriteQuantity(it.DrawerNo, it.ColNo, it.CheckQuantity);
});
}
if ((singleChannels.Count > 0 ? singleChannels[0].BoardType : 1) == 35)
{
for (int i = 0; i < singleChannels.Count; i++)
{
await Task.Delay(200);
await _portUtil.WriteChannelInfoMethod(2, (singleChannels[i].CheckQuantity).ToString(), singleChannels[i].DrawerNo, singleChannels[i].ColNo);
await Task.Delay(200);
await _portUtil.ShowContentMethod(singleChannels[i].DrawerNo, singleChannels[i].ColNo);
}
}
RequestData();
AlertMsg alertMsg = new AlertMsg
{