fix
This commit is contained in:
@@ -56,33 +56,33 @@ namespace Project
|
||||
VAR.BOOL[eVarBool.AGV_ERROR] = PUB.AGV.error.Value > 0;
|
||||
VAR.BOOL[eVarBool.EMERGENCY] = PUB.AGV.error.Emergency;
|
||||
|
||||
//모터방향 입력
|
||||
if (PUB.AGV.data.Direction == 'B')
|
||||
PUB.mapctl.Manager.agv.Current_Motor_Direction = AGVControl.AgvDir.Backward;
|
||||
else
|
||||
PUB.mapctl.Manager.agv.Current_Motor_Direction = AGVControl.AgvDir.Forward;
|
||||
////모터방향 입력
|
||||
//if (PUB.AGV.data.Direction == 'B')
|
||||
// PUB.mapctl.Manager.agv.Current_Motor_Direction = AGVControl.AgvDir.Backward;
|
||||
//else
|
||||
// PUB.mapctl.Manager.agv.Current_Motor_Direction = AGVControl.AgvDir.Forward;
|
||||
|
||||
//현재 속도
|
||||
if (PUB.AGV.data.Speed == 'H')
|
||||
PUB.mapctl.Manager.agv.CurrentSpeed = AGVControl.AgvSpeed.High;
|
||||
else if (PUB.AGV.data.Speed == 'M')
|
||||
PUB.mapctl.Manager.agv.CurrentSpeed = AGVControl.AgvSpeed.Middle;
|
||||
else if (PUB.AGV.data.Speed == 'L')
|
||||
PUB.mapctl.Manager.agv.CurrentSpeed = AGVControl.AgvSpeed.Low;
|
||||
else if (PUB.AGV.data.Speed == 'S')
|
||||
PUB.mapctl.Manager.agv.CurrentSpeed = AGVControl.AgvSpeed.MarkStop;
|
||||
////현재 속도
|
||||
//if (PUB.AGV.data.Speed == 'H')
|
||||
// PUB.mapctl.Manager.agv.CurrentSpeed = AGVControl.AgvSpeed.High;
|
||||
//else if (PUB.AGV.data.Speed == 'M')
|
||||
// PUB.mapctl.Manager.agv.CurrentSpeed = AGVControl.AgvSpeed.Middle;
|
||||
//else if (PUB.AGV.data.Speed == 'L')
|
||||
// PUB.mapctl.Manager.agv.CurrentSpeed = AGVControl.AgvSpeed.Low;
|
||||
//else if (PUB.AGV.data.Speed == 'S')
|
||||
// PUB.mapctl.Manager.agv.CurrentSpeed = AGVControl.AgvSpeed.MarkStop;
|
||||
|
||||
//이동방향
|
||||
if (PUB.AGV.data.Sts == 'S')
|
||||
PUB.mapctl.Manager.agv.CurrentSTS = AGVControl.AgvSts.Straight;
|
||||
else if (PUB.AGV.data.Sts == 'L')
|
||||
PUB.mapctl.Manager.agv.CurrentSTS = AGVControl.AgvSts.Left;
|
||||
else if (PUB.AGV.data.Sts == 'R')
|
||||
PUB.mapctl.Manager.agv.CurrentSTS = AGVControl.AgvSts.Right;
|
||||
////이동방향
|
||||
//if (PUB.AGV.data.Sts == 'S')
|
||||
// PUB.mapctl.Manager.agv.CurrentSTS = AGVControl.AgvSts.Straight;
|
||||
//else if (PUB.AGV.data.Sts == 'L')
|
||||
// PUB.mapctl.Manager.agv.CurrentSTS = AGVControl.AgvSts.Left;
|
||||
//else if (PUB.AGV.data.Sts == 'R')
|
||||
// PUB.mapctl.Manager.agv.CurrentSTS = AGVControl.AgvSts.Right;
|
||||
|
||||
|
||||
PUB.mapctl.Manager.agv.IsMoving = PUB.AGV.system1.agv_run;
|
||||
PUB.mapctl.Manager.agv.IsMarkCheck = PUB.AGV.system1.Mark1_check || PUB.AGV.system1.Mark2_check;
|
||||
//PUB.mapctl.Manager.agv.IsMoving = PUB.AGV.system1.agv_run;
|
||||
//PUB.mapctl.Manager.agv.IsMarkCheck = PUB.AGV.system1.Mark1_check || PUB.AGV.system1.Mark2_check;
|
||||
|
||||
if (PUB.AGV.signal.mark_sensor == false)
|
||||
{
|
||||
@@ -184,41 +184,18 @@ namespace Project
|
||||
PUB.log.AddE(logEMsg);
|
||||
}
|
||||
|
||||
//맵데이터에서 현재 위치를 찾는다
|
||||
if (PUB.mapctl.SetCurrentPosition(PUB.AGV.data.TagNo) == false)
|
||||
//virtual agv setting
|
||||
var CurrentNode = PUB._mapNodes.FirstOrDefault(t => t.RfidId.Equals(PUB.Result.LastTAG, StringComparison.OrdinalIgnoreCase));
|
||||
if (CurrentNode == null)
|
||||
{
|
||||
if (VAR.BOOL[eVarBool.FLAG_AUTORUN] && PUB.AGV.system1.agv_run)
|
||||
PUB.AGV.AGVMoveStop("unknown tag no");
|
||||
|
||||
//존재하지 않는 태그가 읽히면 관련 오류를 표시한다.
|
||||
}
|
||||
else
|
||||
{
|
||||
//위치는 찾았다 해당 위치가 내 목적지라면 mark stop기능으로 전환한다
|
||||
PUB.log.AddE($"RFID:{PUB.Result.LastTAG} 의 노드를 찾을 수 없습니다");
|
||||
return;
|
||||
}
|
||||
|
||||
////자동, 상하차 모드일때 RFID 가 타겟위치에 올때는 - 멈춤을 설정해준다
|
||||
//if (VAR.BOOL[eVarBool.FLAG_AUTORUN] == true &&
|
||||
// PUB.Result.CurrentPos == PUB.Result.TargetPos &&
|
||||
// PUB.Result.TargetPos != ePosition.NONE &&
|
||||
// (PUB.sm.RunStep == ERunStep.GODOWN ||
|
||||
// PUB.sm.RunStep == ERunStep.GOUP ||
|
||||
// PUB.sm.RunStep == ERunStep.GOHOME ||
|
||||
// PUB.sm.RunStep == ERunStep.GOCHARGE))
|
||||
//{
|
||||
// if (PUB.AGV.data.Sts == 'F' && dirForward == "0") //아래로 내려오고있음
|
||||
// {
|
||||
// PUB.AGV.AGVMoveStop("AGV_DataReceive", arDev.Narumi.eStopOpt.MarkStop);
|
||||
// PUB.Speak( Lang.다음마크위치에서정지합니다);
|
||||
// }
|
||||
// else if (PUB.AGV.data.Sts == 'B' && dirForward == "1")
|
||||
// {
|
||||
// //VAR.BOOL[eVarBool.FLAG_NEXTSTOP_MARK] = true;
|
||||
// PUB.AGV.AGVMoveStop("AGV_DataReceive", arDev.Narumi.eStopOpt.MarkStop);
|
||||
// PUB.Speak(Lang.다음마크위치에서정지합니다);
|
||||
// }
|
||||
//}
|
||||
|
||||
//모터방향 확인해서 UI와 AGV클래스에 적용한다
|
||||
var MotDireciton = PUB.AGV.data.Direction == 'B' ? AGVNavigationCore.Models.AgvDirection.Backward : AGVNavigationCore.Models.AgvDirection.Forward;
|
||||
PUB._virtualAGV.SetPosition(CurrentNode, MotDireciton);
|
||||
PUB._mapCanvas.SetAGVPosition("AGV", CurrentNode, MotDireciton);
|
||||
}
|
||||
break;
|
||||
case arDev.Narumi.DataType.ACK:
|
||||
@@ -231,12 +208,8 @@ namespace Project
|
||||
}
|
||||
|
||||
//이 후 상황을 예측한다
|
||||
if (PUB.mapctl != null)
|
||||
{
|
||||
var rlt = PUB.mapctl.Manager.PredictNextAction();
|
||||
if (rlt.Changed)
|
||||
Console.WriteLine($"[new] predict idx:{rlt.Idx}");
|
||||
}
|
||||
var command = PUB._virtualAGV.Predict();
|
||||
var preditMSG = $"Motor:{command.Motor},Magnet:{command.Magnet},Speed:{command.Speed} : {command.Reason}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user