..
This commit is contained in:
@@ -52,6 +52,7 @@ namespace Project
|
||||
VAR.TIME.Update(eVarTime.ReadyStart);
|
||||
else
|
||||
VAR.TIME.Update(eVarTime.RunStart);
|
||||
VAR.I32[eVarInt32.PathValidationError] = 0;
|
||||
}
|
||||
|
||||
//자동모드에서 대기상태 (추가동작없음)
|
||||
@@ -90,7 +91,12 @@ namespace Project
|
||||
}
|
||||
|
||||
//현재위치를 모르는 상태라면 이동하여 현재 위치를 찾는다
|
||||
if (_SM_RUN_POSCHK(isFirst, stepTime) == false) return;
|
||||
if (_SM_RUN_POSCHK(isFirst, stepTime) == false)
|
||||
{
|
||||
PUB.Result.result_message = "현재 위치 확인 중";
|
||||
PUB.Result.result_progressmax = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
//나머지 상황체크
|
||||
switch (PUB.sm.RunStep)
|
||||
@@ -109,33 +115,46 @@ namespace Project
|
||||
var target = PUB._virtualAGV.TargetNode;
|
||||
PUB.log.Add($"목적지({target.RfidId}) 도착완료 타입:{target.Type}, 출발지:{PUB._virtualAGV.StartNode.RfidId}");
|
||||
|
||||
PUB.XBE.StepLoader = Device.eDocStep.NotSet;
|
||||
PUB.XBE.StepCleaner = Device.eDocStep.NotSet;
|
||||
PUB.XBE.StepUnloader = Device.eDocStep.NotSet;
|
||||
PUB.XBE.StepBuffer = Device.eDocStep.NotSet;
|
||||
|
||||
switch (target.StationType)
|
||||
{
|
||||
case AGVNavigationCore.Models.StationType.Buffer:
|
||||
//현재위치가 마지막경로의 NODEID와 일치해야한다
|
||||
if (PUB._virtualAGV.CurrentPath == null)
|
||||
{
|
||||
PUB.log.AddAT("목적지 버퍼이동완료 했지만 상세경로가 없습니다");
|
||||
PUB.XBE.BufferInComplete = false;
|
||||
PUB.XBE.BufferOutComplete = false;
|
||||
break;
|
||||
}
|
||||
var lastPath = PUB._virtualAGV.CurrentPath.DetailedPath.LastOrDefault();
|
||||
if (lastPath.NodeId.Equals(PUB._virtualAGV.CurrentNode.Id))
|
||||
{
|
||||
//버퍼진입전 노드에 도착완료했따
|
||||
PUB.XBE.BufferInReady = true;
|
||||
PUB.XBE.BufferReadyError = false;
|
||||
PUB.XBE.StepBuffer = Device.eDocStep.InReady;
|
||||
}
|
||||
else
|
||||
{
|
||||
//마지막위치가 아닌 다른 위치에 있으니 버퍼 작업을 할 수없다
|
||||
PUB.log.AddAT("목적지 버퍼이동완료 했지만 마지막 노드가 아닙니다");
|
||||
PUB.XBE.BufferInReady = false;
|
||||
PUB.XBE.BufferReadyError = true;
|
||||
PUB.XBE.StepBuffer = Device.eDocStep.NotSet;
|
||||
PUB.log.AddE($"목적지가 버퍼이나 노드가 불일치 한다 오류사항");
|
||||
PUB.sm.SetNewRunStep(ERunStep.ERROR);
|
||||
}
|
||||
PUB.XBE.BufferInComplete = false;
|
||||
PUB.XBE.BufferOutComplete = false;
|
||||
break;
|
||||
case AGVNavigationCore.Models.StationType.Charger:
|
||||
|
||||
break;
|
||||
|
||||
case AGVNavigationCore.Models.StationType.Loader:
|
||||
PUB.XBE.StepLoader = Device.eDocStep.InReady;
|
||||
break;
|
||||
|
||||
case AGVNavigationCore.Models.StationType.Clearner:
|
||||
PUB.XBE.StepCleaner = Device.eDocStep.InReady;
|
||||
break;
|
||||
|
||||
case AGVNavigationCore.Models.StationType.UnLoader:
|
||||
PUB.XBE.StepUnloader = Device.eDocStep.InReady;
|
||||
break;
|
||||
|
||||
default:
|
||||
PUB.log.Add($"정의되지 않은 스테이션 입니다({target.StationType}) ");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -144,7 +163,7 @@ namespace Project
|
||||
}
|
||||
break;
|
||||
|
||||
case ERunStep.MARKSTOPB: //후진방향으로 마크스탑
|
||||
case ERunStep.MARKSTOPB: //후진방향으로 마크스탑
|
||||
case ERunStep.MARKSTOPF: //전진방향으로 마크스탑
|
||||
|
||||
//이동중이지 않다면 먼저 이동을 진행한다
|
||||
@@ -169,10 +188,6 @@ namespace Project
|
||||
}
|
||||
else if (_SM_RUN_GOCHARGE(runStepisFirst, PUB.sm.GetRunSteptime))
|
||||
{
|
||||
//230601
|
||||
//if (PUB.Result != null && PUB.sm != null)
|
||||
// EEMStatus.AddEEDBSQL(PUB.sm.Step, PUB.sm.RunStep.ToString(), PUB.Result.TargetPos.ToString());
|
||||
|
||||
PUB.Speak(Lang.충전을시작합니다);
|
||||
PUB.sm.SetNewRunStep(ERunStep.CHARGECHECK);
|
||||
return;
|
||||
@@ -207,16 +222,7 @@ namespace Project
|
||||
//충전상태가 활성화되었으므로 대기상태로 전환한다
|
||||
PUB.sm.ClearRunStep();
|
||||
|
||||
//충전기위치에서 OFF를 한 경우이다
|
||||
if (PUB.Result.CurrentPos != ePosition.CHARGE || PUB.Result.TargetPos != ePosition.CHARGE)
|
||||
{
|
||||
PUB.Result.CurrentPos = ePosition.NONE;
|
||||
}
|
||||
else
|
||||
{
|
||||
PUB.Result.TargetPos = ePosition.QC;
|
||||
}
|
||||
PUB.Result.CurrentPosCW = "1";
|
||||
//대기상태로 전환
|
||||
PUB.sm.SetNewRunStep(ERunStep.READY);
|
||||
PUB.log.AddAT("충전 해제로 대기상태로 전환 합니다");
|
||||
}
|
||||
@@ -228,8 +234,7 @@ namespace Project
|
||||
PUB.Speak(Lang.버퍼도킹해제완료);
|
||||
|
||||
//도킹완료상태를 업데이트한다.
|
||||
PUB.XBE.LoaderInComplete = false;
|
||||
PUB.XBE.LoaderOutComplete = true;
|
||||
PUB.XBE.StepLoader = Device.eDocStep.OutComplete;
|
||||
|
||||
//대기상태로 전환
|
||||
PUB.sm.SetNewRunStep(ERunStep.READY);
|
||||
@@ -243,23 +248,10 @@ namespace Project
|
||||
PUB.Speak(Lang.버퍼도킹이완료되었습니다);
|
||||
|
||||
//도킹완료상태를 업데이트한다.
|
||||
PUB.XBE.LoaderInComplete = true;
|
||||
PUB.XBE.StepLoader = Device.eDocStep.InComplete;
|
||||
|
||||
//로더아웃으로 자동 진행하지 않음 (ACS 명령 대기)
|
||||
if (PUB.NextWorkCmd == ENIGProtocol.AGVCommandHE.PickOn || PUB.NextWorkCmd == ENIGProtocol.AGVCommandHE.PickOff)
|
||||
{
|
||||
PUB.sm.SetNewRunStep(ERunStep.READY);
|
||||
PUB.NextWorkCmd = ENIGProtocol.AGVCommandHE.Stop; // Command consumed
|
||||
}
|
||||
else
|
||||
{
|
||||
// Legacy behavior or Goto command: Auto-exit?
|
||||
// User said separation is key. Let's Stop here too or keep legacy for GOTO?
|
||||
// Assuming GOTO might rely on this, but safer to STOP if we want strict separation.
|
||||
// However, let's keep legacy behavior for GOTO if possible, but for PickOn/Off we STOP.
|
||||
PUB.sm.ClearRunStep();
|
||||
PUB.sm.SetNewRunStep(ERunStep.LOADER_OUT);
|
||||
}
|
||||
//대기상태로 전환
|
||||
PUB.sm.SetNewRunStep(ERunStep.READY);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@@ -270,8 +262,7 @@ namespace Project
|
||||
PUB.Speak(Lang.버퍼도킹해제완료);
|
||||
|
||||
//도킹완료상태를 업데이트한다.
|
||||
PUB.XBE.UnloaderInComplete = false;
|
||||
PUB.XBE.UnloaderOutComplete = true;
|
||||
PUB.XBE.StepUnloader = Device.eDocStep.OutComplete;
|
||||
|
||||
//대기상태로 전환
|
||||
PUB.sm.SetNewRunStep(ERunStep.READY);
|
||||
@@ -285,19 +276,10 @@ namespace Project
|
||||
PUB.Speak(Lang.버퍼도킹이완료되었습니다);
|
||||
|
||||
//도킹완료상태를 업데이트한다.
|
||||
PUB.XBE.UnloaderInComplete = true;
|
||||
PUB.XBE.StepUnloader = Device.eDocStep.InComplete;
|
||||
|
||||
//언로더아웃으로 자동 진행하지 않음
|
||||
if (PUB.NextWorkCmd == ENIGProtocol.AGVCommandHE.PickOn || PUB.NextWorkCmd == ENIGProtocol.AGVCommandHE.PickOff)
|
||||
{
|
||||
PUB.sm.SetNewRunStep(ERunStep.READY);
|
||||
PUB.NextWorkCmd = ENIGProtocol.AGVCommandHE.Stop;
|
||||
}
|
||||
else
|
||||
{
|
||||
PUB.sm.ClearRunStep();
|
||||
PUB.sm.SetNewRunStep(ERunStep.UNLOADER_OUT);
|
||||
}
|
||||
//대기상태로 전환
|
||||
PUB.sm.SetNewRunStep(ERunStep.READY);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@@ -308,8 +290,7 @@ namespace Project
|
||||
PUB.Speak(Lang.버퍼도킹해제완료);
|
||||
|
||||
//도킹완료상태를 업데이트한다.
|
||||
PUB.XBE.CleanerInComplete = false;
|
||||
PUB.XBE.CleanerOutComplete = true;
|
||||
PUB.XBE.StepCleaner = Device.eDocStep.OutComplete;
|
||||
|
||||
//대기상태로 전환
|
||||
PUB.sm.SetNewRunStep(ERunStep.READY);
|
||||
@@ -323,19 +304,10 @@ namespace Project
|
||||
PUB.Speak(Lang.버퍼도킹이완료되었습니다);
|
||||
|
||||
//도킹완료상태를 업데이트한다.
|
||||
PUB.XBE.CleanerInComplete = true;
|
||||
PUB.XBE.StepCleaner = Device.eDocStep.InComplete;
|
||||
|
||||
//클리너아웃으로 자동 진행하지 않음
|
||||
if (PUB.NextWorkCmd == ENIGProtocol.AGVCommandHE.PickOn || PUB.NextWorkCmd == ENIGProtocol.AGVCommandHE.PickOff)
|
||||
{
|
||||
PUB.sm.SetNewRunStep(ERunStep.READY);
|
||||
PUB.NextWorkCmd = ENIGProtocol.AGVCommandHE.Stop;
|
||||
}
|
||||
else
|
||||
{
|
||||
PUB.sm.ClearRunStep();
|
||||
PUB.sm.SetNewRunStep(ERunStep.CLEANER_OUT);
|
||||
}
|
||||
PUB.sm.SetNewRunStep(ERunStep.READY);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@@ -346,13 +318,13 @@ namespace Project
|
||||
PUB.Speak(Lang.버퍼도킹해제완료);
|
||||
|
||||
//도킹완료상태를 업데이트한다.
|
||||
PUB.XBE.BufferInComplete = false;
|
||||
PUB.XBE.BufferOutComplete = true;
|
||||
PUB.XBE.StepBuffer = Device.eDocStep.OutComplete;
|
||||
|
||||
//대기상태로 전환
|
||||
PUB.sm.SetNewRunStep(ERunStep.READY);
|
||||
return;
|
||||
}
|
||||
else PUB.XBE.StepBuffer = Device.eDocStep.OutIng;
|
||||
break;
|
||||
|
||||
case ERunStep.BUFFER_IN: //버퍼도킹
|
||||
@@ -361,28 +333,16 @@ namespace Project
|
||||
PUB.Speak(Lang.버퍼도킹이완료되었습니다);
|
||||
|
||||
//도킹완료상태를 업데이트한다.
|
||||
PUB.XBE.BufferInComplete = true;
|
||||
PUB.XBE.StepBuffer = Device.eDocStep.InComplete;
|
||||
|
||||
//버퍼아웃으로 자동 진행하지 않음
|
||||
if (PUB.NextWorkCmd == ENIGProtocol.AGVCommandHE.PickOn || PUB.NextWorkCmd == ENIGProtocol.AGVCommandHE.PickOff)
|
||||
{
|
||||
PUB.sm.SetNewRunStep(ERunStep.READY);
|
||||
PUB.NextWorkCmd = ENIGProtocol.AGVCommandHE.Stop;
|
||||
}
|
||||
else
|
||||
{
|
||||
PUB.sm.ClearRunStep();
|
||||
PUB.sm.SetNewRunStep(ERunStep.BUFFER_OUT);
|
||||
}
|
||||
//대기상태로 전환
|
||||
PUB.sm.SetNewRunStep(ERunStep.READY);
|
||||
return;
|
||||
}
|
||||
else PUB.XBE.StepBuffer = Device.eDocStep.InIng;
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}//cvass
|
||||
|
||||
Reference in New Issue
Block a user