..
This commit is contained in:
@@ -29,18 +29,29 @@ namespace Project
|
||||
//가동불가 조건 확인
|
||||
if (CheckStopCondition() == false)
|
||||
{
|
||||
PUB.sm.SetNewStep(eSMStep.PAUSE);
|
||||
PUB.sm.SetNewStep(eSMStep.IDLE);
|
||||
return;
|
||||
}
|
||||
|
||||
//HW 연결오류
|
||||
if (PUB.AGV.IsOpen == false)
|
||||
{
|
||||
PUB.Result.SetResultMessage(eResult.Hardware, eECode.AGVCONN, eNextStep.ERROR);
|
||||
PUB.sm.SetNewStep(eSMStep.IDLE);
|
||||
return;
|
||||
}
|
||||
|
||||
//이머전시상태라면 stop 처리한다.
|
||||
if (PUB.AGV.error.Emergency && PUB.AGV.system1.agv_stop == true &&
|
||||
if (PUB.AGV.error.Emergency &&
|
||||
PUB.AGV.system1.agv_stop == true &&
|
||||
PUB.AGV.system1.stop_by_front_detect == false)
|
||||
{
|
||||
PUB.Speak(Lang.비상정지로인해작업을중단합니다);
|
||||
PUB.sm.SetNewStep(eSMStep.IDLE);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//스텝이 변경되었다면?
|
||||
if (PUB.sm.RunStep != PUB.sm.RunStepNew)
|
||||
{
|
||||
@@ -49,6 +60,7 @@ namespace Project
|
||||
}
|
||||
else runStepisFirst = false;
|
||||
|
||||
//처음시작이라면 시작시간을 설정한다
|
||||
if (isFirst)
|
||||
{
|
||||
if (PUB.sm.RunStep == ERunStep.READY)
|
||||
@@ -57,12 +69,52 @@ namespace Project
|
||||
VAR.TIME.Update(eVarTime.RunStart);
|
||||
}
|
||||
|
||||
//자동모드에서 대기상태 (추가동작없음)
|
||||
if (PUB.sm.RunStep == ERunStep.READY)
|
||||
{
|
||||
_SM_RUN_READY(runStepisFirst, PUB.sm.GetRunSteptime);
|
||||
return;
|
||||
}
|
||||
|
||||
//#############################################
|
||||
//## 이 후에는 모든 동작루틴이 온다
|
||||
//#############################################
|
||||
|
||||
//라이더 센서에서 멈춘경우 처리
|
||||
if (PUB.AGV.system1.stop_by_front_detect == true)
|
||||
{
|
||||
var tsSpeak = DateTime.Now - LastSpeakTime;
|
||||
if (tsSpeak.TotalSeconds >= PUB.setting.doorSoundTerm)
|
||||
{
|
||||
PUB.Speak(Lang.전방에물체가감지되었습니다);
|
||||
LastSpeakTime = DateTime.Now;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//나머지 상황체크
|
||||
switch (PUB.sm.RunStep)
|
||||
{
|
||||
case ERunStep.READY:
|
||||
_SM_RUN_READY(runStepisFirst, PUB.sm.GetRunSteptime);
|
||||
case ERunStep.GOTO: //목적지까지 이동하는 경우
|
||||
_SM_RUN_GOTO(runStepisFirst, PUB.sm.GetRunSteptime);
|
||||
break;
|
||||
|
||||
case ERunStep.MARKSTROPB: //후진방향으로 마크스탑
|
||||
case ERunStep.MARKSTOPF: //전진방향으로 마크스탑
|
||||
|
||||
//이동중이지 않다면 먼저 이동을 진행한다
|
||||
var agvDir = PUB.sm.RunStep == ERunStep.MARKSTOPF ? arDev.Narumi.eRunOpt.Forward : arDev.Narumi.eRunOpt.Backward;
|
||||
PUB.AGV.AGVMoveRun(agvDir);
|
||||
|
||||
//이동중이라면 마크스탑을 입력한다
|
||||
PUB.AGV.AGVMoveStop("run-markstropb", arDev.Narumi.eStopOpt.MarkStop);
|
||||
|
||||
//마크스탑신호를 확인한다.(최대 5초)
|
||||
|
||||
//신호가 확인되지 않으면 오류로 정지한다
|
||||
break;
|
||||
|
||||
|
||||
case ERunStep.GOCHARGE: //충전위치로 이동
|
||||
if (runStepisFirst)
|
||||
{
|
||||
@@ -196,6 +248,9 @@ namespace Project
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
bool CheckStopCondition()
|
||||
|
||||
Reference in New Issue
Block a user