| | |
| | | { |
| | | return DeviceStatus.Idle; |
| | | } |
| | | else if (StackerCraneWorkStatusValue == StackerCraneWorkStatus.Putting || StackerCraneWorkStatusValue == StackerCraneWorkStatus.PickUp || StackerCraneWorkStatusValue == StackerCraneWorkStatus.PickUpCompleted || StackerCraneWorkStatusValue == StackerCraneWorkStatus.PutCompleted) |
| | | else if (StackerCraneWorkStatusValue == StackerCraneWorkStatus.Putting || StackerCraneWorkStatusValue == StackerCraneWorkStatus.PickUp || StackerCraneWorkStatusValue == StackerCraneWorkStatus.PutMove || StackerCraneWorkStatusValue == StackerCraneWorkStatus.PutCompleted) |
| | | { |
| | | return DeviceStatus.Working; |
| | | } |
| | |
| | | private int GetCurrentTaskNum() |
| | | { |
| | | DeviceProDTO? devicePro = _deviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == nameof(CurrentTaskNum)); |
| | | return devicePro == null ? throw new Exception($"读取当前任务号错误,未获取到协议信息,请检查配置参数名称是否配置,且配置为为{nameof(CurrentTaskNum)}") : (int)Communicator.ReadAsObj(devicePro.DeviceProAddress, devicePro.DeviceDataType); |
| | | if (devicePro == null) |
| | | throw new Exception($"读取当前任务号错误,未获取到协议信息,请检查配置参数名称是否配置,且配置为{nameof(CurrentTaskNum)}"); |
| | | |
| | | object value = Communicator.ReadAsObj(devicePro.DeviceProAddress, devicePro.DeviceDataType); |
| | | return Convert.ToInt32(value); // 统一转换为 int |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | return deviceProtocolDetail.ProtocolDetailType; |
| | | } |
| | | return StackerCraneStatus.Unkonw.ToString(); |
| | | return StackerCraneStatus.Unknown.ToString(); |
| | | } |
| | | } |
| | | return StackerCraneStatus.Unkonw.ToString(); |
| | | return StackerCraneStatus.Unknown.ToString(); |
| | | } |
| | | |
| | | private void CheckConnect() |