ai로그 추가
This commit is contained in:
@@ -40,6 +40,7 @@ namespace Project
|
||||
//스텝이 변경되었다면?
|
||||
if (PUB.sm.RunStep != PUB.sm.RunStepNew)
|
||||
{
|
||||
PUB.logdebug.Add($"[AI_TRACE] RunStep Transition: {PUB.sm.RunStep} -> {PUB.sm.RunStepNew}");
|
||||
runStepisFirst = true;
|
||||
PUB.sm.ApplyRunStep();
|
||||
}
|
||||
@@ -72,6 +73,7 @@ namespace Project
|
||||
var tsSpeak = DateTime.Now - LastSpeakTime;
|
||||
if (tsSpeak.TotalSeconds >= PUB.setting.alarmSoundTerm)
|
||||
{
|
||||
PUB.logdebug.Add($"[AI_TRACE] Blocking: stop_by_front_detect=true (LIDAR Obstacle)");
|
||||
PUB.Speak(Lang.전방에물체가감지되었습니다);
|
||||
LastSpeakTime = DateTime.Now;
|
||||
}
|
||||
@@ -84,6 +86,7 @@ namespace Project
|
||||
var tsSpeak = DateTime.Now - LastSpeakTime;
|
||||
if (tsSpeak.TotalSeconds >= PUB.setting.alarmSoundTerm)
|
||||
{
|
||||
PUB.logdebug.Add($"[AI_TRACE] Blocking: runerror_by_no_magent_line=true (Magnetic Line Lost)");
|
||||
PUB.Speak(Lang.선로를이탈했습니다);
|
||||
LastSpeakTime = DateTime.Now;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ namespace Project
|
||||
if ((DateTime.Now - _lastLidarOffTime_IN).TotalSeconds > 2)
|
||||
{
|
||||
PUB.log.Add($"[{funcname}] 버퍼 작업 중 라이다 강제 OFF 시도");
|
||||
PUB.logdebug.Add($"[AI_TRACE] {funcname} LIDAR/Dist Safety Override: Sensor={PUB.AGV.PBSSensor}, Dist={PUB.AGV.data.Distance}");
|
||||
PUB.AGV.AGVMoveSet(new arDev.Narumi.BunkiData
|
||||
{
|
||||
Bunki = arDev.Narumi.eBunki.Strate,
|
||||
@@ -45,6 +46,9 @@ namespace Project
|
||||
return false; // 라이다가 꺼질 때까지 진행 스톱 (명령이 적용될 때까지 대기)
|
||||
}
|
||||
|
||||
// [AI_TRACE] Log Step Progress
|
||||
PUB.logdebug.Add($"[AI_TRACE] {funcname} Step {PUB.sm.RunStepSeq} execution");
|
||||
|
||||
// [State Save] 현재 진행 단계를 저장한다
|
||||
SaveBufferStep(PUB._virtualAGV.CurrentNode, PUB.sm.RunStepSeq, PUB.NextWorkCmd);
|
||||
|
||||
@@ -453,6 +457,7 @@ namespace Project
|
||||
|
||||
// [State Clear] 작업 완료 시 저장된 상태를 지운다
|
||||
ClearBufferStep(PUB._virtualAGV.CurrentNode);
|
||||
PUB.logdebug.Add($"[AI_TRACE] {funcname} Completed Successfully.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace Project
|
||||
if ((DateTime.Now - _lastLidarOffTime_OUT).TotalSeconds > 2)
|
||||
{
|
||||
PUB.log.Add($"[{funcname}] 버퍼 작업 중 라이다 강제 OFF 시도");
|
||||
PUB.logdebug.Add($"[AI_TRACE] {funcname} LIDAR/Dist Safety Override: Sensor={PUB.AGV.PBSSensor}, Dist={PUB.AGV.data.Distance}");
|
||||
PUB.AGV.AGVMoveSet(new arDev.Narumi.BunkiData
|
||||
{
|
||||
Bunki = arDev.Narumi.eBunki.Strate,
|
||||
@@ -44,6 +45,9 @@ namespace Project
|
||||
return false; // 라이다가 꺼질 때까지 진행 스톱 (명령이 적용될 때까지 대기)
|
||||
}
|
||||
|
||||
// [AI_TRACE] Log Step Progress
|
||||
PUB.logdebug.Add($"[AI_TRACE] {funcname} Step {PUB.sm.RunStepSeq} execution");
|
||||
|
||||
// [State Save] 현재 진행 단계를 저장한다
|
||||
SaveBufferStep(PUB._virtualAGV.CurrentNode, PUB.sm.RunStepSeq, PUB.NextWorkCmd);
|
||||
|
||||
@@ -127,6 +131,7 @@ namespace Project
|
||||
if (PUB.AGV.signal1.mark_sensor == true && PUB._virtualAGV.Turn == AGVNavigationCore.Models.AGVTurn.L90)
|
||||
{
|
||||
PUB.log.Add($"[{funcname}-{PUB.sm.RunStepSeq}] 이미 마크센서 감지됨. 전진 이동을 생략합니다.");
|
||||
PUB.logdebug.Add($"[AI_TRACE] {funcname} Smart Restart Skip Movement: MarkSensor=true, Turn=L90");
|
||||
PUB.sm.SetStepSeq((byte)(idx + 4)); // Turn 스텝으로 직행 (현재 idx부터 4단계 뒤)
|
||||
return false;
|
||||
}
|
||||
@@ -261,6 +266,7 @@ namespace Project
|
||||
if (PUB.AGV.signal1.mark_sensor == false && seqtime.TotalSeconds < 1.0)
|
||||
{
|
||||
PUB.log.Add($"[{funcname}-{PUB.sm.RunStepSeq}] 재시작 감지됨. 하지만 목적지(마크) 도착 불확실. 이동을 재시도합니다.");
|
||||
PUB.logdebug.Add($"[AI_TRACE] {funcname} Resume Safety Check Failed (Mark OFF at Stop Step). Rolling back to Step 6.");
|
||||
PUB.sm.SetStepSeq(6); // Speed Set 스텝(이동 시작 단계)으로 복귀
|
||||
return false;
|
||||
}
|
||||
@@ -486,6 +492,7 @@ namespace Project
|
||||
|
||||
// [State Clear] 작업 완료 시 저장된 상태를 지운다
|
||||
ClearBufferStep(PUB._virtualAGV.CurrentNode);
|
||||
PUB.logdebug.Add($"[AI_TRACE] {funcname} Completed Successfully.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,6 +87,7 @@ namespace Project
|
||||
{
|
||||
//충전시작 명령을 전송한다
|
||||
PUB.log.Add($"충전:충전명령전송");
|
||||
PUB.logdebug.Add($"[AI_TRACE] {funcname} Step {PUB.sm.RunStepSeq}: Sending Charge Start Command to ChargerID={PUB.setting.ChargerID}");
|
||||
PUB.Speak(Lang.충전시작명령을전송합니다);
|
||||
PUB.AGV.AGVCharge(PUB.setting.ChargerID, true);
|
||||
VAR.BOOL[eVarBool.WAIT_CHARGEACK] = true;
|
||||
@@ -102,6 +103,7 @@ namespace Project
|
||||
if (PUB.AGV.ACKData.Equals("CBT"))
|
||||
{
|
||||
PUB.log.Add($"충전명령 회신 확인");
|
||||
PUB.logdebug.Add($"[AI_TRACE] {funcname} Step {PUB.sm.RunStepSeq}: Charge Command ACK Received (CBT)");
|
||||
PUB.sm.UpdateRunStepSeq();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -85,10 +85,12 @@ namespace Project
|
||||
if (PUB._virtualAGV.TargetNode == null)
|
||||
{
|
||||
PUB.log.Add($"대상노드가 없어 이동을할 수 없습니다");
|
||||
PUB.logdebug.Add($"[AI_TRACE] {funcname} REJECTED: TargetNode is NULL");
|
||||
PUB.sm.SetNewRunStep(ERunStep.READY);
|
||||
return false;
|
||||
}
|
||||
PUB.log.Add($"[GOTO] Step {idx - 1}: TargetNode Checked ({PUB._virtualAGV.TargetNode.ID2})");
|
||||
PUB.logdebug.Add($"[AI_TRACE] {funcname} TargetNode Confirmed: {PUB._virtualAGV.TargetNode.ID2} (RFID: {PUB._virtualAGV.TargetNode.RfidId})");
|
||||
PUB.sm.UpdateRunStepSeq();
|
||||
return false;
|
||||
}
|
||||
@@ -112,6 +114,7 @@ namespace Project
|
||||
|
||||
//ㅇ목적지 완료신호를 ACS에전송한다.
|
||||
PUB.XBE.SendMoveComplete(PUB._virtualAGV.TargetNode.RfidId.ToString("0000"));
|
||||
PUB.logdebug.Add($"[AI_TRACE] {funcname} Navigation Complete. ACS Notified. Node={PUB._virtualAGV.TargetNode.ID2}");
|
||||
PUB.sm.UpdateRunStepSeq();
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user