| | |
| | | { |
| | | if (Communicator.IsConnected) |
| | | { |
| | | List<DeviceProDTO> devicePros = _deviceProDTOs.Where(x => x.DeviceChildCode == deviceChildCode && x.DeviceProParamName == "RequestPut").ToList(); |
| | | if (devicePros.Count == 0) |
| | | var devicePro = _deviceProDTOs.Where(x => x.DeviceChildCode == deviceChildCode && x.DeviceProParamName == "AllowPut").FirstOrDefault(); |
| | | if (devicePro == null) |
| | | { |
| | | //todo åè®®ä¿¡æ¯æªè·åå°æ¶æåºå¼å¸¸ |
| | | throw new Exception(); |
| | | throw new Exception($"{deviceChildCode}åè®®ä¿¡æ¯æªæ¾å°"); |
| | | } |
| | | |
| | | for (int i = 0; i < devicePros.Count; i++) |
| | | { |
| | | object readStatus = Communicator.ReadAsObj(devicePros[i].DeviceProAddress, devicePros[i].DeviceDataType); |
| | | //todo åè®®æç»ä¿¡æ¯æªè·åå°æ¶æåºå¼å¸¸ |
| | | DeviceProtocolDetailDTO? deviceProtocolDetail = _deviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == deviceChildCode) ?? throw new Exception(); |
| | | deviceProtocolDetail = _deviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == deviceChildCode && x.ProtocalDetailValue.Equals(readStatus.ToString())); |
| | | if (deviceProtocolDetail != null) |
| | | { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | object readStatus = Communicator.ReadAsObj(devicePro.DeviceProAddress, devicePro.DeviceDataType); |
| | | |
| | | |
| | | //for (int i = 0; i < devicePros.Count; i++) |
| | | //{ |
| | | // object readStatus = Communicator.ReadAsObj(devicePros[i].DeviceProAddress, devicePros[i].DeviceDataType); |
| | | // //todo åè®®æç»ä¿¡æ¯æªè·åå°æ¶æåºå¼å¸¸ |
| | | // DeviceProtocolDetailDTO? deviceProtocolDetail = _deviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == deviceChildCode) ?? throw new Exception(); |
| | | // deviceProtocolDetail = _deviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == deviceChildCode && x.ProtocalDetailValue.Equals(readStatus.ToString())); |
| | | // if (deviceProtocolDetail != null) |
| | | // { |
| | | // return true; |
| | | // } |
| | | // return false; |
| | | //} |
| | | } |
| | | //todo é讯æªè¿æ¥æ¶æåºå¼å¸¸ |
| | | return false; |