You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1774 lines
73 KiB
1774 lines
73 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Data;
|
|
using DBFactory;
|
|
namespace Model
|
|
{
|
|
public static class CGeneralFunction
|
|
{
|
|
static StringBuilder sql = new StringBuilder();
|
|
static DBOperator dbo = CGetInfo.dbo;
|
|
static DBOperator dboM = CGetInfo.dboM;
|
|
static Model.MDevice devinfo;
|
|
/// <summary>
|
|
/// 20120616多叉关联任务是否能和monitorIndex同步运行;返回多叉关联任务的设备指令索引数组(多个任务号,包括自己),如果只返回自己(数组只有自己一个任务号)代表关联任务还没有拆分完毕,等待
|
|
/// </summary>
|
|
/// <param name="monitorIndex">设备指令索引</param>
|
|
/// <returns>多叉关联任务的设备指令索引数组,如果返回自己代表关联任务还没有拆分完毕,等待</returns>
|
|
public static int[] MutiForkIfSync(int monitorIndex, int devIndex, int devKind)
|
|
{//查找关联的调度任务(主任务或者辅助任务);输送机与堆垛机区别对待
|
|
//如果只能找到关联任务未被拆分,那么认为能同步运行20100323
|
|
int mankind = GetManageTaskKindIndexFromMonitor(monitorIndex);
|
|
int FID = GetManageTaskIndexfromMonitor(monitorIndex);
|
|
int devOrder = GetDeviceOrderFromMonitor(monitorIndex);
|
|
Dictionary<int, int[]> mutiTaskZxyForkNo = GetMutiForkTaskZxyForkNo(mankind,FID,devIndex,devOrder);
|
|
if (mutiTaskZxyForkNo == null) return null;
|
|
int[] monitortask;
|
|
List<int> mt = new List<int>();
|
|
if (GetMutiForkUnIntoStep(monitorIndex) == true)
|
|
{//此项只在提前检测时使用
|
|
monitortask = new int[1] { monitorIndex };
|
|
return monitortask;
|
|
}
|
|
int[] zxy,zxy1;
|
|
switch (devKind)
|
|
{
|
|
case 1:
|
|
//堆垛机的同排,同层,临列可以同步并且ST_CELL的FDoubleFork值匹配
|
|
|
|
zxy = mutiTaskZxyForkNo[monitorIndex];
|
|
foreach (int mtask1 in mutiTaskZxyForkNo.Keys)
|
|
{
|
|
zxy1 = mutiTaskZxyForkNo[mtask1];
|
|
if (monitorIndex != mtask1)
|
|
{
|
|
if ((zxy[0] == zxy1[0]) && (zxy[2] == zxy1[2]) && ((zxy[1] - zxy1[1]) == (zxy[3] - zxy1[3])))
|
|
{//同排、层,货叉序号差值==列差值,同步出叉
|
|
if (mt.Contains(monitorIndex) == false)
|
|
{
|
|
mt.Add(monitorIndex);
|
|
}
|
|
if (mt.Contains(mtask1) == false)
|
|
{
|
|
mt.Add(mtask1);
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if (mt.Count > 0)
|
|
{
|
|
monitortask = mt.ToArray();
|
|
return monitortask;
|
|
}
|
|
else
|
|
{
|
|
return null;
|
|
}
|
|
|
|
case 2:
|
|
//输送机同步
|
|
foreach (int mtask in mutiTaskZxyForkNo.Keys)
|
|
{
|
|
if (mt.Contains(mtask) == false)
|
|
{
|
|
mt.Add(mtask);
|
|
}
|
|
}
|
|
if (mt.Count >= 1)
|
|
{
|
|
monitortask = mt.ToArray();
|
|
return monitortask;
|
|
}
|
|
else
|
|
{
|
|
return null;
|
|
}
|
|
|
|
case 6:
|
|
if (EqualAGVGateDoubleFork(mankind, FID, devIndex, devOrder) == true)
|
|
{
|
|
return null;
|
|
}
|
|
else
|
|
{
|
|
return null;
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
return null;
|
|
}
|
|
|
|
}
|
|
/// <summary>
|
|
/// 获得双叉控制的堆垛机的送货任务(已经分配远货叉或者近货叉的任务)的值
|
|
/// </summary>
|
|
/// <param name="monitorIndex">设备指令索引</param>
|
|
/// <returns></returns>
|
|
public static string GetUseAwayFork(int monitorIndex)
|
|
{
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT F_UseAwayFork FROM T_Monitor_Task WHERE (F_MonitorIndex = ").Append(monitorIndex ).Append(")");
|
|
DataView dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
return dv[0][0].ToString();
|
|
}
|
|
else
|
|
{
|
|
return "-";
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取双叉控制的堆垛机的取货任务(尚未指定应该使用哪个货叉)是否使用远货叉(主货叉):0,近货叉;1远货叉
|
|
/// </summary>
|
|
/// <param name="z">排</param>
|
|
/// <param name="x">列</param>
|
|
/// <param name="y">层</param>
|
|
/// <param name="FWAREHOUSE">库房索引</param>
|
|
/// <param name="Mankind">任务类型</param>
|
|
/// <param name="ManFID">调度任务索引</param>
|
|
/// <param name="devIndex">设备索引</param>
|
|
/// <param name="devOrder">指令</param>
|
|
/// <returns></returns>
|
|
public static int GetUseAwayFork(int monitorIndex,int devIndex, int devOrder)
|
|
{
|
|
int z = GetZCoorFromMonitor(monitorIndex, devIndex, devOrder);
|
|
int x = GetXCoorFromMonitor(monitorIndex, devIndex, devOrder);
|
|
int y = GetYCoorFromMonitor(monitorIndex, devIndex, devOrder);
|
|
|
|
string FWAREHOUSE=GetWAREHOUSEFromSTCELL(devIndex);
|
|
int Mankind=GetManageTaskKindIndexFromMonitor(monitorIndex);
|
|
int ManFID=GetManageTaskIndexfromMonitor(monitorIndex);
|
|
|
|
DataView dv = new DataView(); ; int UseAwayFork = 1;
|
|
try
|
|
{
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT FDoubleFork FROM ST_CELL WHERE (FWAREHOUSE='" ).Append( FWAREHOUSE
|
|
).Append( "') and (F_Z = " ).Append( z ).Append( ") AND (F_X = " ).Append( x ).Append( ") AND (F_Y = " ).Append( y ).Append( ")");
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
UseAwayFork = Convert.ToInt32(dv[0][0]);
|
|
}
|
|
else
|
|
{
|
|
UseAwayFork = 0;
|
|
}
|
|
switch (UseAwayFork)
|
|
{
|
|
case 0://可用任何一个货叉:
|
|
int xcoor = GetDoubleForkX(Mankind, ManFID, devIndex, devOrder);
|
|
if (xcoor != -1)
|
|
{
|
|
//根据关联任务的货位判断使用近货叉(列坐标小)或者远货叉(列坐标大)
|
|
if (xcoor != x)
|
|
{
|
|
if (xcoor < x)
|
|
{
|
|
UseAwayFork = 1;
|
|
}
|
|
else
|
|
{
|
|
UseAwayFork = 0;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
//列坐标相同的,判断层坐标,近货叉(层坐标小)或者远货叉(层坐标大)
|
|
int ycoor = GetDoubleForkY(Mankind, ManFID, devIndex, devOrder);
|
|
if (ycoor != -1)
|
|
{
|
|
if (ycoor != y)
|
|
{
|
|
if (ycoor < y)
|
|
{
|
|
UseAwayFork = 1;
|
|
}
|
|
else
|
|
{
|
|
UseAwayFork = 0;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
//列和层都相同的,判断排坐标,近货叉(排坐标小)或者远货叉(排坐标大)
|
|
int zcoor = GetDoubleForkZ(Mankind, ManFID, devIndex, devOrder);
|
|
if (zcoor != -1)
|
|
{
|
|
if (zcoor != z)
|
|
{
|
|
if (zcoor < z)
|
|
{
|
|
UseAwayFork = 1;
|
|
}
|
|
else
|
|
{
|
|
UseAwayFork = 0;
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
UseAwayFork = 1;
|
|
}
|
|
break;
|
|
case 1://只能用近叉
|
|
UseAwayFork = 0;
|
|
break;
|
|
case 2://只能用远叉
|
|
UseAwayFork = 1;
|
|
break;
|
|
}
|
|
return UseAwayFork;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
finally
|
|
{
|
|
dv.Dispose(); ;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 返回距离原点位置的斜边平方
|
|
/// </summary>
|
|
/// <param name="monitorIndex"></param>
|
|
/// <param name="devinfo"></param>
|
|
/// <param name="devOrder"></param>
|
|
/// <returns></returns>
|
|
public static double GetMinZeroDistance(int monitorIndex,Model.MDevice devinfo, int devOrder)
|
|
{
|
|
int x = GetXCoorFromMonitor(monitorIndex, devinfo.DeviceIndex, devOrder);
|
|
int y = GetYCoorFromMonitor(monitorIndex, devinfo.DeviceIndex, devOrder);
|
|
int xzero=0,yzero=0;
|
|
if (devinfo.StackZeroColLayer != "")
|
|
{
|
|
char[] cc = new char[1] { ',' };
|
|
string[] xy = devinfo.StackZeroColLayer.Split(cc);
|
|
if (xy.GetLength(0) <= 1) return -1;
|
|
xzero = Convert.ToInt32(xy[0]);
|
|
yzero = Convert.ToInt32(xy[1]);
|
|
return Math.Pow(Convert.ToDouble( x - xzero), 2) + Math.Pow(Convert.ToDouble(y - yzero), 2);
|
|
}
|
|
else
|
|
{
|
|
return -1;
|
|
}
|
|
}
|
|
public static void GetMinZeroDistanceTask(int[] mtasks , Model.MDevice devinfo, int devOrder,out int mintask ,out double minDist)
|
|
{
|
|
minDist = 0; mintask = 0;
|
|
double temp = 0; minDist = 0;
|
|
foreach (int monitorIndex in mtasks)
|
|
{
|
|
|
|
int x = GetXCoorFromMonitor(monitorIndex, devinfo.DeviceIndex, devOrder);
|
|
int y = GetYCoorFromMonitor(monitorIndex, devinfo.DeviceIndex, devOrder);
|
|
int xzero = 0, yzero = 0;
|
|
if (devinfo.StackZeroColLayer != "")
|
|
{
|
|
char[] cc = new char[1] { ',' };
|
|
string[] xy = devinfo.StackZeroColLayer.Split(cc);
|
|
xzero = Convert.ToInt32(xy[0]);
|
|
yzero = Convert.ToInt32(xy[1]);
|
|
temp = Math.Pow(Convert.ToDouble(x - xzero), 2);// 20130704 +Math.Pow(Convert.ToDouble(y - yzero), 2)
|
|
}
|
|
if (temp <= minDist)
|
|
{
|
|
minDist = temp;
|
|
mintask = monitorIndex;
|
|
}
|
|
else
|
|
{
|
|
if (minDist == 0)
|
|
{
|
|
minDist = temp;
|
|
mintask = monitorIndex;
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public static int GetDoubleForkFromST_CELL(int z, int x, int y, string FWAREHOUSE)
|
|
{
|
|
DataView dv = new DataView();; int UseAwayFork = 1;
|
|
try
|
|
{
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT FDoubleFork FROM ST_CELL WHERE (FWAREHOUSE='" ).Append( FWAREHOUSE
|
|
).Append( "') and (F_Z = " ).Append( z ).Append( ") AND (F_X = " ).Append( x ).Append( ") AND (F_Y = " ).Append( y ).Append( ")");
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
UseAwayFork = Convert.ToInt32(dv[0][0]);
|
|
}
|
|
else
|
|
{
|
|
UseAwayFork = 0;
|
|
}
|
|
|
|
return UseAwayFork;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
finally
|
|
{
|
|
dv.Dispose();
|
|
}
|
|
}
|
|
|
|
|
|
public static string GetWAREHOUSEFromSTCELL(int stackIndex)
|
|
{
|
|
DataView dv=new DataView();
|
|
try
|
|
{
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT FWAREHOUSE FROM ST_CELL WHERE (FStack = " ).Append( stackIndex ).Append( ")");
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
return dv[0][0].ToString();
|
|
}
|
|
else
|
|
{
|
|
return "";
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
finally { dv.Dispose(); }
|
|
}
|
|
/// <summary>
|
|
/// 查找多叉关联任务的列坐标
|
|
/// </summary>
|
|
/// <param name="mankind">任务类型</param>
|
|
/// <param name="fid">调度任务索引</param>
|
|
/// <param name="devIdx">设备索引</param>
|
|
/// <param name="devOrder">设备指令</param>
|
|
/// <returns></returns>
|
|
public static int GetDoubleForkX(int mankind, int fid, int devIdx, int devOrder)
|
|
{
|
|
DataView dv = new DataView(); ;
|
|
string xc = "F_NumParam2";
|
|
if (GetDeviceKindIdx(devIdx) == 1)
|
|
{
|
|
if (devOrder == 4)
|
|
{
|
|
xc = "F_NumParam2";
|
|
}
|
|
else if (devOrder == 5)
|
|
{
|
|
xc = "F_NumParam5";
|
|
}
|
|
}
|
|
try
|
|
{
|
|
//查找被关联辅助设备指令索引的列坐标
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("select F_RELATIVECONTORLID from T_Manage_Task where (FID = " ).Append(
|
|
fid ).Append( ") AND (F_ManageTaskKindIndex = " ).Append( mankind ).Append( ")");
|
|
DataView dv0 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv0.Count == 0) return -1;
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT " ).Append( xc ).Append( " FROM T_Monitor_Task Where ( T_Monitor_Task.F_ManageTaskKindIndex = " ).Append( mankind
|
|
).Append( ") and (F_DeviceIndex=" ).Append( devIdx ).Append( " and F_DeviceCommandIndex=" ).Append( devOrder ).Append( ") AND (T_Monitor_Task.F_ManageTaskIndex=" ).Append( dv0[0]["F_RELATIVECONTORLID"] ).Append( ")");
|
|
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
return Convert.ToInt32(dv[0][xc]);
|
|
}
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("select T_Manage_Task.FID from T_Manage_Task where (T_Manage_Task.F_ManageTaskKindIndex = ").Append(mankind).Append(") AND (F_RELATIVECONTORLID = " ).Append(
|
|
fid ).Append( ")");
|
|
dv0 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv0.Count == 0) return -1;
|
|
//查找关联自己的主设备指令索引的列坐标
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT ").Append(xc).Append(" FROM T_Monitor_Task Where ( T_Monitor_Task.F_ManageTaskKindIndex = " ).Append( mankind ).Append( ") and (F_DeviceIndex=" ).Append( devIdx ).Append( " and F_DeviceCommandIndex=" ).Append( devOrder
|
|
).Append( ") and (T_Monitor_Task.F_ManageTaskIndex= " ).Append( dv0[0]["FID"] ).Append( ")");
|
|
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
return Convert.ToInt32(dv[0][xc]);
|
|
}
|
|
else
|
|
{
|
|
return -1;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
finally
|
|
{
|
|
dv.Dispose();
|
|
}
|
|
|
|
}
|
|
/// <summary>
|
|
/// 查找多叉关联任务的层坐标
|
|
/// </summary>
|
|
/// <param name="mankind">任务类型</param>
|
|
/// <param name="fid">调度任务索引</param>
|
|
/// <param name="devIdx">设备索引</param>
|
|
/// <param name="devOrder">设备指令</param>
|
|
/// <returns></returns>
|
|
public static int GetDoubleForkY(int mankind, int fid, int devIdx, int devOrder)
|
|
{
|
|
DataView dv = new DataView();
|
|
string yc = "F_NumParam3";
|
|
if (GetDeviceKindIdx(devIdx) == 1)
|
|
{
|
|
if (devOrder == 4)
|
|
{
|
|
yc = "F_NumParam3";
|
|
}
|
|
else if (devOrder == 5)
|
|
{
|
|
yc = "F_NumParam6";
|
|
}
|
|
}
|
|
try
|
|
{
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("select F_RELATIVECONTORLID from T_Manage_Task where FID = " ).Append(
|
|
fid ).Append( " and F_ManageTaskKindIndex=").Append(mankind );
|
|
DataView dv0 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv0.Count == 0) return -1;
|
|
//查找被关联辅助设备指令索引的层坐标
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT " ).Append( yc ).Append( " FROM T_Monitor_Task Where (T_Monitor_Task.F_ManageTaskIndex=" ).Append( dv0[0]["F_RELATIVECONTORLID"] ).Append( " " ).Append(
|
|
" ) and ( T_Monitor_Task.F_ManageTaskKindIndex = " ).Append( mankind ).Append( ") and (F_DeviceIndex=" ).Append( devIdx ).Append( " and F_DeviceCommandIndex=" ).Append( devOrder ).Append( ")");
|
|
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
return Convert.ToInt32(dv[0][yc]);
|
|
}
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("select FID from T_Manage_Task where F_RELATIVECONTORLID = " ).Append(
|
|
fid ).Append( " and F_ManageTaskKindIndex=" ).Append( mankind );
|
|
dv0 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv0.Count == 0) return -1;
|
|
|
|
//查找关联自己的主设备指令索引的层坐标
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT " ).Append( yc ).Append( " FROM T_Monitor_Task Where (T_Monitor_Task.F_ManageTaskIndex=" ).Append( dv0[0]["FID"] ).Append( " " ).Append(
|
|
") and ( T_Monitor_Task.F_ManageTaskKindIndex = " ).Append( mankind ).Append( ") and (F_DeviceIndex=" ).Append( devIdx ).Append( " and F_DeviceCommandIndex=" ).Append( devOrder ).Append( ")");
|
|
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
|
|
if (dv.Count > 0)
|
|
{
|
|
return Convert.ToInt32(dv[0][yc]);
|
|
}
|
|
else
|
|
{
|
|
return -1;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
finally
|
|
{
|
|
dv.Dispose();
|
|
}
|
|
|
|
}
|
|
/// <summary>
|
|
/// 查找多叉关联任务的排坐标
|
|
/// </summary>
|
|
/// <param name="mankind">任务类型</param>
|
|
/// <param name="fid">调度任务索引</param>
|
|
/// <param name="devIdx">设备索引</param>
|
|
/// <param name="devOrder">设备指令</param>
|
|
/// <returns></returns>
|
|
public static int GetDoubleForkZ(int mankind, int fid, int devIdx, int devOrder)
|
|
{
|
|
DataView dv = new DataView();
|
|
string zc = "F_NumParam1";
|
|
if (GetDeviceKindIdx(devIdx) == 1)
|
|
{
|
|
if (devOrder == 4)
|
|
{
|
|
zc = "F_NumParam1";
|
|
}
|
|
else if (devOrder == 5)
|
|
{
|
|
zc = "F_NumParam4";
|
|
}
|
|
}
|
|
try
|
|
{
|
|
//查找被关联辅助设备指令索引的排坐标
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT ").Append(zc).Append(" FROM T_Manage_Task,T_Monitor_Task Where (T_Manage_Task.F_RELATIVECONTORLID = T_Monitor_Task.F_ManageTaskIndex " ).Append(
|
|
" AND T_Manage_Task.F_ManageTaskKindIndex = T_Monitor_Task.F_ManageTASKKINDINDEX) and ( T_Monitor_Task.F_ManageTaskKindIndex = " ).Append( mankind ).Append( ") AND (FID = " ).Append(
|
|
fid ).Append( ") and (F_DeviceIndex=" ).Append( devIdx ).Append( " and F_DeviceCommandIndex=" ).Append( devOrder ).Append( ")");
|
|
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
return Convert.ToInt32(dv[0][zc]);
|
|
}
|
|
|
|
//查找关联自己的主设备指令索引的排坐标
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT ").Append(zc).Append(" FROM T_Manage_Task,T_Monitor_Task Where (T_Manage_Task.FID = T_Monitor_Task.F_ManageTaskIndex " ).Append(
|
|
" AND T_Manage_Task.F_ManageTaskKindIndex = T_Monitor_Task.F_ManageTASKKINDINDEX) and ( T_Monitor_Task.F_ManageTaskKindIndex = " ).Append( mankind ).Append( ") AND (F_RELATIVECONTORLID = " ).Append(
|
|
fid ).Append( ") and (F_DeviceIndex=" ).Append( devIdx ).Append( " and F_DeviceCommandIndex=" ).Append( devOrder ).Append( ")");
|
|
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
return Convert.ToInt32(dv[0][zc]);
|
|
}
|
|
else
|
|
{
|
|
return -1;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
finally
|
|
{
|
|
dv.Dispose();
|
|
}
|
|
|
|
}
|
|
|
|
public static Dictionary<int, int[]> GetMutiForkTaskZxyForkNo(int mankind, int fid, int devIdx, int devOrder)
|
|
{//20120616
|
|
Dictionary<int, int[]> rettask = new Dictionary<int, int[]>();
|
|
DataView dv = new DataView(); DataView dv1 = new DataView();
|
|
int RELATIVECONTORLID=-1;
|
|
string zc = "F_NumParam1"; string xc = "F_NumParam2"; string yc = "F_NumParam3";
|
|
StringBuilder devstr= new StringBuilder(" and F_DeviceIndex=").Append(devIdx);
|
|
if (GetDeviceKindIdx(devIdx) == 1)
|
|
{
|
|
if (devOrder == 4)
|
|
{
|
|
zc = "F_NumParam1";
|
|
xc = "F_NumParam2";
|
|
yc = "F_NumParam3";
|
|
}
|
|
else if (devOrder == 5)
|
|
{
|
|
zc = "F_NumParam4";
|
|
xc = "F_NumParam5";
|
|
yc = "F_NumParam6";
|
|
}
|
|
}
|
|
else if (GetDeviceKindIdx(devIdx) == 6)
|
|
{//1运行,2取货,3送货,4取送货,5允许AGV移载
|
|
if (devOrder == 2)
|
|
{
|
|
zc = "F_NumParam1";
|
|
xc = "F_NumParam2";
|
|
yc = "F_NumParam3";
|
|
}
|
|
else if (devOrder == 3)
|
|
{
|
|
zc = "F_NumParam4";
|
|
xc = "F_NumParam5";
|
|
yc = "F_NumParam6";
|
|
}
|
|
}
|
|
else if (GetDeviceKindIdx(devIdx) == 2)
|
|
{
|
|
devstr = new StringBuilder(" and F_DeviceIndex like '%").Append(devIdx.ToString().Substring(0,5)).Append("%'");
|
|
}
|
|
try
|
|
{
|
|
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("select F_RELATIVECONTORLID from T_Manage_Task where (FID = ").Append(
|
|
fid).Append(") AND (F_ManageTaskKindIndex = ").Append(mankind).Append(") and F_RELATIVECONTORLID>0");
|
|
DataView dv0 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv0.Count == 0) return null ;
|
|
RELATIVECONTORLID = Convert.ToInt32(dv0[0]["F_RELATIVECONTORLID"]);
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT F_MonitorIndex,").Append(zc).Append(",").Append(xc).Append(",").Append(yc)
|
|
.Append(",F_UseAwayFork,T_Manage_Task.F_ManageTaskKindIndex,fid FROM T_Monitor_Task,T_Manage_Task Where ( T_Monitor_Task.F_ManageTaskKindIndex = ").Append(mankind
|
|
).Append(")").Append(devstr.ToString()).Append(" and F_DeviceCommandIndex=")
|
|
.Append(devOrder).Append(" AND (F_RELATIVECONTORLID=").Append(RELATIVECONTORLID).Append(")")
|
|
.Append(" and T_Monitor_Task.F_ManageTaskIndex=FID");
|
|
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
|
|
for (int i = 0; i < dv.Count; i++)
|
|
{
|
|
//int rmankind = Convert.ToInt32(dv[i]["F_ManageTaskKindIndex"]);
|
|
//int rman = Convert.ToInt32(dv[i]["fid"]);
|
|
//sql.Remove(0, sql.Length);
|
|
//sql.Append("SELECT MIN(F_MonitorIndex) AS mmi FROM dbo.T_Monitor_Task WHERE (F_ManageTaskIndex = ").Append(rman).Append(") AND (F_ManageTASKKINDINDEX = ").Append(rmankind).Append(")");
|
|
//dv1 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
//if (dv1.Count > 0)
|
|
//{
|
|
// if ((dv1[0]["mmi"] != DBNull.Value) && (dv1[0]["mmi"].ToString() != dv[i]["F_MonitorIndex"].ToString()))
|
|
// {
|
|
// continue;
|
|
// }
|
|
//}
|
|
int[] zxy = new int[4];
|
|
zxy[0] = Convert.ToInt32(dv[i][zc]);
|
|
zxy[1] = Convert.ToInt32(dv[i][xc]);
|
|
zxy[2] = Convert.ToInt32(dv[i][yc]);
|
|
zxy[3] = Convert.ToInt32(dv[i]["F_UseAwayFork"]);
|
|
rettask.Add(Convert.ToInt32(dv[i]["F_MonitorIndex"]), zxy);
|
|
}
|
|
return rettask;
|
|
}
|
|
else
|
|
{
|
|
return null;
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
finally
|
|
{
|
|
dv.Dispose();
|
|
}
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查找多叉关联任务的ST_CELL表的使用哪个货叉属性是否相同
|
|
/// </summary>
|
|
/// <param name="mankind">任务类型</param>
|
|
/// <param name="fid">调度任务索引</param>
|
|
/// <param name="devIdx">设备索引</param>
|
|
/// <param name="devOrder">设备指令</param>
|
|
/// <returns></returns>
|
|
public static bool EqualMonitorDoubleFork(int mankind, int fid, int devIdx, int devOrder)
|
|
{
|
|
DataView dv= new DataView(); char DoubleFork = '0', DoubleFork1 = '0';
|
|
string xc = "F_NumParam2";string yc = "F_NumParam3";string zc = "F_NumParam1";
|
|
if (GetDeviceKindIdx(devIdx) == 1)
|
|
{
|
|
if ((devOrder == 4)||(devOrder == 2))
|
|
{
|
|
xc = "F_NumParam2";
|
|
yc = "F_NumParam3";
|
|
zc = "F_NumParam1";
|
|
}
|
|
else if ((devOrder == 5)||(devOrder == 3))
|
|
{
|
|
xc = "F_NumParam5";
|
|
yc = "F_NumParam6";
|
|
zc = "F_NumParam4";
|
|
}
|
|
}
|
|
|
|
|
|
try
|
|
{
|
|
|
|
int z = 0, x = 0, y = 0, z1 = 0, x1 = 0, y1 = 0;
|
|
//查找被关联辅助设备指令索引的列坐标
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT " ).Append( zc ).Append( "," ).Append( xc ).Append( "," ).Append( yc ).Append( ",F_UseAwayFork FROM T_Manage_Task,T_Monitor_Task Where (T_Manage_Task.F_RELATIVECONTORLID = T_Monitor_Task.F_ManageTaskIndex " ).Append(
|
|
" AND T_Manage_Task.F_ManageTaskKindIndex = T_Monitor_Task.F_ManageTASKKINDINDEX) and ( T_Monitor_Task.F_ManageTaskKindIndex = " ).Append( mankind ).Append( ") AND (FID = " ).Append(
|
|
fid ).Append( ") and (F_DeviceIndex=" ).Append( devIdx ).Append( " and F_DeviceCommandIndex=" ).Append( devOrder ).Append( ")");
|
|
;
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
z = Convert.ToInt32(dv[0][zc]);
|
|
x = Convert.ToInt32(dv[0][xc]);
|
|
y = Convert.ToInt32(dv[0][yc]);
|
|
DoubleFork = Convert.ToChar(dv[0]["F_UseAwayFork"]);
|
|
}
|
|
else
|
|
{
|
|
//查找关联自己的主设备指令索引的列坐标
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT " ).Append( zc ).Append( "," ).Append( xc ).Append( "," ).Append( yc ).Append( ",F_UseAwayFork FROM T_Manage_Task,T_Monitor_Task Where (T_Manage_Task.FID = T_Monitor_Task.F_ManageTaskIndex " ).Append(
|
|
" AND T_Manage_Task.F_ManageTaskKindIndex = T_Monitor_Task.F_ManageTASKKINDINDEX) and ( T_Monitor_Task.F_ManageTaskKindIndex = " ).Append( mankind ).Append( ") AND (F_RELATIVECONTORLID = " ).Append(
|
|
fid ).Append( ") and (F_DeviceIndex=" ).Append( devIdx ).Append( " and F_DeviceCommandIndex=" ).Append( devOrder ).Append( ")");
|
|
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
z = Convert.ToInt32(dv[0][zc]);
|
|
x = Convert.ToInt32(dv[0][xc]);
|
|
y = Convert.ToInt32(dv[0][yc]);
|
|
DoubleFork = Convert.ToChar(dv[0]["F_UseAwayFork"]);
|
|
}
|
|
|
|
}
|
|
if ((z == 0) && (x == 0) && (y == 0))
|
|
{
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT " ).Append( zc ).Append( "," ).Append( xc ).Append( "," ).Append( yc ).Append( ",F_UseAwayFork FROM T_Monitor_Task Where ( F_ManageTASKKINDINDEX = " ).Append( mankind ).Append( ") AND (F_ManageTaskIndex = " ).Append(
|
|
fid ).Append( ") and (F_DeviceIndex=" ).Append( devIdx ).Append( " and F_DeviceCommandIndex=" ).Append( devOrder ).Append( ")");
|
|
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
z1 = Convert.ToInt32(dv[0][zc]);
|
|
x1 = Convert.ToInt32(dv[0][xc]);
|
|
y1 = Convert.ToInt32(dv[0][yc]);
|
|
DoubleFork1 = Convert.ToChar(dv[0]["F_UseAwayFork"]);
|
|
if (((x1 > x) && (DoubleFork1 > DoubleFork)) || ((x > x1) && (DoubleFork > DoubleFork1)))
|
|
{
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
finally
|
|
{
|
|
dv.Dispose();
|
|
}
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查找多叉关联任务的T_Base_AGV_Gate表的货叉属性是否匹配
|
|
/// </summary>
|
|
/// <param name="mankind">任务类型</param>
|
|
/// <param name="fid">调度任务索引</param>
|
|
/// <param name="devIdx">设备索引</param>
|
|
/// <param name="devOrder">设备指令</param>
|
|
/// <returns></returns>
|
|
public static bool EqualAGVGateDoubleFork(int mankind, int fid, int devIdx, int devOrder)
|
|
{//20110110 1运行,2取货,3送货,4取送货,5允许AGV移载
|
|
DataView dv = new DataView();
|
|
string xc = "F_NumParam2";
|
|
if (GetDeviceKindIdx(devIdx) == 6)
|
|
{
|
|
if (devOrder == 1)
|
|
{
|
|
xc = "F_NumParam5";
|
|
}
|
|
else if ((devOrder == 2) || (devOrder == 5))
|
|
{
|
|
xc = "F_NumParam2";
|
|
}
|
|
else if (devOrder == 3)
|
|
{
|
|
xc = "F_NumParam5";
|
|
}
|
|
}
|
|
|
|
try
|
|
{
|
|
|
|
int x = 0, x1 = 0;
|
|
int channelleft = 0, channelleft1 = 0, xd = 0, xd1 = 0;
|
|
StringBuilder sql = new StringBuilder();
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("select F_RELATIVECONTORLID from T_Manage_Task where (FID = ").Append(
|
|
fid).Append(") AND (F_ManageTaskKindIndex = ").Append(mankind).Append(") and F_RELATIVECONTORLID>0");
|
|
DataView dv0 = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv0.Count == 0) return false;
|
|
int RELATIVECONTORLID = Convert.ToInt32(dv0[0]["F_RELATIVECONTORLID"]);
|
|
//查找被关联辅助设备指令索引的列坐标
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT ").Append( xc ).Append(" FROM T_Manage_Task,T_Monitor_Task Where (T_Manage_Task.FID = T_Monitor_Task.F_ManageTaskIndex ").Append(
|
|
" AND T_Manage_Task.F_ManageTaskKindIndex = T_Monitor_Task.F_ManageTASKKINDINDEX) and ( T_Monitor_Task.F_ManageTaskKindIndex = " ).Append( mankind ).Append( ") AND (FID = " ).Append(
|
|
fid).Append(") and (F_DeviceIndex=").Append(devIdx).Append(" and F_DeviceCommandIndex=").Append(devOrder).Append(") and F_RELATIVECONTORLID=").Append(RELATIVECONTORLID);
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
|
|
xd = Convert.ToInt32(dv[0][xc]);
|
|
dv = dbo.ExceSQL("SELECT F_Sequence FROM T_Base_AGV_Gate WHERE (F_AGVGateDeviceIndex = " + xd + ")").Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
x = Convert.ToInt32(dv[0]["F_Sequence"]);
|
|
}
|
|
else
|
|
{
|
|
x = 0;
|
|
}
|
|
}
|
|
if (x == 0)
|
|
{
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
sql.Append("SELECT ").Append( xc ).Append( " FROM T_Monitor_Task Where ( F_ManageTASKKINDINDEX = " ).Append( mankind ).Append( ") AND (F_ManageTaskIndex = ").Append(
|
|
fid ).Append( ") and (F_DeviceIndex=" ).Append( devIdx ).Append( " and F_DeviceCommandIndex=" ).Append( devOrder ).Append( ")");
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
xd1 = Convert.ToInt32(dv[0][xc]);
|
|
dv = dbo.ExceSQL("SELECT F_Sequence FROM T_Base_AGV_Gate WHERE (F_AGVGateDeviceIndex = " + xd1 + ")").Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
x1 = Convert.ToInt32(dv[0]["F_Sequence"]);
|
|
}
|
|
else
|
|
{
|
|
x1 = 0;
|
|
}
|
|
int DoubleFork = 0, DoubleFork1 = 0;
|
|
dv = dbo.ExceSQL("SELECT F_UseAwayFork,F_IfChannelLeft FROM T_Base_AGV_Gate WHERE F_AGVGateDeviceIndex =" + xd).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
DoubleFork = Convert.ToInt32(dv[0]["F_UseAwayFork"]);
|
|
channelleft = Convert.ToInt32(dv[0]["F_IfChannelLeft"]);
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
dv = dbo.ExceSQL("SELECT F_UseAwayFork,F_IfChannelLeft FROM T_Base_AGV_Gate WHERE F_AGVGateDeviceIndex =" + xd1).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
DoubleFork1 = Convert.ToInt32(dv[0]["F_UseAwayFork"]);
|
|
channelleft1 = Convert.ToInt32(dv[0]["F_IfChannelLeft"]);
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
if ((((x1 > x) && (DoubleFork1 > DoubleFork)) || ((x > x1) && (DoubleFork > DoubleFork1))) && (channelleft == channelleft1))
|
|
{
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
finally
|
|
{
|
|
dv.Dispose();
|
|
}
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 在设备指令队列表获取Z 排坐标
|
|
/// </summary>
|
|
/// <param name="monitorIndex">设备指令索引</param>
|
|
/// <returns></returns>
|
|
public static int GetZCoorFromMonitor(int monitorIndex, int devIdx, int devOrder)
|
|
{
|
|
DataView dv = new DataView();
|
|
string zc = "F_NumParam1";
|
|
if (GetDeviceKindIdx(devIdx) == 1)
|
|
{
|
|
if (devOrder == 4)
|
|
{
|
|
zc = "F_NumParam1";
|
|
}
|
|
else if (devOrder == 5)
|
|
{
|
|
zc = "F_NumParam4";
|
|
}
|
|
}
|
|
try
|
|
{
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT ").Append(zc).Append(" FROM T_Monitor_Task WHERE (F_MonitorIndex = " ).Append( monitorIndex ).Append( ")");
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
return Convert.ToInt32(dv[0][0]);
|
|
}
|
|
else
|
|
{
|
|
return -1;
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
finally
|
|
{
|
|
dv.Dispose();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 在设备指令队列表获取X 列坐标
|
|
/// </summary>
|
|
/// <param name="monitorIndex">设备指令索引</param>
|
|
/// <returns></returns>
|
|
public static int GetXCoorFromMonitor(int monitorIndex, int devIdx, int devOrder)
|
|
{
|
|
DataView dv = new DataView();
|
|
string xc = "F_NumParam2";
|
|
if (GetDeviceKindIdx(devIdx) == 1)
|
|
{
|
|
if (devOrder == 4)
|
|
{
|
|
xc = "F_NumParam2";
|
|
}
|
|
else if (devOrder == 5)
|
|
{
|
|
xc = "F_NumParam5";
|
|
}
|
|
}
|
|
try
|
|
{
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT ").Append(xc).Append(" FROM T_Monitor_Task WHERE (F_MonitorIndex = " ).Append( monitorIndex ).Append( ")");
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
return Convert.ToInt32(dv[0][0]);
|
|
}
|
|
else
|
|
{
|
|
return -1;
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
finally
|
|
{
|
|
dv.Dispose();
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 在设备指令队列表获取Y 层坐标
|
|
/// </summary>
|
|
/// <param name="monitorIndex">设备指令索引</param>
|
|
/// <returns></returns>
|
|
public static int GetYCoorFromMonitor(int monitorIndex, int devIdx, int devOrder)
|
|
{
|
|
DataView dv = new DataView();
|
|
string yc = "F_NumParam3";
|
|
if (GetDeviceKindIdx(devIdx) == 1)
|
|
{
|
|
if (devOrder == 4)
|
|
{
|
|
yc = "F_NumParam3";
|
|
}
|
|
else if (devOrder == 5)
|
|
{
|
|
yc = "F_NumParam6";
|
|
}
|
|
}
|
|
try
|
|
{
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT ").Append(yc).Append(" FROM T_Monitor_Task WHERE (F_MonitorIndex = " ).Append( monitorIndex ).Append( ")");
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
return Convert.ToInt32(dv[0][0]);
|
|
}
|
|
else
|
|
{
|
|
return -1;
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
finally
|
|
{
|
|
dv.Dispose();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 返回多叉关联设备指令信息(返回NULL表示没有;否则返回包含自己的所有货叉的设备指令信息):【0】设备指令索引【1】提前检测【2】设备索引【3】路径
|
|
/// </summary>
|
|
/// <param name="monitorIndex">设备指令索引</param>
|
|
/// <param name="devIdx">设备索引</param>
|
|
/// <returns></returns>
|
|
public static Dictionary<int, string[]> GetDoubleForkMonitorInfo(int monitorIndex, int devIdx)
|
|
{
|
|
DataView dv = new DataView();
|
|
|
|
Dictionary<int, string[]> rtd = new Dictionary<int, string[]>();;
|
|
string[] rr = null;
|
|
try
|
|
{
|
|
int mankind = GetManageTaskKindIndexFromMonitor(monitorIndex);
|
|
int fid = GetManageTaskIndexfromMonitor(monitorIndex);
|
|
int devOrder = GetDeviceOrderFromMonitor(monitorIndex);
|
|
int relFID = GetRelativeControlID(mankind, fid);
|
|
if (relFID == -1) return null;
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT F_MonitorIndex,F_AheadDetect,F_DeviceIndex,F_RouteID FROM T_Manage_Task,T_Monitor_Task Where (T_Manage_Task.FID = T_Monitor_Task.F_ManageTaskIndex " ).Append(
|
|
" AND T_Manage_Task.F_ManageTaskKindIndex = T_Monitor_Task.F_ManageTASKKINDINDEX) and ( T_Monitor_Task.F_ManageTaskKindIndex = " ).Append( mankind )
|
|
.Append( ") and (F_DeviceIndex=").Append(devIdx).Append(" and F_DeviceCommandIndex=").Append(devOrder).Append(") and F_RELATIVECONTORLID=").Append(relFID ).Append(" and F_MonitorIndex<>").Append(monitorIndex);
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
rr = new string[4];
|
|
if (dv.Count == 0) return null;
|
|
for(int i=0;i<dv.Count;i++)
|
|
{
|
|
rr[0] = dv[0]["F_MonitorIndex"].ToString();
|
|
rr[1] = dv[0]["F_AheadDetect"].ToString();
|
|
rr[2] = dv[0]["F_DeviceIndex"].ToString();
|
|
rr[3] = dv[0]["F_RouteID"].ToString();
|
|
rtd.Add(Convert.ToInt32(dv[i]["F_MonitorIndex"]), rr);
|
|
}
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT F_MonitorIndex,F_AheadDetect,F_DeviceIndex,F_RouteID FROM T_Manage_Task,T_Monitor_Task Where (T_Manage_Task.FID = T_Monitor_Task.F_ManageTaskIndex ").Append(
|
|
" AND T_Manage_Task.F_ManageTaskKindIndex = T_Monitor_Task.F_ManageTASKKINDINDEX) and ( T_Monitor_Task.F_ManageTaskKindIndex = ").Append(mankind)
|
|
.Append(") and (F_DeviceIndex=").Append(devIdx).Append(" and F_DeviceCommandIndex=").Append(devOrder).Append(") and F_MonitorIndex=").Append(monitorIndex);
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
rr[0] = dv[0]["F_MonitorIndex"].ToString();
|
|
rr[1] = dv[0]["F_AheadDetect"].ToString();
|
|
rr[2] = dv[0]["F_DeviceIndex"].ToString();
|
|
rr[3] = dv[0]["F_RouteID"].ToString();
|
|
rtd.Add(Convert.ToInt32(dv[0]["F_MonitorIndex"]), rr);
|
|
}
|
|
return rtd;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
finally
|
|
{
|
|
dv.Dispose();
|
|
rr = null;
|
|
rtd = null;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 返回未拆分的多叉关联设备指令,true 代表有未拆分的多叉关联设备指令
|
|
/// </summary>
|
|
/// <param name="monitorIndex">设备指令索引</param>
|
|
/// <returns></returns>
|
|
public static bool GetMutiForkUnIntoStep(int monitorIndex)
|
|
{
|
|
DataView dv = new DataView();
|
|
try
|
|
{
|
|
int mankind = GetManageTaskKindIndexFromMonitor(monitorIndex);
|
|
int fid = GetManageTaskIndexfromMonitor(monitorIndex);
|
|
//查找被关联辅助设备指令索引的列坐标
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT F_RELATIVECONTORLID FROM T_Manage_Task Where (T_Manage_Task.F_RELATIVECONTORLID <>-1 ) and ( F_ManageTaskKindIndex = " ).Append( mankind ).Append( ") AND (FID = " ).Append(
|
|
fid ).Append( ")");
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT FID FROM T_Manage_Task Where ( F_ManageTaskKindIndex = ").Append(mankind).Append(") AND (F_RELATIVECONTORLID = ").Append(
|
|
dv[0][0] ).Append( " and FIntoStepOK<>'1')");
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
finally
|
|
{
|
|
dv.Dispose();
|
|
}
|
|
}
|
|
|
|
public static int GetManageTaskIndexfromMonitor(int monitorIdx)
|
|
{
|
|
//20100108
|
|
DataView dv = new DataView();
|
|
try
|
|
{
|
|
//20100108
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT F_ManageTaskIndex FROM T_Monitor_Task WHERE (F_MonitorIndex = " ).Append( monitorIdx ).Append( ")");
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
return Convert.ToInt32(dv[0]["F_ManageTaskIndex"]);
|
|
}
|
|
else
|
|
{
|
|
return -1;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{//20100108
|
|
throw ex;
|
|
}
|
|
finally
|
|
{//20100108
|
|
dv.Dispose();
|
|
}
|
|
}
|
|
public static int GetManageTaskKindIndexFromMonitor(int monitorIdx)
|
|
{//20100108
|
|
DataView dv = new DataView();
|
|
try
|
|
{
|
|
//20100108
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT F_ManageTaskKindIndex FROM T_Monitor_Task WHERE (F_MonitorIndex = " ).Append( monitorIdx ).Append( ")");
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
return Convert.ToInt32(dv[0]["F_ManageTaskKindIndex"]);
|
|
}
|
|
else
|
|
{
|
|
return -1;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{//20100108
|
|
throw ex;
|
|
}
|
|
finally
|
|
{//20100108
|
|
dv.Dispose();
|
|
|
|
}
|
|
|
|
|
|
}
|
|
public static int GetRelativeControlID(int mankind, int fid)
|
|
{
|
|
object ob = dbo.GetSingle(string.Format("SELECT F_RELATIVECONTORLID FROM T_Manage_Task WHERE (F_ManageTaskKindIndex = {0}) AND (FID = {1})", mankind, fid));
|
|
if (ob != null)
|
|
{
|
|
return Convert.ToInt32(ob);
|
|
}
|
|
else
|
|
{
|
|
return -1;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 在调度队列中找到设备命令
|
|
/// </summary>
|
|
/// <param name="MonitorIndex">调度所引</param>
|
|
/// <returns></returns>
|
|
public static int GetDeviceOrderFromMonitor(int MonitorIndex)
|
|
{
|
|
//20100108
|
|
DataView dv = new DataView();
|
|
try
|
|
{
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("select F_DeviceCommandIndex from T_Monitor_Task where (F_DeviceCommandIndex IS NOT NULL) and F_MonitorIndex=" ).Append( MonitorIndex);
|
|
//20100108
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
return Convert.ToInt32(dv[0]["F_DeviceCommandIndex"]);
|
|
}
|
|
else
|
|
{
|
|
return -1;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
finally
|
|
{
|
|
dv.Dispose();
|
|
}
|
|
}
|
|
|
|
public static int GetDeviceKindIdx(int devIdx)
|
|
{
|
|
try
|
|
{
|
|
devinfo = Model.CGetInfo.GetDeviceInfo(devIdx);
|
|
return devinfo.DeviceKind;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
}
|
|
|
|
public static int GetDeviceIndexFromMonitor(int MonitorIndex)
|
|
{
|
|
//20100108
|
|
DataView dv = new DataView();
|
|
try
|
|
{
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("select F_DeviceIndex from T_Monitor_Task where (F_DeviceIndex IS NOT NULL) and F_MonitorIndex=" ).Append( MonitorIndex);
|
|
//20100108
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
return Convert.ToInt32(dv[0]["F_DeviceIndex"]);
|
|
}
|
|
else
|
|
{
|
|
return -1;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
finally
|
|
{
|
|
dv.Dispose();
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 20110608获取调度设备指令开始时间
|
|
/// </summary>
|
|
/// <param name="monitorIndex"></param>
|
|
/// <returns></returns>
|
|
public static string GetMonitorTaskBeginTime(int monitorIndex)
|
|
{
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT F_StartTime FROM T_Monitor_Task WHERE F_MonitorIndex = ").Append(monitorIndex);
|
|
object ob=dbo.GetSingle(sql.ToString());
|
|
if (ob != null)
|
|
{
|
|
return ob.ToString();
|
|
}
|
|
else
|
|
{
|
|
return "-";
|
|
}
|
|
}
|
|
|
|
public static void ActionComplete(int DeviceIdx, int TaskIdx, int ClearZero)
|
|
{
|
|
int devKind = GetDeviceKindIdx(DeviceIdx);
|
|
int order = GetDeviceOrderFromMonitor(TaskIdx);
|
|
int fid = GetManageTaskIndexfromMonitor(TaskIdx);
|
|
int mti = GetManageTaskKindIndexFromMonitor(TaskIdx);
|
|
string cap;
|
|
int errrcode = GetExceptionNOFromManageTask(fid, mti);
|
|
DataView dv = new DataView();
|
|
//dbo.TransBegin();
|
|
try
|
|
{
|
|
//20100127
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("select count(F_MonitorIndex) as counts from T_Monitor_Task " ).Append(
|
|
" where F_ManageTaskIndex =" ).Append( fid ).Append( " and F_ManageTaskKindIndex= " ).Append( mti);
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
if ((Convert.ToInt32(dv[0]["counts"]) == 1) )
|
|
{
|
|
//固定路径模式
|
|
//调度任务的fid的最后一个监控分解任务完成
|
|
|
|
if (mti == 1)
|
|
{
|
|
cap = "调度任务";
|
|
//完成FSTATUS=999;970堆垛机送货重故障异常完成;980堆垛机取空故障异常完成;990条码扫描异常完成;调度撤销删除调度任务900
|
|
if (errrcode > 900)//异常完成
|
|
{
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("update IO_Control set Control_STATUS=" ).Append( errrcode ).Append( " where Control_ID=" ).Append( fid);
|
|
dboM.ExceSQL(sql.ToString());
|
|
}
|
|
else
|
|
{
|
|
if (ClearZero == Model.CGeneralFunction.TASKDELETE)//调度撤销删除调度任务900
|
|
{
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("update IO_Control set Control_STATUS=" ).Append( Model.CGeneralFunction.TASKDELETE ).Append( " where Control_ID=" ).Append( fid);
|
|
dboM.ExceSQL(sql.ToString());
|
|
}
|
|
else//完成FSTATUS=999
|
|
{
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("update IO_Control set Control_STATUS=" ).Append( Model.CGeneralFunction.TASKFINISH ).Append( " where Control_ID=" ).Append( fid);
|
|
dboM.ExceSQL(sql.ToString());
|
|
}
|
|
}
|
|
}
|
|
else if (mti == 4)
|
|
{
|
|
cap = "手工任务";
|
|
}
|
|
else
|
|
{
|
|
cap = "临时任务";
|
|
}
|
|
//回写管理表
|
|
if (ClearZero == Model.CGeneralFunction.TASKDELETE)//调度撤销删除调度任务900
|
|
{
|
|
ReturnManageInfo(fid, mti, cap, false);
|
|
}
|
|
else
|
|
{
|
|
ReturnManageInfo(fid, mti, cap, true);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
//被这个任务号锁定的设备全部解锁
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("update T_Base_Device set F_LockedState=0 where F_LockedState=" ).Append( TaskIdx);
|
|
dbo.ExceSQL(sql.ToString());
|
|
|
|
|
|
if (ClearZero == 1)
|
|
{
|
|
|
|
if (mti == 1)
|
|
{
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("UPDATE IO_CONTROL SET ERROR_TEXT ='' WHERE Control_ID=" ).Append( fid ).Append( " and Control_STATUS<900");
|
|
dboM.ExceSQL(sql.ToString());
|
|
}
|
|
}
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("delete from T_Monitor_Task where F_MonitorIndex=" ).Append( TaskIdx);
|
|
dbo.ExceSQL(sql.ToString());
|
|
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
finally
|
|
{//20100127
|
|
dv.Dispose();
|
|
}
|
|
}
|
|
|
|
public static int GetExceptionNOFromManageTask(int FID, int ManTaskKind)
|
|
{
|
|
//20100127
|
|
DataTable dt = new DataTable();
|
|
try
|
|
{
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT FID, F_ManageTaskKindIndex, FExceptionNO FROM T_Manage_Task WHERE (FID = " + FID + ") AND (F_ManageTaskKindIndex = " + ManTaskKind + ") ");
|
|
//20100127
|
|
dt = dbo.ExceSQL(sql.ToString()).Tables[0];
|
|
if (dt.Rows.Count > 0)
|
|
{
|
|
if (dt.Rows[0]["FExceptionNO"] == DBNull.Value)
|
|
{
|
|
return -1;
|
|
}
|
|
else
|
|
{
|
|
|
|
return Convert.ToInt32(dt.Rows[0]["FExceptionNO"]);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
return -1;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{//20100127
|
|
throw ex;
|
|
}
|
|
finally
|
|
{//20100127
|
|
dt.Dispose();
|
|
}
|
|
|
|
}
|
|
|
|
static void ReturnManageInfo(int fid, int mti, string cap, bool IFOK)
|
|
{
|
|
//20100127
|
|
DataView dv = new DataView();
|
|
try
|
|
{
|
|
//200906240111增加货位记录:入库1-结束位置有货;出库2-起始位置无货;倒库3-起始位置无货,结束位置有货
|
|
//20100127
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("SELECT FID, F_ManageTaskKindIndex,FCONTROLTASKTYPE, FSTARTDEVICE,FSTARTCELL, FENDDEVICE,FENDCELL FROM T_Manage_Task where F_ManageTaskKindIndex=" ).Append( mti ).Append( " and FID=" ).Append( fid );
|
|
dv = dbo.ExceSQL(sql.ToString()).Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
switch (dv[0]["FCONTROLTASKTYPE"].ToString())
|
|
{
|
|
case "1":
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("UPDATE ST_CELL SET FCELLSTATUS = 1 WHERE (FLaneWay=" ).Append( dv[0]["FENDDEVICE"] ).Append( " and FCELLCODE = '" ).Append( dv[0]["FENDCELL"] ).Append( "')");
|
|
dbo.ExceSQL(sql.ToString());
|
|
break;
|
|
case "2":
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("UPDATE ST_CELL SET FCELLSTATUS =0 WHERE (FLaneWay=" ).Append( dv[0]["FSTARTDEVICE"] ).Append( " and FCELLCODE = '" ).Append( dv[0]["FSTARTCELL"] ).Append( "')");
|
|
dbo.ExceSQL(sql.ToString());
|
|
break;
|
|
case "3":
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("UPDATE ST_CELL SET FCELLSTATUS = 1 WHERE (FLaneWay=" ).Append( dv[0]["FENDDEVICE"] ).Append( " and FCELLCODE = '" ).Append( dv[0]["FENDCELL"] ).Append( "')");
|
|
dbo.ExceSQL(sql.ToString());
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("UPDATE ST_CELL SET FCELLSTATUS =0 WHERE (FLaneWay=" ).Append( dv[0]["FSTARTDEVICE"] ).Append( " and FCELLCODE = '" ).Append( dv[0]["FSTARTCELL"] ).Append( "')");
|
|
dbo.ExceSQL(sql.ToString());
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
}
|
|
////////////////////
|
|
sql.Remove(0, sql.Length);
|
|
sql.Append("delete from T_Manage_Task where FID=" ).Append( fid ).Append( " and F_ManageTaskKindIndex= " ).Append( mti);
|
|
dbo.ExceSQL(sql.ToString());
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{//20100127
|
|
throw ex;
|
|
}
|
|
finally
|
|
{//20100127
|
|
dv.Dispose();
|
|
}
|
|
|
|
}
|
|
public const string DBSend = "DB1";
|
|
public const string DBGet = "DB2";
|
|
|
|
/// <summary>
|
|
/// 20110216根据ReadSubscription标识找到此订阅的开始设备
|
|
/// </summary>
|
|
/// <param name="sb">ReadSubscription标识</param>
|
|
/// <returns></returns>
|
|
public static Model.MDevice GetDeviceReadSubscriptionDB2Data(StringBuilder sb)
|
|
{
|
|
DataView dv = dbo.ExceSQL("SELECT F_DeviceIndex FROM T_Base_Device WHERE (F_DeviceIndex=" + sb.ToString() + ")").Tables[0].DefaultView;
|
|
if (dv.Count > 0)
|
|
{
|
|
return Model.CGetInfo.GetDeviceInfo(Convert.ToInt32(dv[0]["F_DeviceIndex"]));
|
|
}
|
|
else
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
|
|
#region 与管理任务交互的调度任务状态
|
|
|
|
/// <summary>
|
|
/// 任务等待,默认0
|
|
/// </summary>
|
|
public static readonly int TASKWAIT = CGetInfo.GetIOControlStatus("TASKWAIT").StatusID;
|
|
/// <summary>
|
|
/// 任务开始运行,默认10
|
|
/// </summary>
|
|
public static readonly int TASKRUN = CGetInfo.GetIOControlStatus("TASKRUN").StatusID;
|
|
/// <summary>
|
|
/// 调度申请改道,默认30
|
|
/// </summary>
|
|
public static readonly int TASKALTERROUTEAPPLY = CGetInfo.GetIOControlStatus("TASKALTERROUTEAPPLY").StatusID;
|
|
/// <summary>
|
|
/// 管理答复改道申请,默认40
|
|
/// </summary>
|
|
public static readonly int TASKALTERROUTEREPLY = CGetInfo.GetIOControlStatus("TASKALTERROUTEREPLY").StatusID;
|
|
/// <summary>
|
|
/// 管理任务被调度删除,默认900
|
|
/// </summary>
|
|
public static readonly int TASKDELETE = CGetInfo.GetIOControlStatus("TASKDELETE").StatusID;
|
|
/// <summary>
|
|
/// 指令重发,默认920
|
|
/// </summary>
|
|
public static readonly int TASKRESTORE = CGetInfo.GetIOControlStatus("TASKRESTORE").StatusID;
|
|
/// <summary>
|
|
/// 人工暂停出库,默认940
|
|
/// </summary>
|
|
public static readonly int TASKSTOPOUTPUT = CGetInfo.GetIOControlStatus("TASKSTOPOUTPUT").StatusID;
|
|
|
|
/// <summary>
|
|
/// 任务类型错,送到拆盘机的不是空托盘组,默认950
|
|
/// </summary>
|
|
public static readonly int TASKTYPEERROR = CGetInfo.GetIOControlStatus("TASKTYPEERROR").StatusID;
|
|
/// <summary>
|
|
/// 任务被取消,搬运到异常出库站台,默认960
|
|
/// </summary>
|
|
public static readonly int TASKCANCEL = CGetInfo.GetIOControlStatus("TASKCANCEL").StatusID;
|
|
/// <summary>
|
|
/// 堆垛机的送货重需要改路径处理,默认970
|
|
/// </summary>
|
|
public static readonly int TASKREPEATINPUT = CGetInfo.GetIOControlStatus("TASKREPEATINPUT").StatusID;
|
|
/// <summary>
|
|
/// 堆垛机的取空处理,调度取消执行管理任务,默认980
|
|
/// </summary>
|
|
public static readonly int TASKEMPTYOUTPUT = CGetInfo.GetIOControlStatus("TASKEMPTYOUTPUT").StatusID;
|
|
/// <summary>
|
|
/// 任务异常完成,默认990
|
|
/// </summary>
|
|
public static readonly int TASKABEND = CGetInfo.GetIOControlStatus("TASKABEND").StatusID;
|
|
/// <summary>
|
|
/// 任务搬运完成,默认999
|
|
/// </summary>
|
|
public static readonly int TASKFINISH = CGetInfo.GetIOControlStatus("TASKFINISH").StatusID;
|
|
/// <summary>
|
|
/// 入库任务RFID比对错误,默认值930
|
|
/// </summary>
|
|
public static readonly int TASKINPUTRFIDERROR = CGetInfo.GetIOControlStatus("TASKINPUTRFIDERROR").StatusID;
|
|
/// <summary>
|
|
/// 20100617管理任务对出库托盘确认接收,默认值50
|
|
/// </summary>
|
|
public static readonly int TASKOUTCONFIRM = CGetInfo.GetIOControlStatus("TASKOUTCONFIRM").StatusID;
|
|
/// <summary>
|
|
/// 20101011双叉极限货位需要更换货叉,默认值800
|
|
/// </summary>
|
|
public static readonly int TASKCHANGEFORK = CGetInfo.GetIOControlStatus("TASKCHANGEFORK").StatusID;
|
|
/// <summary>
|
|
/// 20120820双堆垛机同轨,极限位置需要两个堆垛机组合作业,默认值810
|
|
/// </summary>
|
|
public static readonly int TASKCHANGESTACK = CGetInfo.GetIOControlStatus("TASKCHANGESTACK").StatusID;
|
|
/// <summary>
|
|
/// 20101011调度已经获取任务,默认值7
|
|
/// </summary>
|
|
public static readonly int TASKCONTROLREADED = CGetInfo.GetIOControlStatus("TASKCONTROLREADED").StatusID;
|
|
/// <summary>
|
|
/// 20101028堆垛机单叉入库任务立即执行:默认值,25
|
|
/// </summary>
|
|
public static readonly int TASKSINGLEFORKRUN = CGetInfo.GetIOControlStatus("TASKSINGLEFORKRUN").StatusID;
|
|
#region 扫码异常处理20110210
|
|
/// <summary>
|
|
/// 20110210组箱区入库、出库扫码异常:默认值,70
|
|
/// </summary>
|
|
public static readonly int TASKINPUTSCANERROR = CGetInfo.GetIOControlStatus("TASKINPUTSCANERROR").StatusID;
|
|
/// <summary>
|
|
/// 20110210组箱区二楼出库扫码异常:默认值,60
|
|
/// </summary>
|
|
public static readonly int TASKOUTPUTSCANERROR = CGetInfo.GetIOControlStatus("TASKOUTPUTSCANERROR").StatusID;
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
#region 堆垛机取空和送重的故障码
|
|
///// <summary>
|
|
///// 堆垛机的送重故障码,默认48(双叉中的近叉)
|
|
///// </summary>
|
|
//public static readonly int STACKREPEATINPUT =CGetInfo.GetIOControlStatus("STACKREPEATINPUT").StatusID;
|
|
///// <summary>
|
|
///// 堆垛机的取空故障码,默认49(双叉中的近叉)
|
|
///// </summary>
|
|
//public static readonly int STACKEMPTYOUTPUT =CGetInfo.GetIOControlStatus("STACKEMPTYOUTPUT").StatusID;
|
|
///// <summary>
|
|
///// 堆垛机的送重故障码,默认60(双叉中的远叉)
|
|
///// </summary>
|
|
//public static readonly int STACKREPEATINPUTAWAY = CGetInfo.GetIOControlStatus("STACKREPEATINPUTAWAY").StatusID;
|
|
///// <summary>
|
|
///// 堆垛机的取空故障码,默认62(双叉中的远叉)
|
|
///// </summary>
|
|
//public static readonly int STACKEMPTYOUTPUTAWAY = CGetInfo.GetIOControlStatus("STACKEMPTYOUTPUTAWAY").StatusID;
|
|
///// <summary>
|
|
///// 堆垛机的送重故障码,默认61(双叉)
|
|
///// </summary>
|
|
//public static readonly int STACKREPEATINPUTDOUBLE = CGetInfo.GetIOControlStatus("STACKREPEATINPUTDOUBLE").StatusID;
|
|
///// <summary>
|
|
///// 堆垛机的取空故障码,默认63(双叉)
|
|
///// </summary>
|
|
//public static readonly int STACKEMPTYOUTPUTDOUBLE = CGetInfo.GetIOControlStatus("STACKEMPTYOUTPUTDOUBLE").StatusID;
|
|
|
|
#endregion
|
|
|
|
#region 设备类型
|
|
/// <summary>
|
|
/// 20110803堆垛机的设备类型,默认值1
|
|
/// </summary>
|
|
public static readonly int StackKind = CGetInfo.GetDeviceKind("StackKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803输送机的设备类型,默认值2
|
|
/// </summary>
|
|
public static readonly int ConveyorKind = CGetInfo.GetDeviceKind("ConveyorKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803升降机的设备类型,默认值3
|
|
/// </summary>
|
|
public static readonly int LifterKind = CGetInfo.GetDeviceKind("LifterKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803RGV穿梭车的设备类型,默认值4
|
|
/// </summary>
|
|
public static readonly int RGVKind = CGetInfo.GetDeviceKind("RGVKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803叠盘机的设备类型,默认值5
|
|
/// </summary>
|
|
public static readonly int PileKind = CGetInfo.GetDeviceKind("PileKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803AGV车的设备类型,默认值6
|
|
/// </summary>
|
|
public static readonly int AGVKind = CGetInfo.GetDeviceKind("AGVKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803托盘条码扫描仪的设备类型,默认值7
|
|
/// </summary>
|
|
public static readonly int BarcodeScanKind = CGetInfo.GetDeviceKind("BarcodeScanKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803称重设备的设备类型,默认值8
|
|
/// </summary>
|
|
public static readonly int WeighKind = CGetInfo.GetDeviceKind("WeighKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803站台的设备类型,默认值9
|
|
/// </summary>
|
|
public static readonly int PlatFormKind = CGetInfo.GetDeviceKind("PlatFormKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803巷道的设备类型,默认值10
|
|
/// </summary>
|
|
public static readonly int LanewayKind = CGetInfo.GetDeviceKind("LanewayKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803AGV通道的设备类型,默认值11
|
|
/// </summary>
|
|
public static readonly int AGVLane = CGetInfo.GetDeviceKind("AGVLane").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803虚拟关键设备的设备类型,默认值12
|
|
/// </summary>
|
|
public static readonly int DummyKind = CGetInfo.GetDeviceKind("DummyKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803空设备的设备类型,默认值13
|
|
/// </summary>
|
|
public static readonly int BlankKind = CGetInfo.GetDeviceKind("BlankKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803确认按钮的设备类型,默认值14
|
|
/// </summary>
|
|
public static readonly int ConfirmButtonKind = CGetInfo.GetDeviceKind("ConfirmButtonKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803确认按钮的设备类型,默认值15
|
|
/// </summary>
|
|
public static readonly int TimerKind = CGetInfo.GetDeviceKind("TimerKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803指示灯的设备类型,默认值16
|
|
/// </summary>
|
|
public static readonly int LightKind = CGetInfo.GetDeviceKind("LightKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803码垛机的设备类型,默认值17
|
|
/// </summary>
|
|
public static readonly int RobotKind = CGetInfo.GetDeviceKind("RobotKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803检测开关的设备类型,默认值18
|
|
/// </summary>
|
|
public static readonly int DetectSwitchKind = CGetInfo.GetDeviceKind("DetectSwitchKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803气动推杆设备类型,默认值19
|
|
/// </summary>
|
|
public static readonly int HandspikeKind = CGetInfo.GetDeviceKind("HandspikeKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803气动阻挡设备类型,默认值20
|
|
/// </summary>
|
|
public static readonly int BlockKind = CGetInfo.GetDeviceKind("BlockKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803一号工程码扫描器设备类型,默认值21
|
|
/// </summary>
|
|
public static readonly int FirstProjectCodeScanKind = CGetInfo.GetDeviceKind("FirstProjectCodeScanKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803现场控制触摸屏申请信息设备类型,默认值22
|
|
/// </summary>
|
|
public static readonly int HMIKind = CGetInfo.GetDeviceKind("HMIKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803一号工程码计数器设备类型,默认值23
|
|
/// </summary>
|
|
public static readonly int FirstProjectCodeCounterKind = CGetInfo.GetDeviceKind("FirstProjectCodeCounterKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803机器人码垛信息设备类型,默认值24
|
|
/// </summary>
|
|
public static readonly int RobotPileInfoKind = CGetInfo.GetDeviceKind("RobotPileInfoKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803机器人码垛通道设备类型,默认值25
|
|
/// </summary>
|
|
public static readonly int RobotPileLaneKind = CGetInfo.GetDeviceKind("RobotPileLaneKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803班次产量计数器设备类型,默认值26
|
|
/// </summary>
|
|
public static readonly int ClassOutputCounter = CGetInfo.GetDeviceKind("ClassOutputCounter").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803烟箱品牌设备类型,默认值27
|
|
/// </summary>
|
|
public static readonly int TobaccoBoxBreed = CGetInfo.GetDeviceKind("TobaccoBoxBreed").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803光电检测开始点设备类型,默认值28
|
|
/// </summary>
|
|
public static readonly int DetectSwitchStartKind = CGetInfo.GetDeviceKind("DetectSwitchStartKind").DeviceKindIndex;
|
|
|
|
/// <summary>
|
|
/// 20110803摄像头设备类型,默认值29
|
|
/// </summary>
|
|
public static readonly int CameraKind = CGetInfo.GetDeviceKind("CameraKind").DeviceKindIndex;
|
|
/// <summary>
|
|
/// 20110803和管理交互的虚拟设备类型,默认值30
|
|
/// </summary>
|
|
public static readonly int IOControlDummyKind = CGetInfo.GetDeviceKind("IOControlDummyKind").DeviceKindIndex;
|
|
|
|
#endregion
|
|
|
|
|
|
}
|
|
}
|