/// <summary> /// 获取已下发堆垛机指令 /// </summary> public TaskCmd GetSrmForksCmd(int taskNo, ref string errMsg) { try { var dt = GetCmdByTaskNo(taskNo); 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); } }
/// <summary> /// 设置堆垛机任务信息 /// </summary> public void SetSrmTaskInfo(TaskCmd cmd) { this.Objid = cmd.ObjId; this.TaskNo = cmd.TaskNo; switch (cmd.CmdStep) { case "00": this.CmdStep = "等待下发"; break; case "02": this.CmdStep = "执行"; break; case "04": this.CmdStep = "完成"; break; default: this.CmdStep = "异常"; break; } this.TaskType = cmd.CmdType; this.PalletNo = cmd.PalletNo; this.FromLoc = cmd.SlocPlcNo; this.ToLoc = cmd.ElocPlcNo; }