| | |
| | | [Description("高常温堆垛机")] |
| | | public class SpeTemperatureStackerCrane : StackerCraneBase, IStackerCrane |
| | | { |
| | | #region Constants |
| | | |
| | | /// <summary> |
| | | /// 设备等待间隔时间(毫秒) |
| | | /// </summary> |
| | | private const int WaitIntervalMs = 500; |
| | | |
| | | /// <summary> |
| | | /// 设备等待超时时间基数(毫秒) |
| | | /// </summary> |
| | | private const int WaitTimeoutBaseMs = 6000; |
| | | |
| | | /// <summary> |
| | | /// 设备等待超时时间倍数 |
| | | /// </summary> |
| | | private const int WaitTimeoutMultiplier = 10; |
| | | |
| | | /// <summary> |
| | | /// 设备等待总超时时间(毫秒) |
| | | /// </summary> |
| | | private static readonly int WaitTotalTimeoutMs = WaitTimeoutMultiplier * WaitTimeoutBaseMs; |
| | | |
| | | #endregion Constants |
| | | |
| | | #region Private Member |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | if (!Communicator.IsConnected) |
| | | { |
| | | return StackerCraneStatus.Unkonw.ToString(); |
| | | return StackerCraneStatus.Unknown.ToString(); |
| | | } |
| | | |
| | | List<DeviceProDTO> devicePros = _deviceProDTOs.Where(x => x.DeviceProParamType == protocolParamType).ToList(); |
| | |
| | | } |
| | | } |
| | | |
| | | return StackerCraneStatus.Unkonw.ToString(); |
| | | return StackerCraneStatus.Unknown.ToString(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | return typeCode switch |
| | | { |
| | | TypeCode.Boolean => Communicator.Wait(devicePro.DeviceProAddress, 500, 10 * 6000, |
| | | TypeCode.Boolean => Communicator.Wait(devicePro.DeviceProAddress, WaitIntervalMs, WaitTotalTimeoutMs, |
| | | Convert.ToBoolean(deviceProtocolDetail.ProtocalDetailValue)), |
| | | |
| | | TypeCode.Byte => Communicator.Wait(devicePro.DeviceProAddress, 500, 10 * 6000, |
| | | TypeCode.Byte => Communicator.Wait(devicePro.DeviceProAddress, WaitIntervalMs, WaitTotalTimeoutMs, |
| | | Convert.ToByte(deviceProtocolDetail.ProtocalDetailValue)), |
| | | |
| | | TypeCode.Int16 => Communicator.Wait(devicePro.DeviceProAddress, 500, 10 * 6000, |
| | | TypeCode.Int16 => Communicator.Wait(devicePro.DeviceProAddress, WaitIntervalMs, WaitTotalTimeoutMs, |
| | | Convert.ToInt16(deviceProtocolDetail.ProtocalDetailValue)), |
| | | |
| | | TypeCode.Int32 => Communicator.Wait(devicePro.DeviceProAddress, 500, 10 * 6000, |
| | | TypeCode.Int32 => Communicator.Wait(devicePro.DeviceProAddress, WaitIntervalMs, WaitTotalTimeoutMs, |
| | | Convert.ToInt32(deviceProtocolDetail.ProtocalDetailValue)), |
| | | |
| | | TypeCode.UInt16 => Communicator.Wait(devicePro.DeviceProAddress, 500, 10 * 6000, |
| | | TypeCode.UInt16 => Communicator.Wait(devicePro.DeviceProAddress, WaitIntervalMs, WaitTotalTimeoutMs, |
| | | Convert.ToUInt16(deviceProtocolDetail.ProtocalDetailValue)), |
| | | |
| | | TypeCode.UInt32 => Communicator.Wait(devicePro.DeviceProAddress, 500, 10 * 6000, |
| | | TypeCode.UInt32 => Communicator.Wait(devicePro.DeviceProAddress, WaitIntervalMs, WaitTotalTimeoutMs, |
| | | Convert.ToUInt32(deviceProtocolDetail.ProtocalDetailValue)), |
| | | |
| | | _ => new OperateResult<TimeSpan>() |