| | |
| | | /// <param name="conveyorLine">输送线设备对象,用于写入目标地址和 ACK 信号</param> |
| | | /// <param name="nextAddress">下一地址/目标设备编码,用于识别目标设备类型</param> |
| | | /// <param name="childDeviceCode">当前子设备编码,用于精确定位写入哪个子设备</param> |
| | | public void HandleInboundNextAddress(CommonConveyorLine conveyorLine, string nextAddress, string childDeviceCode) |
| | | public bool HandleInboundNextAddress(CommonConveyorLine conveyorLine, string nextAddress, string childDeviceCode) |
| | | { |
| | | // 记录入库场景的调试日志,包含子设备和目标地址信息 |
| | | WriteDebug(conveyorLine, "入库下一地址", childDeviceCode, nextAddress); |
| | | // 委托通用处理方法,入库对应上层(isUpper: true) |
| | | HandleDeviceRequest(conveyorLine, nextAddress, childDeviceCode, Layer.Upper); |
| | | //HandleDeviceRequest(conveyorLine, nextAddress, childDeviceCode, Layer.Upper); |
| | | |
| | | var cvState = conveyorLine.GetValue<ConveyorLineDBNameNew, byte>(ConveyorLineDBNameNew.CV_State, nextAddress); |
| | | bool isAvailable = cvState == 2; |
| | | if (isAvailable) |
| | | { |
| | | return conveyorLine.SetValue(ConveyorLineDBNameNew.Target, Convert.ToInt16(nextAddress), childDeviceCode); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="conveyorLine">输送线设备对象,用于写入目标地址和 ACK 信号</param> |
| | | /// <param name="nextAddress">下一地址/目标设备编码,用于识别目标设备类型</param> |
| | | /// <param name="childDeviceCode">当前子设备编码,用于精确定位写入哪个子设备</param> |
| | | public void HandleOutboundNextAddress(CommonConveyorLine conveyorLine, string nextAddress, string childDeviceCode) |
| | | public bool HandleOutboundNextAddress(CommonConveyorLine conveyorLine, string nextAddress, string childDeviceCode) |
| | | { |
| | | // 记录出库场景的调试日志,包含子设备和目标地址信息 |
| | | WriteDebug(conveyorLine, "出库下一地址", childDeviceCode, nextAddress); |
| | | // 委托通用处理方法,出库对应下层(isUpper: false) |
| | | HandleDeviceRequest(conveyorLine, nextAddress, childDeviceCode, Layer.Lower); |
| | | //HandleDeviceRequest(conveyorLine, nextAddress, childDeviceCode, Layer.Lower); |
| | | |
| | | var cvState = conveyorLine.GetValue<ConveyorLineDBNameNew, byte>(ConveyorLineDBNameNew.CV_State, nextAddress); |
| | | bool isAvailable = cvState == 2; |
| | | if (isAvailable) |
| | | { |
| | | return conveyorLine.SetValue(ConveyorLineDBNameNew.Target, Convert.ToInt16(nextAddress), childDeviceCode); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /// <summary> |