| | |
| | | using System.Threading.Tasks; |
| | | using HslCommunication.WebSocket; |
| | | using Newtonsoft.Json; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Math; |
| | | using Quartz; |
| | | using SqlSugar; |
| | | using StackExchange.Profiling.Internal; |
| | |
| | | #endregion |
| | | item.DeviceProParamName = CommandType.Set.ToString(); |
| | | |
| | | |
| | | //å代ç |
| | | //serialPortDevice.Communicator.Write(item.DeviceChildCode + deviceProtocolDetail.ProtocalDetailValue.Replace("[setNum]", (4.5 * 1000).ToString().PadLeft(7, '0')) + "\r");//æå¼ä¸²å£æ¶å
è®¾å¼ |
| | | //item.DeviceProParamName = CommandType.Set.ToString(); |
| | | } |
| | | } |
| | | |
| | |
| | | if (deviceProtocolDetail != null && receiveData.Contains(item.DeviceChildCode + deviceProtocolDetail.ProtocalDetailValue)) |
| | | { |
| | | item.DeviceProParamName = CommandType.Get.ToString(); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | else if (item.DeviceProParamName == CommandType.Get.ToString()) |
| | |
| | | |
| | | item.DeviceProParamName = CommandType.Set.ToString(); |
| | | } |
| | | else if (item.DeviceProParamName == CommandType.Get.ToString()) |
| | | { |
| | | //DeviceProtocolDetailDTO? deviceProtocolDetail = serialPortDevice.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == nameof(CommandResult) && x.ProtocolDetailType == nameof(CommandResult.GetError)); |
| | | //if (deviceProtocolDetail != null && receiveData.Contains(item.DeviceChildCode + deviceProtocolDetail.ProtocalDetailValue)) |
| | | //{ |
| | | // item.DeviceProParamName = CommandType.Set.ToString(); |
| | | |
| | | |
| | | |
| | | //} |
| | | } |
| | | //å代ç |
| | | //item.DeviceProParamName = CommandType.Set.ToString(); |
| | | } |
| | | } |
| | | else if (item.DeviceProParamName == CommandType.Get.ToString()) |
| | | { |
| | | DeviceProtocolDetailDTO? deviceProtocolDetail = serialPortDevice.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == nameof(CommandResult) && x.ProtocolDetailType == nameof(CommandResult.GetError)); |
| | | if (deviceProtocolDetail != null && receiveData.Contains(item.DeviceChildCode + deviceProtocolDetail.ProtocalDetailValue)) |
| | | { |
| | | item.DeviceProParamName = CommandType.Set.ToString(); |
| | | } |
| | | } |
| | | |
| | | |
| | | //建ä¸ä¸ªå¯¹è±¡å°å
¶ä¼ ç»å端 |
| | | string data = JsonConvert.SerializeObject(serialPortDevice);//è¿éserialPortDeviceæ¯å设æè¿ä¸ªå¯¹è±¡ |
| | | _webSocketContext.PublishAllClientPayload(data); |
| | | } |
| | | |
| | | |
| | | //建ä¸ä¸ªå¯¹è±¡å°å
¶ä¼ ç»å端 |
| | | string data = JsonConvert.SerializeObject(serialPortDevice);//è¿éserialPortDeviceæ¯å设æè¿ä¸ªå¯¹è±¡ |
| | | _webSocketContext.PublishAllClientPayload(data); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |