cjs
2025-06-16 fee025c0d4fb4fd41d9dbf81b6435fd8e6229d5c
ams/Hanhe.iWCS.JingmenGEMTwoProtocol/ProcessHelper.cs
@@ -697,51 +697,52 @@
                if (plc.Count > 0)
                {
                    #region 判断输送线模式 变更注释
                    //bool action = true;
                    //foreach(var a in plc)
                    //{
                    //    var modeResult = OITcpHelper.RegisterReadOutPut(new OITcpHelper.RegisterReadOutPutModel
                    //    {
                    //        dataNum = 1,
                    //        addr = a.readAddr + 3,
                    //        host = a.ip,
                    //        port = a.port
                    //    });
                    //    if (modeResult != null && modeResult.errCode == 0)
                    //    {
                    //        CMMLog.Debug($"OutWareTask:读取滚筒机{a.ip}通道号为:{a.readAddr + 3}的值为:{modeResult.result[0]}");
                    //        if (modeResult.result[0] == 2)
                    //        {
                    //            action = false;
                    //            CMMLog.Debug($"OutWareTask:输送线为 入库模式,输送线点位:{a.location}");
                    //            break;
                    //        }
                    //        else
                    //        {
                    //            //读取中间表模式
                    //            var modelInfo = MongoDBSingleton.Instance.FindOne<ModeList>("ModeList");
                    //            if (modelInfo != null)
                    //            {
                    //                if (modelInfo.Mode == "入库模式")
                    //                {
                    //                    action = false;
                    //                    CMMLog.Debug($"OutWareTask:中间表 ModeList为 入库模式");
                    //                    break;
                    //                }
                    //            }
                    //            else
                    //            {
                    //                action = false;
                    //                CMMLog.Debug("OutWareTask:中间表 ModeList 为空");
                    //                break;
                    //            }
                    //        }
                    //    }
                    //};
                    //if (!action)
                    //{
                    //    return false;
                    //}
                    foreach(var a in plc)
                    {
                        bool action = false;
                        var modeResult = OITcpHelper.RegisterReadOutPut(new OITcpHelper.RegisterReadOutPutModel
                        {
                            dataNum = 1,
                            addr = a.readAddr + 3,
                            host = a.ip,
                            port = a.port
                        });
                        if (modeResult != null && modeResult.errCode == 0)
                        {
                            CMMLog.Debug($"OutWareTask:读取滚筒机{a.ip}通道号为:{a.readAddr + 3}的值为:{modeResult.result[0]}");
                            if (modeResult.result[0] == 2)
                            {
                                CMMLog.Debug($"OutWareTask:输送线为 入库模式,输送线点位:{a.location}");
                                break;
                            }
                            else
                            {
                                //读取中间表模式
                                var modelInfo = MongoDBSingleton.Instance.FindOne<ModeList>("ModeList");
                                if (modelInfo != null)
                                {
                                    if (modelInfo.Mode == "入库模式")
                                    {
                                        CMMLog.Debug($"OutWareTask:中间表 ModeList为 入库模式");
                                    }
                                    else
                                    {
                                        action = true;
                                    }
                                }
                                else
                                {
                                    CMMLog.Debug("OutWareTask:中间表 ModeList 为空");
                                }
                            }
                        }
                        if (!action)
                        {
                            return false;
                        }
                    };
                    #endregion