경로로직
This commit is contained in:
@@ -123,7 +123,7 @@ namespace Project
|
||||
|
||||
switch (target.StationType)
|
||||
{
|
||||
case AGVNavigationCore.Models.StationType.Buffer:
|
||||
case AGVNavigationCore.Models.Station.Buffer:
|
||||
var lastPath = PUB._virtualAGV.CurrentPath.DetailedPath.LastOrDefault();
|
||||
if (lastPath.NodeId.Equals(PUB._virtualAGV.CurrentNode.Id))
|
||||
{
|
||||
@@ -139,19 +139,19 @@ namespace Project
|
||||
PUB.sm.SetNewRunStep(ERunStep.ERROR);
|
||||
}
|
||||
break;
|
||||
case AGVNavigationCore.Models.StationType.Charger:
|
||||
case AGVNavigationCore.Models.Station.Charger:
|
||||
|
||||
break;
|
||||
|
||||
case AGVNavigationCore.Models.StationType.Loader:
|
||||
case AGVNavigationCore.Models.Station.Loder:
|
||||
PUB.XBE.StepMC = Device.eDocStep.ReadyForEnter;
|
||||
break;
|
||||
|
||||
case AGVNavigationCore.Models.StationType.Plating:
|
||||
case AGVNavigationCore.Models.Station.Plating:
|
||||
PUB.XBE.StepMC = Device.eDocStep.ReadyForEnter;
|
||||
break;
|
||||
|
||||
case AGVNavigationCore.Models.StationType.Cleaner:
|
||||
case AGVNavigationCore.Models.Station.Cleaner:
|
||||
PUB.XBE.StepMC = Device.eDocStep.ReadyForEnter;
|
||||
break;
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Project
|
||||
else if (PUB.sm.RunStepSeq == idx++)
|
||||
{
|
||||
//버퍼 노드 여부 확인
|
||||
if (PUB._virtualAGV.CurrentNode.StationType != AGVNavigationCore.Models.StationType.Buffer)
|
||||
if (PUB._virtualAGV.CurrentNode.StationType != AGVNavigationCore.Models.Station.Buffer)
|
||||
{
|
||||
SetRunStepError(ENIGProtocol.AGVErrorCode.NOT_BUFFERPOINT, $"[{funcname}-{PUB.sm.RunStepSeq}] 현재 위치가 버퍼가 아닙니다({PUB._virtualAGV.CurrentNode.StationType})");
|
||||
return false;
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace Project
|
||||
else if (PUB.sm.RunStepSeq == idx++)
|
||||
{
|
||||
//버퍼 노드 여부 확인
|
||||
if (PUB._virtualAGV.CurrentNode.StationType != AGVNavigationCore.Models.StationType.Buffer)
|
||||
if (PUB._virtualAGV.CurrentNode.StationType != AGVNavigationCore.Models.Station.Buffer)
|
||||
{
|
||||
SetRunStepError(ENIGProtocol.AGVErrorCode.NOT_BUFFERPOINT, $"[{funcname}-{PUB.sm.RunStepSeq}] 현재 위치가 버퍼가 아닙니다({PUB._virtualAGV.CurrentNode.StationType})");
|
||||
return false;
|
||||
|
||||
@@ -38,9 +38,9 @@ namespace Project
|
||||
else if (PUB.sm.RunStepSeq == idx++)
|
||||
{
|
||||
//장비 노드 여부 확인 (버퍼가 아닌 도킹 가능 노드여야 함)
|
||||
if (PUB._virtualAGV.CurrentNode.StationType != StationType.Loader &&
|
||||
PUB._virtualAGV.CurrentNode.StationType != StationType.Plating &&
|
||||
PUB._virtualAGV.CurrentNode.StationType != StationType.Cleaner)
|
||||
if (PUB._virtualAGV.CurrentNode.StationType != Station.Loder &&
|
||||
PUB._virtualAGV.CurrentNode.StationType != Station.Plating &&
|
||||
PUB._virtualAGV.CurrentNode.StationType != Station.Cleaner)
|
||||
{
|
||||
SetRunStepError(ENIGProtocol.AGVErrorCode.NOT_EQUIPMENTPOINT, $"[{funcname}-{PUB.sm.RunStepSeq}] 현재 위치가 장비 노드가 아닙니다({PUB._virtualAGV.CurrentNode.StationType})");
|
||||
return false;
|
||||
|
||||
@@ -39,9 +39,9 @@ namespace Project
|
||||
else if (PUB.sm.RunStepSeq == idx++)
|
||||
{
|
||||
//장비 노드 여부 확인 (버퍼가 아닌 도킹 가능 노드여야 함)
|
||||
if (PUB._virtualAGV.CurrentNode.StationType != StationType.Loader &&
|
||||
PUB._virtualAGV.CurrentNode.StationType != StationType.Plating &&
|
||||
PUB._virtualAGV.CurrentNode.StationType != StationType.Cleaner)
|
||||
if (PUB._virtualAGV.CurrentNode.StationType != Station.Loder &&
|
||||
PUB._virtualAGV.CurrentNode.StationType != Station.Plating &&
|
||||
PUB._virtualAGV.CurrentNode.StationType != Station.Cleaner)
|
||||
{
|
||||
SetRunStepError(ENIGProtocol.AGVErrorCode.NOT_EQUIPMENTPOINT, $"[{funcname}-{PUB.sm.RunStepSeq}] 현재 위치가 장비 노드가 아닙니다({PUB._virtualAGV.CurrentNode.StationType})");
|
||||
return false;
|
||||
|
||||
@@ -319,7 +319,7 @@ namespace Project
|
||||
// 목적지 도착 여부 확인
|
||||
if (PUB.AGV.signal1.mark_sensor == false)
|
||||
{
|
||||
if (PUB._virtualAGV.TargetNode.StationType != StationType.Normal)
|
||||
if (PUB._virtualAGV.TargetNode.StationType != Station.Normal)
|
||||
{
|
||||
PUB.log.AddAT($"목표({PUB._virtualAGV.TargetNode.RfidId})도착되었으나 마크센서가 감지되지 않아 완료처리 하지않습니다");
|
||||
return false;
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace Project
|
||||
PUB.log.Add($"AGV Turn Complete:{e.Direction}");
|
||||
|
||||
//일반노드에서 턴작업이 진행되었다면, 이전경로와 현재경로의 모터 방향을 바꿔준다(일반노드에서만 사용)
|
||||
if (PUB._virtualAGV.CurrentNode != null && PUB._virtualAGV.CurrentNode.StationType == StationType.Normal)
|
||||
if (PUB._virtualAGV.CurrentNode != null && PUB._virtualAGV.CurrentNode.StationType == Station.Normal)
|
||||
{
|
||||
var prevnodeid = PUB._virtualAGV.PrevNode;//.Id;
|
||||
var currnodeid = PUB._virtualAGV.CurrentNode;//.Id;
|
||||
@@ -270,7 +270,7 @@ namespace Project
|
||||
PUB.SaveLastPosition();
|
||||
|
||||
//노드가 들어왔는데. 일반 노드라면.. 턴 정보를 제거한다.
|
||||
if (CurrentNode.StationType != StationType.Buffer && PUB._virtualAGV.Turn != AGVTurn.None)
|
||||
if (CurrentNode.StationType != Station.Buffer && PUB._virtualAGV.Turn != AGVTurn.None)
|
||||
{
|
||||
PUB.log.AddAT($"현재노드위치가 버퍼가 아니라서 턴정보를 초기화합니다{PUB._virtualAGV.Turn}");
|
||||
PUB._virtualAGV.Turn = AGVTurn.None;
|
||||
|
||||
@@ -109,16 +109,16 @@ namespace Project
|
||||
|
||||
//버퍼의 경우 직전에 멈추기 때문에 스테이션종류를 보정해준다
|
||||
var StationType = currNode.StationType;
|
||||
if (StationType == StationType.Normal && targetNode.StationType == StationType.Buffer)
|
||||
StationType = StationType.Buffer;
|
||||
if (StationType == Station.Normal && targetNode.StationType == Station.Buffer)
|
||||
StationType = Station.Buffer;
|
||||
|
||||
ERunStep nextStep = ERunStep.READY;
|
||||
switch (StationType)
|
||||
{
|
||||
case StationType.Loader: nextStep = ERunStep.LOADER_IN; break;
|
||||
case StationType.Cleaner: nextStep = ERunStep.UNLOADER_IN; break;
|
||||
case StationType.Buffer: nextStep = ERunStep.BUFFER_IN; break;
|
||||
case StationType.Plating: nextStep = ERunStep.CLEANER_IN; break;
|
||||
case Station.Loder: nextStep = ERunStep.LOADER_IN; break;
|
||||
case Station.Cleaner: nextStep = ERunStep.UNLOADER_IN; break;
|
||||
case Station.Buffer: nextStep = ERunStep.BUFFER_IN; break;
|
||||
case Station.Plating: nextStep = ERunStep.CLEANER_IN; break;
|
||||
default:
|
||||
PUB.log.AddE($"[{logPrefix}-{cmd}] 해당 노드타입({StationType})은 작업을 지원하지 않습니다.");
|
||||
return;
|
||||
@@ -190,16 +190,16 @@ namespace Project
|
||||
|
||||
//버퍼의 경우 직전에 멈추기 때문에 스테이션종류를 보정해준다
|
||||
var StationType = currNode.StationType;
|
||||
if (StationType == StationType.Normal && targetNode.StationType == StationType.Buffer)
|
||||
StationType = StationType.Buffer;
|
||||
if (StationType == Station.Normal && targetNode.StationType == Station.Buffer)
|
||||
StationType = Station.Buffer;
|
||||
|
||||
ERunStep nextStep = ERunStep.READY;
|
||||
switch (StationType)
|
||||
{
|
||||
case StationType.Loader: nextStep = ERunStep.LOADER_OUT; break;
|
||||
case StationType.Cleaner: nextStep = ERunStep.UNLOADER_OUT; break;
|
||||
case StationType.Buffer: nextStep = ERunStep.BUFFER_OUT; break;
|
||||
case StationType.Plating: nextStep = ERunStep.CLEANER_OUT; break;
|
||||
case Station.Loder: nextStep = ERunStep.LOADER_OUT; break;
|
||||
case Station.Cleaner: nextStep = ERunStep.UNLOADER_OUT; break;
|
||||
case Station.Buffer: nextStep = ERunStep.BUFFER_OUT; break;
|
||||
case Station.Plating: nextStep = ERunStep.CLEANER_OUT; break;
|
||||
default:
|
||||
PUB.logdebug.Add($"[AI_TRACE] REJECTED: Unsupported station type {StationType} for command {cmd}");
|
||||
PUB.log.AddE($"[{logPrefix}-{cmd}] 해당 노드타입({StationType})은 작업을 지원하지 않습니다.");
|
||||
@@ -287,7 +287,7 @@ namespace Project
|
||||
|
||||
//노드가 들어왔는데. 일반 노드라면.. 턴 정보를 제거한다.
|
||||
if (PUB._virtualAGV.CurrentNode != null &&
|
||||
PUB._virtualAGV.CurrentNode.StationType != StationType.Buffer &&
|
||||
PUB._virtualAGV.CurrentNode.StationType != Station.Buffer &&
|
||||
PUB._virtualAGV.Turn != AGVTurn.None)
|
||||
{
|
||||
PUB.log.AddAT($"[{logPrefix}-Goto] 현재노드위치가 버퍼가 아니라서 턴정보를 초기화합니다{PUB._virtualAGV.Turn}");
|
||||
|
||||
Reference in New Issue
Block a user