..
This commit is contained in:
@@ -79,25 +79,37 @@ namespace Project
|
||||
var currNode = PUB._virtualAGV.CurrentNode;
|
||||
if (currNode == null)
|
||||
{
|
||||
PUB.log.AddE($"[{logPrefix}-{cmd}] 현재 노드를 알 수 없습니다 NodeID:{PUB._virtualAGV.CurrentNode.Id}");
|
||||
PUB.XBE.SendError(ENIGProtocol.AGVErrorCode.EmptyNode, "Unknown Node");
|
||||
PUB.log.AddE($"[{logPrefix}-{cmd}] 현재 노드를 알 수 없습니다");
|
||||
PUB.XBE.SendError(ENIGProtocol.AGVErrorCode.EmptyNode, "Unknown Current Node");
|
||||
return;
|
||||
}
|
||||
|
||||
PUB.NextWorkCmd = cmd;
|
||||
ERunStep nextStep = ERunStep.READY;
|
||||
var targetNode = PUB._virtualAGV.TargetNode;
|
||||
if (targetNode == null)
|
||||
{
|
||||
PUB.log.AddE($"[{logPrefix}-{cmd}] 목표 노드를 알 수 없습니다");
|
||||
PUB.XBE.SendError(ENIGProtocol.AGVErrorCode.EmptyNode, "Unknown Target Node");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (currNode.StationType)
|
||||
//버퍼의 경우 직전에 멈추기 때문에 스테이션종류를 보정해준다
|
||||
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_IN; break;
|
||||
case StationType.UnLoader: nextStep = ERunStep.UNLOADER_IN; break;
|
||||
case StationType.Buffer: nextStep = ERunStep.BUFFER_IN; break;
|
||||
case StationType.Clearner: nextStep = ERunStep.CLEANER_IN; break;
|
||||
default:
|
||||
PUB.log.AddE($"[{logPrefix}-{cmd}] 해당 노드타입({currNode.Type})은 작업을 지원하지 않습니다.");
|
||||
PUB.log.AddE($"[{logPrefix}-{cmd}] 해당 노드타입({StationType})은 작업을 지원하지 않습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
PUB.NextWorkCmd = cmd;
|
||||
PUB.log.AddI($"작업 시작: {nextStep} (Type: {cmd})");
|
||||
PUB.sm.SetNewRunStep(nextStep);
|
||||
}
|
||||
@@ -118,10 +130,10 @@ namespace Project
|
||||
{
|
||||
var currTag = System.Text.Encoding.Default.GetString(data, 1, data.Length - 1).Trim();
|
||||
MapNode targetNode = null;
|
||||
if(cmd == ENIGProtocol.AGVCommandHE.GotoAlias)
|
||||
if (cmd == ENIGProtocol.AGVCommandHE.GotoAlias)
|
||||
{
|
||||
targetNode = PUB._mapCanvas.Nodes.FirstOrDefault(t => t.AliasName == currTag);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ushort.TryParse(currTag, out ushort currtagvalue))
|
||||
@@ -155,14 +167,14 @@ namespace Project
|
||||
{
|
||||
PUB.log.AddE($"[{logPrefix}-Goto] 시작노드가 없습니다(현재위치 없음) NodeID:{PUB._virtualAGV.CurrentNode.Id}");
|
||||
}
|
||||
|
||||
|
||||
//대상이동으로 처리한다.
|
||||
if(PUB.sm.RunStep != ERunStep.GOTO)
|
||||
{
|
||||
if (PUB.sm.RunStep != ERunStep.GOTO)
|
||||
{
|
||||
PUB.sm.SetNewRunStep(StateMachine.ERunStep.GOTO);
|
||||
PUB.sm.ResetRunStepSeq();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Move to
|
||||
PUB.log.Add($"[{logPrefix}-{cmd}] {startNode.RfidId} -> {targetNode.RfidId}");
|
||||
@@ -242,9 +254,15 @@ namespace Project
|
||||
if (Lidar == 0) bunkidata.PBSSensor = 0;
|
||||
else bunkidata.PBSSensor = 2;
|
||||
|
||||
PUB.log.Add($"[{logPrefix}-AutoMove] DIR:{bunkidata.Direction}-{bunkidata.Bunki},SPD:{bunkidata.Speed}");
|
||||
PUB.AGV.AGVMoveSet(bunkidata);
|
||||
PUB.AGV.AGVMoveRun((MotDirection == 0 ? arDev.Narumi.eRunOpt.Backward : arDev.Narumi.eRunOpt.Forward));
|
||||
PUB.log.Add($"[{logPrefix}-AutoMove] DIR:{bunkidata.Direction}-{bunkidata.Bunki},SPD:{bunkidata.Speed}");
|
||||
|
||||
if (PUB.AGV.AGVMoveSet(bunkidata) != eNarumiCommandResult.Success)
|
||||
PUB.log.AddE($"AGV속도설정실패로 인해 자동전환이 실패되었습니다");
|
||||
else
|
||||
{
|
||||
PUB.log.Add($"XBE 에서 자동모드로 전환합니다");
|
||||
PUB.AGV.AGVMoveRun((MotDirection == 0 ? arDev.Narumi.eRunOpt.Backward : arDev.Narumi.eRunOpt.Forward));
|
||||
}
|
||||
break;
|
||||
|
||||
case ENIGProtocol.AGVCommandHE.MarkStop: //Set MarkStop
|
||||
@@ -274,7 +292,7 @@ namespace Project
|
||||
PUB.log.AddI($"충전을 시작합니다");
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
PUB.logagv.AddE($"Unknown Command : {cmd} Sender:{e.ReceivedPacket.ID}, Target:{data[0]}");
|
||||
PUB.XBE.SendError(ENIGProtocol.AGVErrorCode.UnknownCommand, $"{cmd}");
|
||||
@@ -323,7 +341,7 @@ namespace Project
|
||||
advancedResult.DockingValidation = DockingValidator.ValidateDockingDirection(advancedResult, _mapNodes);
|
||||
|
||||
//마지막대상이 버퍼라면 시퀀스처리를 해야한다
|
||||
if (targetNode.StationType == StationType.Buffer&& advancedResult.DetailedPath.Any())
|
||||
if (targetNode.StationType == StationType.Buffer && advancedResult.DetailedPath.Any())
|
||||
{
|
||||
var lastDetailPath = advancedResult.DetailedPath.Last();
|
||||
if (lastDetailPath.NodeId == targetNode.Id) //마지막노드 재확인
|
||||
@@ -349,7 +367,7 @@ namespace Project
|
||||
//UpdateAdvancedPathDebugInfo(advancedResult);
|
||||
|
||||
}
|
||||
else if(advancedResult != null)
|
||||
else if (advancedResult != null)
|
||||
{
|
||||
// 경로 실패시 디버깅 정보 초기화
|
||||
//_pathDebugLabel.Text = $"경로: 실패 - {advancedResult.ErrorMessage}";
|
||||
|
||||
Reference in New Issue
Block a user