buffer in 시퀀스 확인 완료
- 최초 위치확인이 좀 이상하다.
This commit is contained in:
@@ -33,7 +33,7 @@ namespace Project
|
||||
|
||||
if (PUB.sm.RunStepSeq == idx++)
|
||||
{
|
||||
PUB.log.Add($"[{funcname}] 버퍼진입시작({PUB.NextWorkCmd}) Turn:{PUB._virtualAGV.Turn}");
|
||||
PUB.log.Add($"[{funcname}-{PUB.sm.RunStepSeq}] 버퍼진입시작({PUB.NextWorkCmd}) Turn:{PUB._virtualAGV.Turn}");
|
||||
PUB.Speak(Lang.진입을작합니다);
|
||||
PUB.sm.UpdateRunStepSeq();
|
||||
return false;
|
||||
@@ -63,7 +63,7 @@ namespace Project
|
||||
//이미 턴이 되어있는지 확인한다 (재진입 시 중복 실행 방지)
|
||||
if (PUB._virtualAGV.Turn == AGVNavigationCore.Models.AGVTurn.L90)
|
||||
{
|
||||
PUB.log.Add($"[{funcname}] 이미 Left Turn 완료 상태입니다. 턴 명령을 건너뜁니다.");
|
||||
PUB.log.Add($"[{funcname}-{PUB.sm.RunStepSeq}] 이미 Left Turn 완료 상태입니다. 턴 명령을 건너뜁니다.");
|
||||
PUB.sm.UpdateRunStepSeq();
|
||||
}
|
||||
else
|
||||
@@ -74,19 +74,19 @@ namespace Project
|
||||
if (turnState == arDev.eNarumiTurn.Left || turnState == arDev.eNarumiTurn.LeftIng)
|
||||
{
|
||||
//이미 좌회전 중이거나 완료된 하드웨어 상태
|
||||
PUB.log.Add($"[{funcname}] 하드웨어 좌회전 상태 확인됨({turnState}). 명령을 건너뜁니다.");
|
||||
PUB.log.Add($"[{funcname}-{PUB.sm.RunStepSeq}] 하드웨어 좌회전 상태 확인됨({turnState}). 명령을 건너뜁니다.");
|
||||
PUB.sm.UpdateRunStepSeq();
|
||||
}
|
||||
else if (turnState == arDev.eNarumiTurn.Right || turnState == arDev.eNarumiTurn.RightIng)
|
||||
{
|
||||
//비정상 상태 (우회전 중?)
|
||||
SetRunStepError(ENIGProtocol.AGVErrorCode.TURN_FAIL, $"[{funcname}] 턴 방향 불일치(Current:{turnState}). 우회전 상태에서 좌회전을 시도할 수 없습니다.");
|
||||
SetRunStepError(ENIGProtocol.AGVErrorCode.TURN_FAIL, $"[{funcname}-{PUB.sm.RunStepSeq}] 턴 방향 불일치(Current:{turnState}). 우회전 상태에서 좌회전을 시도할 수 없습니다.");
|
||||
}
|
||||
else
|
||||
{
|
||||
//정상 (None) -> 턴 명령 실행
|
||||
PUB.AGV.AGVMoveLeft180Turn();
|
||||
PUB.log.Add("AGV Left Turn");
|
||||
PUB.log.Add($"[{funcname}-{PUB.sm.RunStepSeq}] AGV Left Turn");
|
||||
VAR.TIME.Update(eVarTime.LastTurnCommandTime);
|
||||
PUB.sm.UpdateRunStepSeq();
|
||||
}
|
||||
@@ -121,7 +121,7 @@ namespace Project
|
||||
return false;
|
||||
}
|
||||
PUB._virtualAGV.Turn = AGVNavigationCore.Models.AGVTurn.L90; //턴완료
|
||||
PUB.log.Add($"[{funcname}] Turn(left) 완료");
|
||||
PUB.log.Add($"[{funcname}-{PUB.sm.RunStepSeq}] Turn(left) 완료");
|
||||
PUB.sm.UpdateRunStepSeq(); //이미완료된상태이므로 다음으로 진행한다.
|
||||
return false;
|
||||
}
|
||||
@@ -130,8 +130,7 @@ namespace Project
|
||||
//버퍼에들어갈때에는 가져다 놓을때도 가지러 갈때에도 리프트는 내려서 들어간다
|
||||
var liftCmd = arDev.Narumi.LiftCommand.DN;
|
||||
PUB.AGV.LiftControl(liftCmd);
|
||||
PUB.log.Add($"[{funcname}] 리프트를 내립니다");
|
||||
VAR.TIME.Update(eVarTime.LastTurnCommandTime);
|
||||
PUB.log.Add($"[{funcname}-{PUB.sm.RunStepSeq}] 리프트를 내립니다");
|
||||
PUB.sm.UpdateRunStepSeq();
|
||||
return false;
|
||||
}
|
||||
@@ -142,7 +141,7 @@ namespace Project
|
||||
{
|
||||
if (seqtime.TotalSeconds > 20)
|
||||
{
|
||||
PUB.log.AddAT($"[{funcname}] 리프트가 내려가지 않아 1회 재시도 합니다");
|
||||
PUB.log.AddAT($"[{funcname}-{PUB.sm.RunStepSeq}] 리프트가 내려가지 않아 1회 재시도 합니다");
|
||||
PUB.AGV.LiftControl(arDev.Narumi.LiftCommand.DN);
|
||||
//재시도를 했으니 다음으로 진행하게한다
|
||||
}
|
||||
@@ -162,11 +161,13 @@ namespace Project
|
||||
{
|
||||
if (seqtime.TotalSeconds > 20)
|
||||
{
|
||||
SetRunStepError(ENIGProtocol.AGVErrorCode.LIFT_ERROR, $"[{funcname}] 리프트가 내려가지 않습니다");
|
||||
SetRunStepError(ENIGProtocol.AGVErrorCode.LIFT_ERROR, $"[{funcname}-{PUB.sm.RunStepSeq}] 리프트가 내려가지 않습니다");
|
||||
}
|
||||
else PUB._mapCanvas.SetAlertMessage($"리프트 하강 확인 중({seqtime.TotalSeconds:N0}/20)");
|
||||
return false;
|
||||
}
|
||||
|
||||
PUB.log.Add($"[{funcname}-{PUB.sm.RunStepSeq}] 리프트 하강 완료");
|
||||
PUB.sm.UpdateRunStepSeq();
|
||||
return false;
|
||||
}
|
||||
@@ -179,7 +180,7 @@ namespace Project
|
||||
// 이미 목적지(Mark 2)에 도착한 것으로 간주하여 후진을 생략한다.
|
||||
if (PUB._virtualAGV.Turn == AGVNavigationCore.Models.AGVTurn.L90 && PUB.AGV.signal1.mark_sensor == true)
|
||||
{
|
||||
PUB.log.Add($"[{funcname}] 이미 목적지 도착 확인됨(Turn:L90, Sensor:ON). 후진 이동을 생략합니다.");
|
||||
PUB.log.Add($"[{funcname}-{PUB.sm.RunStepSeq}] 이미 목적지 도착 확인됨(Turn:L90, Sensor:ON). 후진 이동을 생략합니다.");
|
||||
PUB.sm.UpdateRunStepSeq();
|
||||
return false;
|
||||
}
|
||||
@@ -203,6 +204,7 @@ namespace Project
|
||||
}
|
||||
|
||||
//후진이동을한다
|
||||
PUB.log.Add($"[{funcname}-{PUB.sm.RunStepSeq}] 도킹을 위해 후진 이동 시작 (Dir:Backward, Spd:Low)");
|
||||
PUB._mapCanvas.SetAlertMessage($"도킹을 위해 후진 이동 시작");
|
||||
PUB.AGV.AGVMoveRun(arDev.Narumi.eRunOpt.Backward);
|
||||
PUB.sm.UpdateRunStepSeq();
|
||||
@@ -219,13 +221,20 @@ namespace Project
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
PUB.log.Add($"[{funcname}-{PUB.sm.RunStepSeq}] AGV 이동 확인 완료");
|
||||
PUB.sm.UpdateRunStepSeq();
|
||||
return false;
|
||||
}
|
||||
else if (PUB.sm.RunStepSeq == idx++)
|
||||
{
|
||||
//마크스탑으로 이동
|
||||
if (seqtime.TotalSeconds < 1.5) //일부시간을 기다려줘야한다.
|
||||
{
|
||||
return false;
|
||||
}
|
||||
PUB.AGV.AGVMoveStop(funcname, arDev.Narumi.eStopOpt.MarkStop);
|
||||
PUB.log.Add($"[{funcname}-{PUB.sm.RunStepSeq}] MarkStop 명령 전송 (도킹 위치 정렬)");
|
||||
PUB._mapCanvas.SetAlertMessage($"도킹을 위해 후진 이동 시작");
|
||||
PUB.sm.UpdateRunStepSeq();
|
||||
return false;
|
||||
@@ -241,6 +250,7 @@ namespace Project
|
||||
return false;
|
||||
}
|
||||
}
|
||||
PUB.log.Add($"[{funcname}-{PUB.sm.RunStepSeq}] MarkStop 신호 확인 완료");
|
||||
VAR.TIME.Update(eVarTime.LastTurnCommandTime);
|
||||
PUB.sm.UpdateRunStepSeq();
|
||||
return false;
|
||||
@@ -258,6 +268,24 @@ namespace Project
|
||||
}
|
||||
return false;
|
||||
}
|
||||
PUB.log.Add($"[{funcname}-{PUB.sm.RunStepSeq}] AGV멈춤확인");
|
||||
VAR.TIME.Update(eVarTime.LastTurnCommandTime);
|
||||
PUB.sm.UpdateRunStepSeq();
|
||||
return false;
|
||||
}
|
||||
else if (PUB.sm.RunStepSeq == idx++)
|
||||
{
|
||||
//마크센서확인
|
||||
if (PUB.AGV.signal1.mark_sensor == false)
|
||||
{
|
||||
if (seqtime.TotalSeconds > 3)
|
||||
{
|
||||
SetRunStepError(ENIGProtocol.AGVErrorCode.MARK_SENSOR_FAIL);
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
PUB.log.Add($"[{funcname}-{PUB.sm.RunStepSeq}] 마크센서 확인완료");
|
||||
VAR.TIME.Update(eVarTime.LastTurnCommandTime);
|
||||
PUB.sm.UpdateRunStepSeq();
|
||||
return false;
|
||||
@@ -265,21 +293,21 @@ namespace Project
|
||||
else if (PUB.sm.RunStepSeq == idx++)
|
||||
{
|
||||
if (seqtime.TotalSeconds < 2) return false;
|
||||
PUB.log.Add($"[{funcname}] 작업({PUB.NextWorkCmd}) 완료. 대기 상태로 전환 (퇴출 명령 대기)");
|
||||
PUB.log.Add($"[{funcname}-{PUB.sm.RunStepSeq}] 작업({PUB.NextWorkCmd}) 완료. 대기 상태로 전환 (퇴출 명령 대기)");
|
||||
PUB.sm.UpdateRunStepSeq();
|
||||
return false;
|
||||
}
|
||||
else if (PUB.sm.RunStepSeq == idx++)
|
||||
{
|
||||
//완료되었다.
|
||||
PUB.log.Add($"[{funcname}] 버퍼 진입 및 작업 완료");
|
||||
PUB.log.Add($"[{funcname}-{PUB.sm.RunStepSeq}] 버퍼 진입 완료");
|
||||
PUB.sm.UpdateRunStepSeq();
|
||||
return false;
|
||||
}
|
||||
|
||||
// 작업을 마치고 설비 안에 멈춰있는 상태.
|
||||
// ACS가 이 상태를 확인하고 NextWorkCmd로 퇴출(Out) 명령을 보내야 함.
|
||||
PUB.AddEEDB($"[{funcname}] 버퍼작업완료({PUB.Result.TargetPos})");
|
||||
//PUB.AddEEDB($"[{funcname}] 버퍼작업완료({PUB.Result.TargetPos})");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace Project
|
||||
{
|
||||
if (string.IsNullOrEmpty(errmsg))
|
||||
{
|
||||
errmsg = ENIGProtocol.AGVUtility.GetAGVErrorMessage(ecode);
|
||||
errmsg = ENIGProtocol.AGVUtility.GetAGVErrorMessage(ecode);
|
||||
}
|
||||
|
||||
PUB.AGV.AGVMoveStop(errmsg);
|
||||
@@ -214,7 +214,7 @@ namespace Project
|
||||
|
||||
//predict 를 이용하여 다음 이동을 모두 확인한다.
|
||||
var nextAction = PUB._virtualAGV.Predict();
|
||||
|
||||
|
||||
// [DEBUG] 예측 결과 로그 추가
|
||||
// 너무 빈번하게 찍히지 않도록 변화가 있을 때만 찍거나, 특정 조건에서 찍는 것이 좋으나
|
||||
// 디버깅 요청이므로 일단 주요 정보 출력
|
||||
@@ -232,23 +232,51 @@ namespace Project
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//모터에서 정지를 요청했다
|
||||
if (nextAction.Motor == AGVNavigationCore.Models.MotorCommand.Stop)
|
||||
{
|
||||
if (PUB.AGV.system1.agv_run)
|
||||
{
|
||||
|
||||
// 완료(Complete) 상태라면 MarkStop 전송
|
||||
if (nextAction.Reason == AGVNavigationCore.Models.eAGVCommandReason.MarkStop)
|
||||
{
|
||||
PUB.log.Add("다음행동예측에서 MARK STOP이 확인되었습니다 (자동정지시퀀스)");
|
||||
PUB.AGV.AGVMoveStop(nextAction.Message, arDev.Narumi.eStopOpt.MarkStop);
|
||||
if (PUB.AGV.data.Speed != 'S')
|
||||
{
|
||||
// [쿨타임 적용] 정지 명령은 별도의 타이머(LastStopCommandTime)를 사용하여
|
||||
// 이동 직후라도 즉시 반응할 수 있도록 한다. (이미 정지신호를 보냈다면 2초 대기)
|
||||
var tsCmd = VAR.TIME.RUN(eVarTime.LastStopCommandTime);
|
||||
if (tsCmd.TotalSeconds >= 2.0)
|
||||
{
|
||||
PUB.log.Add("다음행동예측에서 MARK STOP이 확인되었습니다 (자동정지시퀀스)");
|
||||
PUB.AGV.AGVMoveStop(nextAction.Message, arDev.Narumi.eStopOpt.MarkStop);
|
||||
|
||||
// 정지 타이머 갱신 (연속 정지 방지)
|
||||
VAR.TIME.Update(eVarTime.LastStopCommandTime);
|
||||
// 일반 타이머도 갱신 (정지 직후 불필요한 이동 방지)
|
||||
LastCommandTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PUB.log.Add($"다음행동예측에서 장비 멈춤이 확인되었습니다({nextAction.Reason})");
|
||||
PUB.AGV.AGVMoveStop(nextAction.Message);
|
||||
// [쿨타임 적용] 정지 명령은 별도의 타이머(LastStopCommandTime)를 사용하여
|
||||
// 이동 직후라도 즉시 반응할 수 있도록 한다. (이미 정지신호를 보냈다면 2초 대기)
|
||||
var tsCmd = VAR.TIME.RUN(eVarTime.LastStopCommandTime);
|
||||
if (tsCmd.TotalSeconds >= 2.0)
|
||||
{
|
||||
PUB.log.Add($"다음행동예측에서 장비 멈춤이 확인되었습니다({nextAction.Reason})");
|
||||
PUB.AGV.AGVMoveStop(nextAction.Message);
|
||||
// 정지 타이머 갱신 (연속 정지 방지)
|
||||
VAR.TIME.Update(eVarTime.LastStopCommandTime);
|
||||
|
||||
// 일반 타이머도 갱신 (정지 직후 불필요한 이동 방지)
|
||||
LastCommandTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 목적지 도착 여부 확인
|
||||
@@ -258,7 +286,7 @@ namespace Project
|
||||
if (PUB.AGV.system1.agv_run == false)
|
||||
{
|
||||
// 경로가 존재한다면...
|
||||
if (PUB._virtualAGV.CurrentPath != null && PUB._virtualAGV.CurrentPath.DetailedPath.Any())
|
||||
if (PUB._virtualAGV.CurrentPath != null && PUB._virtualAGV.CurrentPath.DetailedPath.Any())
|
||||
{
|
||||
var lastInfo = PUB._virtualAGV.CurrentPath.DetailedPath.Last();
|
||||
// 위치와 방향이 모두 일치해야 완료된 것으로 본다.
|
||||
@@ -278,8 +306,8 @@ namespace Project
|
||||
}
|
||||
else
|
||||
{
|
||||
// ...
|
||||
if (PUB._virtualAGV.CurrentNode.Id == PUB._virtualAGV.TargetNode.Id)
|
||||
// ...
|
||||
if (PUB._virtualAGV.CurrentNode.Id == PUB._virtualAGV.TargetNode.Id)
|
||||
{
|
||||
// ...
|
||||
PUB.log.AddI($"목표 도착 및 정지 확인됨(MarkStop 완료, No Path Info) Node:...");
|
||||
@@ -345,7 +373,7 @@ namespace Project
|
||||
PUB.log.Add($"Predict Run Setting = bunki:{bunki},dir:{dir},pbs:1,spd:{spd}");
|
||||
else
|
||||
PUB.log.AddE($"Predict Run Setting = bunki:{bunki},dir:{dir},pbs:1,spd:{spd}");
|
||||
|
||||
|
||||
LastCommandTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,12 +80,12 @@ namespace Project
|
||||
if (VAR.BOOL[eVarBool.AGV_ERROR] != (agv_err > 0))
|
||||
{
|
||||
VAR.BOOL[eVarBool.AGV_ERROR] = (agv_err > 0);
|
||||
PUB.logagv.Add($"new AGV_ERROR ({PUB.AGV.error.Value})");
|
||||
PUB.logagv.Add($"[_AGV] new AGV_ERROR ({PUB.AGV.error.Value})");
|
||||
}
|
||||
if (VAR.BOOL[eVarBool.EMERGENCY] != agv_emg)
|
||||
{
|
||||
VAR.BOOL[eVarBool.EMERGENCY] = agv_emg;
|
||||
PUB.logagv.Add($"new EMERGENCY ({VAR.BOOL[eVarBool.EMERGENCY]})");
|
||||
PUB.logagv.Add($"n[_AGV] ew EMERGENCY ({VAR.BOOL[eVarBool.EMERGENCY]})");
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace Project
|
||||
if (agv_chg)
|
||||
{
|
||||
VAR.TIME[eVarTime.ChargeStart] = DateTime.Now;
|
||||
PUB.logagv.Add($"충전시작:{VAR.TIME[eVarTime.ChargeStart]}");
|
||||
PUB.logagv.Add($"[_AGV] 충전시작:{VAR.TIME[eVarTime.ChargeStart]}");
|
||||
}
|
||||
_charging = agv_chg;
|
||||
}
|
||||
@@ -103,7 +103,7 @@ namespace Project
|
||||
//배터리충전상태
|
||||
if (VAR.BOOL[eVarBool.FLAG_CHARGEONA] != agv_chg)
|
||||
{
|
||||
PUB.log.Add($"충전상태전환 {agv_chg}");
|
||||
PUB.log.Add($"[_AGV] 충전상태전환 {agv_chg}");
|
||||
VAR.BOOL[eVarBool.FLAG_CHARGEONA] = agv_chg;
|
||||
}
|
||||
|
||||
@@ -130,26 +130,24 @@ namespace Project
|
||||
//마크센서 상태가 변경이 되었다면
|
||||
if (VAR.BOOL[eVarBool.MARK_SENSOR] != PUB.AGV.signal1.mark_sensor)
|
||||
{
|
||||
PUB.logagv.Add($"MARK_SENSOR 변경({PUB.AGV.signal1.mark_sensor})");
|
||||
PUB.logagv.Add($"[_AGV] MARK_SENSOR 변경({PUB.AGV.signal1.mark_sensor})");
|
||||
VAR.BOOL[eVarBool.MARK_SENSOR] = PUB.AGV.signal1.mark_sensor;
|
||||
|
||||
//AGV가 멈췄고 마크센서가 ON되었다면 마지막 RFID 위치가 확정된경우이다
|
||||
if (agv_stp && VAR.BOOL[eVarBool.MARK_SENSOR])
|
||||
{
|
||||
PUB.log.Add("마크스탑이 확인되어 최종위치를 PASS 처리 합니다");
|
||||
var curnode = PUB._virtualAGV.SetCurrentNodeMarkStop();
|
||||
if (curnode == true)
|
||||
{
|
||||
PUB.log.Add($"마크스탑으로 해당노드의 이동을 확정합니다");
|
||||
PUB.log.Add($"[_AGV] 마크스탑이 확인되어 현재위치({PUB._virtualAGV.CurrentNode.ID2})를 PASS 처리 합니다");
|
||||
}
|
||||
else PUB.log.AddAT($"마크스탑이 확인되었으나 현재 노드가없어 PASS를 설정하지 못함");
|
||||
}
|
||||
}
|
||||
if (VAR.BOOL[eVarBool.MARK_SENSOROFF] == VAR.BOOL[eVarBool.MARK_SENSOR])
|
||||
{
|
||||
VAR.BOOL[eVarBool.MARK_SENSOROFF] = !VAR.BOOL[eVarBool.MARK_SENSOR];
|
||||
VAR.TIME[eVarTime.MarkSensorOff] = DateTime.Now;
|
||||
PUB.log.Add($"MARK_SENSOROFF 변경({VAR.BOOL[eVarBool.MARK_SENSOROFF]})");
|
||||
PUB.log.Add($"[_AGV] MARK_SENSOROFF 변경({VAR.BOOL[eVarBool.MARK_SENSOROFF]})");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -159,11 +157,11 @@ namespace Project
|
||||
//자동 실행 중이다.
|
||||
|
||||
PUB.Result.LastTAG = PUB.AGV.data.TagNo;//.ToString("0000");
|
||||
PUB.log.Add($"AGV 태그수신 : {PUB.AGV.data.TagNo} LastTag:{PUB.Result.LastTAG}");
|
||||
PUB.log.Add($"[_AGV] AGV 태그수신 : {PUB.AGV.data.TagNo} LastTag:{PUB.Result.LastTAG}");
|
||||
//POT/NOT 보면 일단 바로 멈추게한다
|
||||
if (PUB.Result.CurrentPos == ePosition.POT || PUB.Result.CurrentPos == ePosition.NOT)
|
||||
{
|
||||
var logEMsg = $"Stop by [POT/NOT]";
|
||||
var logEMsg = $"[_AGV] Stop by [POT/NOT]";
|
||||
PUB.AGV.AGVMoveStop(logEMsg);
|
||||
PUB.log.AddE(logEMsg);
|
||||
}
|
||||
@@ -173,7 +171,7 @@ namespace Project
|
||||
if (CurrentNode == null)
|
||||
{
|
||||
//없는 노드는 자동으로 추가한다
|
||||
var newNodeId = $"AUTO_{PUB.Result.LastTAG}";
|
||||
var newNodeId = $"[_AGV] AUTO_{PUB.Result.LastTAG}";
|
||||
var newNode = new MapNode
|
||||
{
|
||||
Id = newNodeId,
|
||||
@@ -188,7 +186,7 @@ namespace Project
|
||||
PUB._mapCanvas.Nodes.Add(newNode);
|
||||
|
||||
// 로그 기록
|
||||
PUB.log.AddI($"RFID:{PUB.Result.LastTAG} 노드를 자동 추가했습니다 (NodeId: {newNodeId})");
|
||||
PUB.log.AddI($"[_AGV] RFID:{PUB.Result.LastTAG} 노드를 자동 추가했습니다 (NodeId: {newNodeId})");
|
||||
|
||||
// CurrentNode에 새로 생성한 노드 할당
|
||||
CurrentNode = newNode;
|
||||
@@ -208,10 +206,10 @@ namespace Project
|
||||
}
|
||||
break;
|
||||
case arDev.Narumi.DataType.ACK:
|
||||
PUB.logagv.Add($"AGV_[ACK]Receive : {PUB.AGV.ACKData}");
|
||||
PUB.logagv.Add($"[_AGV] AGV_[ACK]Receive : {PUB.AGV.ACKData}");
|
||||
break;
|
||||
default:
|
||||
PUB.logagv.Add($"AGV_DataReceive : {e.DataType}");
|
||||
PUB.logagv.Add($"[_AGV] AGV_DataReceive : {e.DataType}");
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -275,7 +273,7 @@ namespace Project
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"[AGV_DataReceive] {ex.Message}");
|
||||
Console.WriteLine($"[_AGV] [AGV_DataReceive] {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,52 @@ namespace Project
|
||||
PUB.sm.SetNewRunStep(nextStep);
|
||||
}
|
||||
break;
|
||||
case ENIGProtocol.AGVCommandHE.PickOnExit:
|
||||
case ENIGProtocol.AGVCommandHE.PickOffExit:
|
||||
{
|
||||
Resultclear();
|
||||
PUB.log.AddI($"XBEE:작업명령수신:{cmd}");
|
||||
|
||||
// 현재 위치 확인 (TargetNode가 아닌 CurrentNode 기준)
|
||||
var currNode = PUB._virtualAGV.CurrentNode;
|
||||
if (currNode == null)
|
||||
{
|
||||
PUB.log.AddE($"[{logPrefix}-{cmd}] 현재 노드를 알 수 없습니다");
|
||||
PUB.XBE.SendError(ENIGProtocol.AGVErrorCode.EmptyNode, "Unknown Current Node");
|
||||
return;
|
||||
}
|
||||
|
||||
var targetNode = PUB._virtualAGV.TargetNode;
|
||||
if (targetNode == null)
|
||||
{
|
||||
PUB.log.AddE($"[{logPrefix}-{cmd}] 목표 노드를 알 수 없습니다");
|
||||
PUB.XBE.SendError(ENIGProtocol.AGVErrorCode.EmptyNode, "Unknown Target Node");
|
||||
return;
|
||||
}
|
||||
|
||||
//버퍼의 경우 직전에 멈추기 때문에 스테이션종류를 보정해준다
|
||||
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_OUT; break;
|
||||
case StationType.UnLoader: nextStep = ERunStep.UNLOADER_OUT; break;
|
||||
case StationType.Buffer: nextStep = ERunStep.BUFFER_OUT; break;
|
||||
case StationType.Clearner: nextStep = ERunStep.CLEANER_OUT; break;
|
||||
default:
|
||||
PUB.log.AddE($"[{logPrefix}-{cmd}] 해당 노드타입({StationType})은 작업을 지원하지 않습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
//다음명령처리
|
||||
PUB.NextWorkCmd = cmd;
|
||||
PUB.log.AddI($"작업 시작: {nextStep} (Type: {cmd})");
|
||||
PUB.sm.SetNewRunStep(nextStep);
|
||||
}
|
||||
break;
|
||||
case ENIGProtocol.AGVCommandHE.Charger: // 112
|
||||
{
|
||||
Resultclear();
|
||||
|
||||
60
HMI/Project/ViewForm/fAgv.Designer.cs
generated
60
HMI/Project/ViewForm/fAgv.Designer.cs
generated
@@ -39,11 +39,11 @@
|
||||
this.rtData = new System.Windows.Forms.RichTextBox();
|
||||
this.timer1 = new System.Windows.Forms.Timer(this.components);
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.lbIP = new System.Windows.Forms.Label();
|
||||
this.button7 = new System.Windows.Forms.Button();
|
||||
this.button6 = new System.Windows.Forms.Button();
|
||||
this.button5 = new System.Windows.Forms.Button();
|
||||
this.button17 = new System.Windows.Forms.Button();
|
||||
this.lbIP = new System.Windows.Forms.Label();
|
||||
this.button3 = new System.Windows.Forms.Button();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
@@ -59,6 +59,7 @@
|
||||
this.button13 = new System.Windows.Forms.Button();
|
||||
this.button10 = new System.Windows.Forms.Button();
|
||||
this.button16 = new System.Windows.Forms.Button();
|
||||
this.button18 = new System.Windows.Forms.Button();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.panel1.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
@@ -185,6 +186,18 @@
|
||||
this.panel1.Size = new System.Drawing.Size(1050, 58);
|
||||
this.panel1.TabIndex = 7;
|
||||
//
|
||||
// lbIP
|
||||
//
|
||||
this.lbIP.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lbIP.Font = new System.Drawing.Font("Tahoma", 20F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.lbIP.ForeColor = System.Drawing.Color.White;
|
||||
this.lbIP.Location = new System.Drawing.Point(252, 0);
|
||||
this.lbIP.Name = "lbIP";
|
||||
this.lbIP.Size = new System.Drawing.Size(318, 58);
|
||||
this.lbIP.TabIndex = 8;
|
||||
this.lbIP.Text = "000.000.000.000";
|
||||
this.lbIP.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// button7
|
||||
//
|
||||
this.button7.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
@@ -229,18 +242,6 @@
|
||||
this.button17.UseVisualStyleBackColor = true;
|
||||
this.button17.Click += new System.EventHandler(this.button17_Click);
|
||||
//
|
||||
// lbIP
|
||||
//
|
||||
this.lbIP.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lbIP.Font = new System.Drawing.Font("Tahoma", 20F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.lbIP.ForeColor = System.Drawing.Color.White;
|
||||
this.lbIP.Location = new System.Drawing.Point(252, 0);
|
||||
this.lbIP.Name = "lbIP";
|
||||
this.lbIP.Size = new System.Drawing.Size(318, 58);
|
||||
this.lbIP.TabIndex = 8;
|
||||
this.lbIP.Text = "000.000.000.000";
|
||||
this.lbIP.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// button3
|
||||
//
|
||||
this.button3.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
@@ -299,9 +300,9 @@
|
||||
// button9
|
||||
//
|
||||
this.button9.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.button9.Location = new System.Drawing.Point(324, 0);
|
||||
this.button9.Location = new System.Drawing.Point(168, 0);
|
||||
this.button9.Name = "button9";
|
||||
this.button9.Size = new System.Drawing.Size(115, 58);
|
||||
this.button9.Size = new System.Drawing.Size(84, 58);
|
||||
this.button9.TabIndex = 9;
|
||||
this.button9.Text = "GDS Center Scope";
|
||||
this.button9.UseVisualStyleBackColor = true;
|
||||
@@ -310,6 +311,7 @@
|
||||
// panel2
|
||||
//
|
||||
this.panel2.Controls.Add(this.lbPortName);
|
||||
this.panel2.Controls.Add(this.button18);
|
||||
this.panel2.Controls.Add(this.button15);
|
||||
this.panel2.Controls.Add(this.button14);
|
||||
this.panel2.Controls.Add(this.button11);
|
||||
@@ -329,9 +331,9 @@
|
||||
this.lbPortName.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lbPortName.Font = new System.Drawing.Font("Tahoma", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.lbPortName.ForeColor = System.Drawing.Color.White;
|
||||
this.lbPortName.Location = new System.Drawing.Point(607, 0);
|
||||
this.lbPortName.Location = new System.Drawing.Point(504, 0);
|
||||
this.lbPortName.Name = "lbPortName";
|
||||
this.lbPortName.Size = new System.Drawing.Size(203, 58);
|
||||
this.lbPortName.Size = new System.Drawing.Size(306, 58);
|
||||
this.lbPortName.TabIndex = 15;
|
||||
this.lbPortName.Text = "--";
|
||||
this.lbPortName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
@@ -339,7 +341,7 @@
|
||||
// button15
|
||||
//
|
||||
this.button15.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.button15.Location = new System.Drawing.Point(523, 0);
|
||||
this.button15.Location = new System.Drawing.Point(336, 0);
|
||||
this.button15.Name = "button15";
|
||||
this.button15.Size = new System.Drawing.Size(84, 58);
|
||||
this.button15.TabIndex = 14;
|
||||
@@ -350,7 +352,7 @@
|
||||
// button14
|
||||
//
|
||||
this.button14.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.button14.Location = new System.Drawing.Point(439, 0);
|
||||
this.button14.Location = new System.Drawing.Point(252, 0);
|
||||
this.button14.Name = "button14";
|
||||
this.button14.Size = new System.Drawing.Size(84, 58);
|
||||
this.button14.TabIndex = 13;
|
||||
@@ -394,11 +396,11 @@
|
||||
// button10
|
||||
//
|
||||
this.button10.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.button10.Location = new System.Drawing.Point(162, 0);
|
||||
this.button10.Location = new System.Drawing.Point(84, 0);
|
||||
this.button10.Name = "button10";
|
||||
this.button10.Size = new System.Drawing.Size(162, 58);
|
||||
this.button10.Size = new System.Drawing.Size(84, 58);
|
||||
this.button10.TabIndex = 1;
|
||||
this.button10.Text = "GateOut Off Time";
|
||||
this.button10.Text = "GateOut\r\nOff Time";
|
||||
this.button10.UseVisualStyleBackColor = true;
|
||||
this.button10.Click += new System.EventHandler(this.button10_Click);
|
||||
//
|
||||
@@ -407,12 +409,23 @@
|
||||
this.button16.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.button16.Location = new System.Drawing.Point(0, 0);
|
||||
this.button16.Name = "button16";
|
||||
this.button16.Size = new System.Drawing.Size(162, 58);
|
||||
this.button16.Size = new System.Drawing.Size(84, 58);
|
||||
this.button16.TabIndex = 0;
|
||||
this.button16.Text = "백턴유지시간";
|
||||
this.button16.UseVisualStyleBackColor = true;
|
||||
this.button16.Click += new System.EventHandler(this.button16_Click);
|
||||
//
|
||||
// button18
|
||||
//
|
||||
this.button18.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.button18.Location = new System.Drawing.Point(420, 0);
|
||||
this.button18.Name = "button18";
|
||||
this.button18.Size = new System.Drawing.Size(84, 58);
|
||||
this.button18.TabIndex = 16;
|
||||
this.button18.Text = "Turn Reset";
|
||||
this.button18.UseVisualStyleBackColor = true;
|
||||
this.button18.Click += new System.EventHandler(this.button18_Click);
|
||||
//
|
||||
// fAgv
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
@@ -466,5 +479,6 @@
|
||||
private System.Windows.Forms.Button button17;
|
||||
private System.Windows.Forms.RichTextBox rtData;
|
||||
private System.Windows.Forms.RichTextBox rtSignal2;
|
||||
private System.Windows.Forms.Button button18;
|
||||
}
|
||||
}
|
||||
@@ -197,5 +197,13 @@ namespace Project.ViewForm
|
||||
{
|
||||
PUB.AGV.AGVMoveRun(arDev.Narumi.eRunOpt.Backward);
|
||||
}
|
||||
|
||||
private void button18_Click(object sender, EventArgs e)
|
||||
{
|
||||
//턴정보 hw sw 를 초기화한다.
|
||||
PUB.AGV.TurnInformation.State = arDev.eNarumiTurn.None;
|
||||
PUB._virtualAGV.Turn = AGVNavigationCore.Models.AGVTurn.None;
|
||||
PUB.log.AddAT($"[fAGV] 턴 정보를 초기화 합니다");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user