/// <summary> /// 结束任务 /// </summary> /// <param name="jobid"></param> public void OverTask(string jobid) { if (task.Exists(c => c.jobid == jobid)) { TaskFRT t = task.Find(c => c.jobid == jobid); if (string.IsNullOrEmpty(t.device.devName)) { // 解锁设备 t.device.IsLockUnlock(false); } task.RemoveAll(c => c.jobid == jobid); } }
/// <summary> /// 添加任务 /// </summary> /// <param name="task"></param> public void AddTask(string jobid, string area, TaskTypeEnum tasktype, int goodsnum, DevType fromdev, DevType todev, string frt = null) { int id = ADS.ID; ADS.PlusID(); TaskFRT t = new TaskFRT() { id = id, jobid = jobid, area = area, tasktype = tasktype, goodsnum = goodsnum, fromdev = fromdev, todev = todev, taskstatus = TaskStatus.init, frt = frt, device = new DevInfoFRT() }; task.Add(t); t.InsertDB(); }