| | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | //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}"); |