示例#1
0
 /// <summary>
 /// 获取站台尚未完成的所有指令信息
 /// </summary>
 public TaskCmd LoadTaskCmd(string locNo, string cmdStep, ref string errMsg)
 {
     try
     {
         var dt = GetTaskCmd(locNo, cmdStep);
         if (dt == null || dt.Rows.Count <= 0)
         {
             return(null);
         }
         var taskCmd = new TaskCmd();
         taskCmd.ObjId     = Convert.ToInt32(dt.Rows[0]["OBJID"].ToString());
         taskCmd.TaskNo    = Convert.ToInt32(dt.Rows[0]["TASK_NO"]);
         taskCmd.SlocNo    = dt.Rows[0]["SLOC_NO"].ToString();
         taskCmd.SlocPlcNo = dt.Rows[0]["SLOC_PLC_NO"].ToString();
         taskCmd.ElocNo    = dt.Rows[0]["ELOC_NO"].ToString();
         taskCmd.ElocPlcNo = dt.Rows[0]["ELOC_PLC_NO"].ToString();
         taskCmd.PalletNo  = dt.Rows[0]["PALLET_NO"].ToString();
         taskCmd.CmdType   = dt.Rows[0]["CMD_TYPE"].ToString();
         taskCmd.CmdStep   = dt.Rows[0]["CMD_STEP"].ToString();
         return(taskCmd);
     }
     catch (Exception ex)
     {
         errMsg = ex.Message;
         return(null);
     }
 }
示例#2
0
 /// <summary>
 /// 获取指令信息
 /// </summary>
 public List <TaskCmd> LoadTaskCmd(string locNo, ref string errMsg)
 {
     try
     {
         var taskList = new List <TaskCmd>();
         var dt       = GetTaskCmd(locNo);
         if (dt == null || dt.Rows.Count <= 0)
         {
             return(null);
         }
         foreach (DataRow row in dt.Rows)
         {
             var taskCmd = new TaskCmd();
             taskCmd.ObjId     = Convert.ToInt32(row["OBJID"].ToString());
             taskCmd.TaskNo    = Convert.ToInt32(row["TASK_NO"]);
             taskCmd.SlocType  = row["SLOC_TYPE"].ToString();
             taskCmd.SlocNo    = row["SLOC_NO"].ToString();
             taskCmd.SlocPlcNo = row["SLOC_PLC_NO"].ToString();
             taskCmd.ElocType  = row["ELOC_TYPE"].ToString();
             taskCmd.ElocNo    = row["ELOC_NO"].ToString();
             taskCmd.ElocPlcNo = row["ELOC_PLC_NO"].ToString();
             taskCmd.PalletNo  = row["PALLET_NO"].ToString();
             taskCmd.CmdType   = row["CMD_TYPE"].ToString();
             taskCmd.CmdStep   = row["CMD_STEP"].ToString();
             taskList.Add(taskCmd);
         }
         return(taskList);
     }
     catch (Exception ex)
     {
         errMsg = ex.Message;
         return(null);
     }
 }