Commit 4a92be51 SK

AGV架构

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