| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WCS.Application.Hub; |
| | | using WCS.Application.Service.WcsDevice.Dto; |
| | | |
| | | namespace WCS.Application; |
| | | public static class HubUtil |
| | |
| | | private static readonly IHubContext<PlcHub, IPlcHub> _plcHubContext = App.GetService<IHubContext<PlcHub, IPlcHub>>(); |
| | | private static readonly IHubContext<PlcDeviceHub, IPlcDeviceHub> _plcDeviceHubContext = App.GetService<IHubContext<PlcDeviceHub, IPlcDeviceHub>>(); |
| | | private static readonly IHubContext<TaskLogHub, ITaskLogHub> _taskLogHubContext = App.GetService<IHubContext<TaskLogHub, ITaskLogHub>>(); |
| | | private static readonly IHubContext<CheckTaskHub, ICheckTaskHub> _checkTaskHubContext = App.GetService<IHubContext<CheckTaskHub, ICheckTaskHub>>(); |
| | | |
| | | /// <summary> |
| | | /// 下发PLC连接状态 |
| | |
| | | if (PLCTaskAction.boRefresh) |
| | | await _plcDeviceHubContext.Clients.All.PublicPlcDevice(context); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 下发分拣任务信息 |
| | | /// </summary> |
| | | /// <param name="context"></param> |
| | | /// <returns></returns> |
| | | public static async Task PublicCheckTask(WcsDeviceTaskOrderDto context) |
| | | { |
| | | if (PLCTaskAction.boRefresh) |
| | | await _checkTaskHubContext.Clients.All.PublicCheckTask(context); |
| | | } |
| | | } |