Commit 4a92be51 SK

AGV架构

1 个父辈 089dc454
...@@ -7,10 +7,10 @@ namespace Acc.AgvManager ...@@ -7,10 +7,10 @@ namespace Acc.AgvManager
public class AgvBean public class AgvBean
{ {
public AgvStatus agvStatus; public AgvStatus agvStatus;
public AgvApi AgvApi; public AgvApi AgvApi { get; set; }
public Job job; public Job CurrentJob { get; set; }
public string Name; public string Name { get; set; }
public bool IsIdle() public bool IsIdle()
{ {
...@@ -24,33 +24,33 @@ namespace Acc.AgvManager ...@@ -24,33 +24,33 @@ namespace Acc.AgvManager
public void ExecuteNewJob(Job newJob) public void ExecuteNewJob(Job newJob)
{ {
job = newJob; CurrentJob = newJob;
} }
public void JobContinue(AgvBean currentAgvBean, Dictionary<string, Node> nodeMap, Dictionary<string, AgvBean> agvBeanMap) public void JobContinue(AgvBean currentAgvBean, Dictionary<string, Node> nodeMap, Dictionary<string, AgvBean> agvBeanMap)
{ {
if (job != null) if (CurrentJob != null)
{ {
if (!job.IsProcess) if (!CurrentJob.IsProcess)
{ {
try try
{ {
job.IsProcess = true; CurrentJob.IsProcess = true;
job.Execute(currentAgvBean, nodeMap, agvBeanMap); CurrentJob.Execute(currentAgvBean, nodeMap, agvBeanMap);
}catch(Exception e) }catch(Exception e)
{ {
LogUtil.error("AGV["+Name+"]执行任务["+job.ToString()+"]出错",e); LogUtil.error("AGV["+Name+"]执行任务["+ CurrentJob.ToString()+"]出错",e);
} }
finally finally
{ {
job.IsProcess = false; CurrentJob.IsProcess = false;
} }
} }
if (job.IsEnd()) if (CurrentJob.IsEnd())
{ {
//添加任务已经完成日志 //添加任务已经完成日志
job = null; CurrentJob = null;
} }
} }
} }
......
...@@ -42,6 +42,7 @@ namespace Acc.AgvManager.demo ...@@ -42,6 +42,7 @@ namespace Acc.AgvManager.demo
{ {
if(node is LineNode) if(node is LineNode)
{ {
agvBean.
LineNode lineNode = (LineNode)node; LineNode lineNode = (LineNode)node;
lineNode.StartOneTask(agvBean.Name); lineNode.StartOneTask(agvBean.Name);
AgvManager.UpdateNode(node); AgvManager.UpdateNode(node);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!