파일정리
This commit is contained in:
79
HMI/Project/StateMachine/Step/_SM_RUN_GOTO.cs
Normal file
79
HMI/Project/StateMachine/Step/_SM_RUN_GOTO.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Project.StateMachine;
|
||||
using COMM;
|
||||
using AR;
|
||||
|
||||
namespace Project
|
||||
{
|
||||
public partial class fMain
|
||||
{
|
||||
byte GotoTurnStep = 0;
|
||||
DateTime GotoTurnSetTime = DateTime.Now;
|
||||
public Boolean _SM_RUN_GOTO(bool isFirst, TimeSpan stepTime)
|
||||
{
|
||||
///명령어 재전송 간격(기본 2초)
|
||||
var CommandInterval = 2;
|
||||
var funcName = "_SM_RUN_GOTO";
|
||||
|
||||
//충전 상태가 OFF되어야 동작하게한다
|
||||
if (_SM_RUN_CHARGE_GOFF(isFirst, stepTime) == false)
|
||||
return false;
|
||||
|
||||
//최초시작이라면 시간변수 초기화
|
||||
if (isFirst)
|
||||
{
|
||||
PUB.log.Add($"[>>] _SM_RUN_GOTO");
|
||||
VAR.TIME.Update(eVarTime.CheckGotoTargetSet);
|
||||
}
|
||||
|
||||
//라이더멈춤이 설정되어있다면 음성으로 알려준다 200409
|
||||
if (PUB.AGV.system1.stop_by_front_detect == true)
|
||||
{
|
||||
var tsSpeak = DateTime.Now - LastSpeakTime;
|
||||
if (tsSpeak.TotalSeconds >= PUB.setting.alarmSoundTerm)
|
||||
{
|
||||
PUB.Speak(Lang.전방에물체가감지되었습니다);
|
||||
LastSpeakTime = DateTime.Now;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
var idx = 1;
|
||||
if (PUB.sm.RunStepSeq == idx++)
|
||||
{
|
||||
if(PUB._virtualAGV.TargetNode == null)
|
||||
{
|
||||
PUB.log.Add($"대상노드가 없어 이동을할 수 없습니다");
|
||||
PUB.sm.SetNewRunStep(ERunStep.READY);
|
||||
return false;
|
||||
}
|
||||
PUB.sm.UpdateRunStepSeq();
|
||||
return false;
|
||||
}
|
||||
else if (PUB.sm.RunStepSeq == idx++)
|
||||
{
|
||||
//모션 전후진 제어
|
||||
if (UpdateMotionPositionForMark(funcName))
|
||||
{
|
||||
PUB.AGV.AGVMoveStop(funcName);
|
||||
PUB.sm.UpdateRunStepSeq();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else if (PUB.sm.RunStepSeq == idx++)
|
||||
{
|
||||
//QC까지 모두 완료되었다.(완전히 정차할때까지 기다린다)
|
||||
PUB.Speak(Lang.이동완료, true);
|
||||
PUB.AddEEDB($"이동완료({PUB._virtualAGV.TargetNode.ID2})");
|
||||
PUB.sm.UpdateRunStepSeq();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user