Implement ACS Command Handlers (PickOn, PickOff, Charge), Manual Mode Safety, and Map UI Commands
This commit is contained in:
@@ -65,6 +65,47 @@ namespace Project
|
||||
else PUB.log.AddE($"[{logPrefix}-SetCurrent] TagString Lenght Errorr:{data.Length}");
|
||||
break;
|
||||
|
||||
case ENIGProtocol.AGVCommandHE.PickOn: // 110
|
||||
case ENIGProtocol.AGVCommandHE.PickOff: // 111
|
||||
{
|
||||
PUB.log.AddI($"XBEE:작업명령수신:{cmd}");
|
||||
|
||||
// 현재 위치 확인 (TargetNode가 아닌 CurrentNode 기준)
|
||||
var currNode = PUB._virtualAGV.CurrentNode;
|
||||
if (currNode == null)
|
||||
{
|
||||
PUB.log.AddE($"[{logPrefix}-{cmd}] 현재 노드를 알 수 없습니다 NodeID:{PUB._virtualAGV.CurrentNodeId}");
|
||||
PUB.XBE.SendError(ENIGProtocol.AGVErrorCode.EmptyNode, "Unknown Node");
|
||||
return;
|
||||
}
|
||||
|
||||
PUB.NextWorkCmd = cmd;
|
||||
ERunStep nextStep = ERunStep.IDLE;
|
||||
|
||||
switch (currNode.Type)
|
||||
{
|
||||
case NodeType.Loader: nextStep = ERunStep.LOADER_IN; break;
|
||||
case NodeType.UnLoader: nextStep = ERunStep.UNLOADER_IN; break;
|
||||
case NodeType.Buffer: nextStep = ERunStep.BUFFER_IN; break;
|
||||
case NodeType.Clearner: nextStep = ERunStep.CLEANER_IN; break;
|
||||
default:
|
||||
PUB.log.AddE($"[{logPrefix}-{cmd}] 해당 노드타입({currNode.Type})은 작업을 지원하지 않습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
PUB.log.AddI($"작업 시작: {nextStep} (Type: {cmd})");
|
||||
PUB.sm.SetNewRunStep(nextStep);
|
||||
}
|
||||
break;
|
||||
|
||||
case ENIGProtocol.AGVCommandHE.Charger: // 112
|
||||
{
|
||||
PUB.log.AddI($"XBEE:충전명령수신");
|
||||
PUB.NextWorkCmd = ENIGProtocol.AGVCommandHE.Charger;
|
||||
PUB.sm.SetNewRunStep(ERunStep.GOCHARGE);
|
||||
}
|
||||
break;
|
||||
|
||||
case ENIGProtocol.AGVCommandHE.Goto: //move to tag
|
||||
if (data.Length > 4)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user