| | |
| | | { |
| | | "Version": 1, |
| | | "WorkspaceRootPath": "C:\\software\\A-\u5DE5\u4F5C\\\u6E90\u7801\\GIT\\\u8346\u95E8\u683C\u6797\u7F8E\u5357\u533A\\ams\\Hanhe.iWCS.JingmenGEMTwoProtocol\\", |
| | | "Documents": [], |
| | | "Documents": [ |
| | | { |
| | | "AbsoluteMoniker": "D:0:0:{BCE5B4FC-C2CD-459E-AAD0-34D4900B4528}|Hanhe.iWCS.JingmenGEMTwoProtocol.csproj|c:\\software\\a-\u5DE5\u4F5C\\\u6E90\u7801\\git\\\u8346\u95E8\u683C\u6797\u7F8E\u5357\u533A\\ams\\hanhe.iwcs.jingmengemtwoprotocol\\enentlisten.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", |
| | | "RelativeMoniker": "D:0:0:{BCE5B4FC-C2CD-459E-AAD0-34D4900B4528}|Hanhe.iWCS.JingmenGEMTwoProtocol.csproj|solutionrelative:enentlisten.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" |
| | | } |
| | | ], |
| | | "DocumentGroupContainers": [ |
| | | { |
| | | "Orientation": 0, |
| | |
| | | "DocumentGroups": [ |
| | | { |
| | | "DockedWidth": 16, |
| | | "SelectedChildIndex": -1, |
| | | "SelectedChildIndex": 7, |
| | | "Children": [ |
| | | { |
| | | "$type": "Bookmark", |
| | |
| | | { |
| | | "$type": "Bookmark", |
| | | "Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}" |
| | | }, |
| | | { |
| | | "$type": "Document", |
| | | "DocumentIndex": 0, |
| | | "Title": "EnentListen.cs", |
| | | "DocumentMoniker": "C:\\software\\A-\u5DE5\u4F5C\\\u6E90\u7801\\GIT\\\u8346\u95E8\u683C\u6797\u7F8E\u5357\u533A\\ams\\Hanhe.iWCS.JingmenGEMTwoProtocol\\EnentListen.cs", |
| | | "RelativeDocumentMoniker": "EnentListen.cs", |
| | | "ToolTip": "C:\\software\\A-\u5DE5\u4F5C\\\u6E90\u7801\\GIT\\\u8346\u95E8\u683C\u6797\u7F8E\u5357\u533A\\ams\\Hanhe.iWCS.JingmenGEMTwoProtocol\\EnentListen.cs", |
| | | "RelativeToolTip": "EnentListen.cs", |
| | | "ViewState": "AgIAACoAAAAAAAAAAAAAAGAAAAA2AAAAAAAAAA==", |
| | | "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", |
| | | "WhenOpened": "2025-06-03T09:14:58.365Z", |
| | | "EditorCaption": "" |
| | | } |
| | | ] |
| | | }, |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 10015-MES入库反馈 |
| | | if (currActionModel.CN_N_ACTION_CODE == 10015) |
| | | #region 10016-MES入库反馈 |
| | | if (currActionModel.CN_N_ACTION_CODE == 10016) |
| | | { |
| | | ERPService.SendMESTaskCompleteFunc(); |
| | | } |
| | | #endregion |
| | | |
| | | #region 四钴 |
| | | |
| | | #region 10017-A口 |
| | | if (currActionModel.CN_N_ACTION_CODE == 10017) |
| | | { |
| | | var plc = Settings.GetPlcInfo().Where(a => a.enable == 1 && a.deviceType == "41").FirstOrDefault(); |
| | | if (plc != null) |
| | | { |
| | | PLCControl.AMachine(plc); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 10018-C口 |
| | | if (currActionModel.CN_N_ACTION_CODE == 10018) |
| | | { |
| | | var list = Settings.GetPlcInfo().Where(a => a.enable == 1 && a.deviceType == "42").ToList(); |
| | | if (list.Count > 0) |
| | | { |
| | | list.ForEach(a => |
| | | { |
| | | PLCControl.CMachine(a); |
| | | }); |
| | | } |
| | | Thread.Sleep(3000); |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | return bResult; |
| | | } |
| | | |
| | |
| | | CMMLog.Info($"在通道{plc.writeAddr + 2}中写入{JsonConvert.SerializeObject(num)},ip:{plc.ip},端口:{plc.port}"); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 四钴A(洗板烘干机组)设备上空下满 |
| | | /// </summary> |
| | | /// <param name="plc"></param> |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | internal static void AMachine(Settings.PlcInfo plc) |
| | | { |
| | | if (PickUpStartFree(plc.location) && PickUpEndFree(plc.location)) |
| | | { |
| | | try |
| | | { |
| | | var result = OITcpHelper.RegisterReadOutPut(new OITcpHelper.RegisterReadOutPutModel |
| | | { |
| | | dataNum = 1, |
| | | addr = plc.readAddr, |
| | | host = plc.ip, |
| | | port = plc.port |
| | | }); |
| | | if (result != null && result.errCode == 0) |
| | | { |
| | | if (result.result[0] == 1) |
| | | { |
| | | //送空 |
| | | bool req = WMSHelper.WMSOut(plc.location, "", ""); |
| | | if (req) CMMLog.Debug($"四钴A设备 调用WMS获取空托出库生成任务成功!");//现在任务由WMS自己下发,AMS做拦截处理(查询ext1里面对应的任务类型,并更改任务类型) |
| | | else CMMLog.Debug($"四钴A设备 调用WMS获取空托出库生成任务失败!"); |
| | | } |
| | | if (result.result[0] == 2) |
| | | { |
| | | //取满 |
| | | string wmstaskno = ""; |
| | | string traycode = ""; |
| | | bool req = WMSHelper.WMSIn(plc.location, "", ref wmstaskno, ref traycode); |
| | | if (req) CMMLog.Debug($"四钴A设备 调用WMS获取满托入库生成任务成功!");//现在任务由WMS自己下发,AMS做拦截处理(查询ext1里面对应的任务类型,并更改任务类型) |
| | | else CMMLog.Debug($"四钴A设备 调用WMS获取满托入库生成任务失败!"); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | CMMLog.Info($"四钴A设备 err:{ex.Message}"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 四钴C(钴板剪切机组)设备上满下空 |
| | | /// </summary> |
| | | /// <param name="a"></param> |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | internal static void CMachine(Settings.PlcInfo plc) |
| | | { |
| | | if (PickUpStartFree(plc.location) && PickUpEndFree(plc.location)) |
| | | { |
| | | try |
| | | { |
| | | var result = OITcpHelper.RegisterReadOutPut(new OITcpHelper.RegisterReadOutPutModel |
| | | { |
| | | dataNum = 1, |
| | | addr = plc.readAddr, |
| | | host = plc.ip, |
| | | port = plc.port |
| | | }); |
| | | if (result != null && result.errCode == 0) |
| | | { |
| | | if (result.result[0] == 1) |
| | | { |
| | | //送满 |
| | | bool req = WMSHelper.WMSOut(plc.location, "", ""); |
| | | if (req) CMMLog.Debug($"四钴C设备 调用WMS获取满托出库生成任务成功!");//现在任务由WMS自己下发,AMS做拦截处理(查询ext1里面对应的任务类型,并更改任务类型) |
| | | else CMMLog.Debug($"四钴C设备 调用WMS获取满托出库生成任务失败!"); |
| | | } |
| | | if (result.result[0] == 2) |
| | | { |
| | | //取空 |
| | | string wmstaskno = ""; |
| | | string traycode = ""; |
| | | bool req = WMSHelper.WMSIn(plc.location, "", ref wmstaskno, ref traycode); |
| | | if (req) CMMLog.Debug($"四钴C设备 调用WMS获取空托入库生成任务成功!");//现在任务由WMS自己下发,AMS做拦截处理(查询ext1里面对应的任务类型,并更改任务类型) |
| | | else CMMLog.Debug($"四钴C设备 调用WMS获取空托入库生成任务失败!"); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | CMMLog.Info($"四钴C设备 err:{ex.Message}"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | public class WMS_STOCK_VIEW |
| | |
| | | |
| | | internal static void recordInfo(string taskName,string errMsg) |
| | | { |
| | | //var errInfo = MongoDBSingleton.Instance.FindOne<errInfoTable>(Query.EQ("taskName", taskName), "errInfoTable"); |
| | | //if(errInfo != null) |
| | | //{ |
| | | // MongoDBSingleton.Instance.Update<errInfoTable>(Query.EQ("_id", errInfo._id), Update.Set("errMsg", errMsg).Set("dateTime", DateTime.Now), UpdateFlags.None); |
| | | //} |
| | | //else |
| | | //{ |
| | | // MongoDBSingleton.Instance.Insert<errInfoTable>(new errInfoTable |
| | | // { |
| | | // taskName = taskName, |
| | | // errMsg = errMsg, |
| | | // dateTime = DateTime.Now |
| | | // }); |
| | | //} |
| | | var errInfo = MongoDBSingleton.Instance.FindOne<errInfoTable>(Query.EQ("taskName", taskName), "errInfoTable"); |
| | | if(errInfo != null) |
| | | { |
| | | MongoDBSingleton.Instance.Update<errInfoTable>(Query.EQ("_id", errInfo._id), Update.Set("errMsg", errMsg).Set("dateTime", DateTime.Now), UpdateFlags.None); |
| | | } |
| | | else |
| | | { |
| | | MongoDBSingleton.Instance.Insert<errInfoTable>(new errInfoTable |
| | | { |
| | | taskName = taskName, |
| | | errMsg = errMsg, |
| | | dateTime = DateTime.Now |
| | | }); |
| | | } |
| | | } |
| | | |
| | | internal static void deleteInfo(string taskName) |
| | | { |
| | | //MongoDBSingleton.Instance.Remove<errInfoTable>(Query.EQ("taskName", taskName), RemoveFlags.None); |
| | | MongoDBSingleton.Instance.Remove<errInfoTable>(Query.EQ("taskName", taskName), RemoveFlags.None); |
| | | } |
| | | |
| | | |
| | |
| | | #endregion |
| | | |
| | | |
| | | CMMLog.Info($"OutWareTask 11111"); |
| | | string ssx01 = plc[0].location; |
| | | string ssx02 = plc[1].location; |
| | | //CMMLog.Info($"查询输送线当前点位:{a.location}"); |
| | | var slptInfo1 = MongoDBSingleton.Instance.FindOne<SLPTLoc>(Query.EQ("locCode", ssx01), "SLPTLoc"); |
| | | if (slptInfo1 == null) |
| | | { |
| | | CMMLog.Info($"OutWareTask 222222"); |
| | | endMachLoc = ssx01; |
| | | slptInfo1 = new SLPTLoc |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | CMMLog.Info($"OutWareTask 3333333"); |
| | | var slptInfo2 = MongoDBSingleton.Instance.FindOne<SLPTLoc>(Query.EQ("locCode", ssx02), "SLPTLoc"); |
| | | if (slptInfo2 == null) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | CMMLog.Info($"OutWareTask 44444444444"); |
| | | var loc = slptInfo1.taskNum <= slptInfo2.taskNum ? slptInfo1 : slptInfo2; |
| | | CMMLog.Info("OutWareTask :" + JsonConvert.SerializeObject(loc)); |
| | | if (loc.taskNum < 2) |
| | |
| | | IEnentListen insertMidTable = DataAccess.CreateEnentListen(); |
| | | insertMidTable.EnentSubscribe(new TN_I_TASK_DTL_ACTION() { CN_N_ACTION_CODE = 10015 }); |
| | | |
| | | //MES入库反馈 |
| | | IEnentListen SendMESTaskCompleteFunc = DataAccess.CreateEnentListen(); |
| | | SendMESTaskCompleteFunc.EnentSubscribe(new TN_I_TASK_DTL_ACTION() { CN_N_ACTION_CODE = 10016 }); |
| | | |
| | | } |
| | | public class YourReceiveFilter : IReceiveFilterFactory<BinaryRequestInfo> { |
| | | public IReceiveFilter<BinaryRequestInfo> CreateFilter(IAppServer appServer, IAppSession appSession, System.Net.IPEndPoint remoteEndPoint) { |