buffer in 시퀀스 확인 완료
- 최초 위치확인이 좀 이상하다.
This commit is contained in:
@@ -119,7 +119,52 @@ namespace Project
|
||||
PUB.sm.SetNewRunStep(nextStep);
|
||||
}
|
||||
break;
|
||||
case ENIGProtocol.AGVCommandHE.PickOnExit:
|
||||
case ENIGProtocol.AGVCommandHE.PickOffExit:
|
||||
{
|
||||
Resultclear();
|
||||
PUB.log.AddI($"XBEE:작업명령수신:{cmd}");
|
||||
|
||||
// 현재 위치 확인 (TargetNode가 아닌 CurrentNode 기준)
|
||||
var currNode = PUB._virtualAGV.CurrentNode;
|
||||
if (currNode == null)
|
||||
{
|
||||
PUB.log.AddE($"[{logPrefix}-{cmd}] 현재 노드를 알 수 없습니다");
|
||||
PUB.XBE.SendError(ENIGProtocol.AGVErrorCode.EmptyNode, "Unknown Current Node");
|
||||
return;
|
||||
}
|
||||
|
||||
var targetNode = PUB._virtualAGV.TargetNode;
|
||||
if (targetNode == null)
|
||||
{
|
||||
PUB.log.AddE($"[{logPrefix}-{cmd}] 목표 노드를 알 수 없습니다");
|
||||
PUB.XBE.SendError(ENIGProtocol.AGVErrorCode.EmptyNode, "Unknown Target Node");
|
||||
return;
|
||||
}
|
||||
|
||||
//버퍼의 경우 직전에 멈추기 때문에 스테이션종류를 보정해준다
|
||||
var StationType = currNode.StationType;
|
||||
if (StationType == StationType.Normal && targetNode.StationType == StationType.Buffer)
|
||||
StationType = StationType.Buffer;
|
||||
|
||||
ERunStep nextStep = ERunStep.READY;
|
||||
switch (StationType)
|
||||
{
|
||||
case StationType.Loader: nextStep = ERunStep.LOADER_OUT; break;
|
||||
case StationType.UnLoader: nextStep = ERunStep.UNLOADER_OUT; break;
|
||||
case StationType.Buffer: nextStep = ERunStep.BUFFER_OUT; break;
|
||||
case StationType.Clearner: nextStep = ERunStep.CLEANER_OUT; break;
|
||||
default:
|
||||
PUB.log.AddE($"[{logPrefix}-{cmd}] 해당 노드타입({StationType})은 작업을 지원하지 않습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
//다음명령처리
|
||||
PUB.NextWorkCmd = cmd;
|
||||
PUB.log.AddI($"작업 시작: {nextStep} (Type: {cmd})");
|
||||
PUB.sm.SetNewRunStep(nextStep);
|
||||
}
|
||||
break;
|
||||
case ENIGProtocol.AGVCommandHE.Charger: // 112
|
||||
{
|
||||
Resultclear();
|
||||
|
||||
Reference in New Issue
Block a user