11
cjs
2025-06-26 74848b76f6ba1239f53cdf603a2f4904aa2434ef
11
1个文件已修改
24 ■■■■ 已修改文件
ams/Hanhe.iWCS.JingmenGLMNorthProtocol/PLCControl.cs 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ams/Hanhe.iWCS.JingmenGLMNorthProtocol/PLCControl.cs
@@ -201,7 +201,14 @@
                                                                if (ERPService.ERPSwitch01 == "0") MongoDBSingleton.Instance.Remove<MachineInfoTwo>(Query.EQ("machineNo", pmInfo.location), "MachineInfoTwo", RemoveFlags.None);
                                                                CMMLog.Debug($"包装下线流程-{pmInfo.location}:叠托层数为0,不允许生成任务");
                                                            }
                                                            else if (tray.trayCode != "0" && !string.IsNullOrEmpty(tray.trayCode))
                                                            if (string.IsNullOrEmpty(tray.lotNo))
                                                            {
                                                                 MongoDBSingleton.Instance.Remove<MachineInfo>(Query.EQ("machineNo", pmInfo.location), "MachineInfo", RemoveFlags.None);
                                                                 if (ERPService.ERPSwitch01 == "0") MongoDBSingleton.Instance.Remove<MachineInfoTwo>(Query.EQ("machineNo", pmInfo.location), "MachineInfoTwo", RemoveFlags.None);
                                                                 CMMLog.Debug($"包装下线流程-{pmInfo.location}:批次号为空,不允许生成任务");
                                                            }
                                                            if (tray.trayCode != "0" && !string.IsNullOrEmpty(tray.trayCode))
                                                            {
                                                                string timeStamp = ProcessHelper.GetTimeStamp(31, 1, 1);
                                                                HHAmsExecuteResult req = AMSHelper.CreateTask(DateTime.Now.Ticks.ToString(), pmInfo.location, PlcBit02, "3楼包装取料", 0, tray.trayCode, timeStamp);
@@ -402,7 +409,14 @@
                                                            if (ERPService.ERPSwitch01 == "0") MongoDBSingleton.Instance.Remove<MachineInfoTwo>(Query.EQ("machineNo", pmInfo.location), "MachineInfoTwo", RemoveFlags.None);
                                                            CMMLog.Debug($"包装下线流程-{pmInfo.location}:叠托层数为0,不允许生成任务");
                                                        }
                                                        else if (tray.trayCode != "0" && !string.IsNullOrEmpty(tray.trayCode))
                                                        if (string.IsNullOrEmpty(tray.lotNo))
                                                        {
                                                            MongoDBSingleton.Instance.Remove<MachineInfo>(Query.EQ("machineNo", pmInfo.location), "MachineInfo", RemoveFlags.None);
                                                            if (ERPService.ERPSwitch01 == "0") MongoDBSingleton.Instance.Remove<MachineInfoTwo>(Query.EQ("machineNo", pmInfo.location), "MachineInfoTwo", RemoveFlags.None);
                                                            CMMLog.Debug($"包装下线流程-{pmInfo.location}:批次号为空,不允许生成任务");
                                                        }
                                                        if (tray.trayCode != "0" && !string.IsNullOrEmpty(tray.trayCode))
                                                        {
                                                            string timeStamp = ProcessHelper.GetTimeStamp(31, 1, 1);
                                                            HHAmsExecuteResult req = AMSHelper.CreateTask(DateTime.Now.Ticks.ToString(), pmInfo.location, PlcBit02, "3楼包装取料", 0, tray.trayCode, timeStamp);
@@ -1156,10 +1170,10 @@
                                //Convert.ToInt32(Completion(result[8]) + Completion(result[9]), 2).ToString()
                                //(decimal.Parse(tray.oneTrayWeight1) / 100).ToString("F2");
                                //string weight = (decimal.Parse(Convert.ToInt32(Completion(result.result[4]) + Completion(result.result[5]), 2).ToString()) / 100).ToString("F2");
                                string weight = ((result.result[4] * 65536 + result.result[5]) / 100).ToString();
                                string weight = ((result.result[3] * 65536 + result.result[4]) / 100).ToString();
                                CMMLog.Debug($"SecondWeightActionOne: 读取设备{plc.location},ip:{plc.ip}通道{plc.readAddr + 4}里面数据为{result.result[4]}.");
                                CMMLog.Debug($"SecondWeightActionOne: 读取设备{plc.location},ip:{plc.ip}通道{plc.readAddr + 5}里面数据为{result.result[5]}.");
                                CMMLog.Info($"SecondWeightActionOne: 读取设备{plc.location},ip:{plc.ip}通道{plc.readAddr + 4}里面数据为{result.result[3]}.");
                                CMMLog.Info($"SecondWeightActionOne: 读取设备{plc.location},ip:{plc.ip}通道{plc.readAddr + 5}里面数据为{result.result[4]}.");
                                //double x = (double)Convert.ToInt32(Completion(result[8]) + Completion(result[9]), 2) / 100;
                                //CMMLog.Info($"SecondWeightActionOne: 读取设备{plc.location},ip:{plc.ip}通道{plc.readAddr + 4}里面数据为{result.result[3]}.");
                                CMMLog.Info($"SecondWeightActionOne: weight:{weight}");