ResetData方法添加Task关键字

This commit is contained in:
maqiao 2024-07-25 13:03:35 +08:00
parent 06c2f8c0e6
commit 3c8f5c2151
1 changed files with 3 additions and 3 deletions

View File

@ -80,7 +80,7 @@ namespace DM_Weight.Port
public DateTime dateTime { get; set; } = DateTime.Now;
public async void ResetData()
public async Task ResetData()
{
logger.Info($"重新设置串口数据状态【{statue}】,抽屉【{DrawerNo}】");
if (!"HomeWindow".Equals(WindowName) && statue == 1)
@ -437,15 +437,15 @@ namespace DM_Weight.Port
await BoxLockLightOff2();
}
string _WindowName = WindowName;
logger.Info($"抽屉【{DrawerNo}】已关闭");
// 重新初始化数据
ResetData();
await ResetData();
// 返回消息 抽屉已经关闭
_eventAggregator.GetEvent<PortUtilEvent>().Publish(new util.DeviceMsg()
{
EventType = util.EventType.DRAWERCLOSE,
WindowName = _WindowName,
});
logger.Info($"抽屉【{DrawerNo}】已关闭");
}
}