From 7af0e7363558908e3f08db6a2cabbebca13ddf54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=97=E9=93=AD=20=E5=90=95?= <896951544@qq.com> Date: Wed, 14 May 2025 14:23:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8F=8C=E6=B7=B1=E5=8F=96?= =?UTF-8?q?=E8=B4=A7=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IOControlStatus/CGetDeviceState.cs | 2 +- WcfControlMonitorLib/CControl.cs | 114 +++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+), 1 deletion(-) diff --git a/IOControlStatus/CGetDeviceState.cs b/IOControlStatus/CGetDeviceState.cs index 993374c..c5f269c 100644 --- a/IOControlStatus/CGetDeviceState.cs +++ b/IOControlStatus/CGetDeviceState.cs @@ -59,7 +59,7 @@ namespace IOControlStatus { try { - int fid = Model.CGeneralFunction.GetManageTaskIndexfromMonitor(TaskIndex); + long fid = Model.CGeneralFunction.GetManageTaskIndexfromMonitor(TaskIndex); int mankind = Model.CGeneralFunction.GetManageTaskKindIndexFromMonitor(TaskIndex); if (mankind == 1) { diff --git a/WcfControlMonitorLib/CControl.cs b/WcfControlMonitorLib/CControl.cs index a7cb44f..010f9fc 100644 --- a/WcfControlMonitorLib/CControl.cs +++ b/WcfControlMonitorLib/CControl.cs @@ -2156,6 +2156,120 @@ namespace WcfControlMonitorLib } } #endregion + #region 双伸位的堆垛机在执行起点是里位(1,4排)的任务时,判读是否有起点是外位(2,3排)的任务 同时判断 送货到货位时(终点为2,3)判断有没有(1,4)的任务,控制近远叉取送货先后 + if (devinfo.StackReach == 2 && DeviceKind == 1 && (order == 4))// 双伸堆垛机, 取货 + { + int[] zxy = ccf.GetCoordinatesFromMonitorTask(minMidx); + string neighborzxy = string.Empty; + string sqlstrzxy = string.Empty;// + string sqlman = string.Empty; + //bool insidecell = false;//当前任务对应的里位还是外位 + bool check = false; + if (zxy != null) + { + int getZ = zxy[0];//取货的排坐标 + int sendZ = zxy[3]; //送货位置对应的排坐标 + int newZ, newX, newY; + int tempZ = getZ; + + + // if (tempZ>4) + //{ + tempZ = getZ % 4; + //} + + + if (tempZ == 1 || tempZ == 0)//里位取货时,要判读是否有外位的取货任务 + {//获取外位坐标 + if (tempZ == 1) + { + newZ = getZ + 1; + } + else + { + newZ = getZ - 1; + } + neighborzxy = string.Format("{0:D3}-{1:D3}-{2:D3}", newZ, zxy[1], zxy[2]);//获得外位坐标 + sqlstrzxy = string.Format("SELECT F_MonitorIndex FROM T_Monitor_Task WHERE (F_DeviceCommandIndex =4) and (F_NumParam1 = {0}) AND (F_NumParam2 = {1}) AND (F_NumParam3 = {2}) and (F_DeviceIndex={3})", newZ, zxy[1], zxy[2], DeviceIdx); + //sqlstrzxy + sqlman = string.Format("SELECT FID FROM T_Manage_Task WHERE (FSTATUS = 0) AND(FSTARTDEVICE = {0}) AND (FSTARTCELL = '{1}') ", StartDevice, neighborzxy); + //sqlstrzxy + + + check = true; + + if (check) + { + dvdv = dbo.ExceSQL(sqlstrzxy).Tables[0].DefaultView; + if (dvdv.Count > 0)// + { + + AheadDetectUnallow.Append(string.Format("存在相邻货位{0}的优先任务,该任务暂时不能执行! ", neighborzxy)); + + UpdateAheadDetectUnallow(AheadDetectUnallow, minMidx); + return false;//不能执行出库任务 + + + + } + dvdv = dbo.ExceSQL(sqlman).Tables[0].DefaultView; + if (dvdv.Count > 0)// + { + + AheadDetectUnallow.Append(string.Format("存在相邻货位{0}的优先任务,该任务暂时不能执行! ", neighborzxy)); + + UpdateAheadDetectUnallow(AheadDetectUnallow, minMidx); + return false;//不能执行出库任务 + } + } + } + tempZ = sendZ; + //if (tempZ>4) + //{ + tempZ = sendZ % 4; + //} + if (tempZ == 2 || tempZ == 3)//外位送货时,要判读是否有里位的送货任务 + {//获取里位坐标 + if (tempZ == 2) + { + newZ = sendZ - 1; + } + else + { + newZ = sendZ + 1; + } + neighborzxy = string.Format("{0:D3}-{1:D3}-{2:D3}", newZ, zxy[4], zxy[5]);//获得外位坐标 + sqlstrzxy = string.Format("SELECT F_MonitorIndex FROM T_Monitor_Task WHERE ( F_DeviceCommandIndex =5) and (F_NumParam4 = {0}) AND (F_NumParam5 = {1}) AND (F_NumParam6 = {2}) and (F_DeviceIndex={3})", newZ, zxy[4], zxy[5], DeviceIdx); + sqlman = string.Format("SELECT FID FROM T_Manage_Task WHERE (FSTATUS = 0) AND(FENDDEVICE = {0}) AND (FENDCELL = '{1}') ", EndDevice, neighborzxy); + check = true; + if (check) + { + dvdv = dbo.ExceSQL(sqlstrzxy).Tables[0].DefaultView; + if (dvdv.Count > 0)// + { + + AheadDetectUnallow.Append(string.Format("存在相邻货位{0}的优先任务,该任务暂时不能执行! ", neighborzxy)); + + UpdateAheadDetectUnallow(AheadDetectUnallow, minMidx); + return false;//不能执行出库任务 + } + dvdv = dbo.ExceSQL(sqlman).Tables[0].DefaultView; + if (dvdv.Count > 0)// + { + AheadDetectUnallow.Append(string.Format("存在相邻货位{0}的优先任务,该任务暂时不能执行! ", neighborzxy)); + + UpdateAheadDetectUnallow(AheadDetectUnallow, minMidx); + return false;//不能执行出库任务 + } + } + } + + } + + } + #endregion + + #region lzm20250225 注释其他项目 //20101011 //#region 双叉堆垛机的取货任务在此判断是否关联双叉、验证双叉任务是否为双叉极限货位