This commit is contained in:
backuppc
2025-12-12 17:27:50 +09:00
parent 07ddc0425f
commit 4e9d29d22f
44 changed files with 7173 additions and 61 deletions

View File

@@ -1775,6 +1775,11 @@ namespace AGVNavigationCore.Controls
/// </summary>
private Color GetAGVCenterColor(AGVState state)
{
// Stop-Mark 상태 (Error 상태와 유사하게 처리하거나 별도 처리)
// 여기서는 AGVState에 StopMark가 없으므로, 외부에서 상태를 Error로 설정하거나
// 별도의 플래그를 확인해야 함. 하지만 IAGV 인터페이스에는 플래그가 없음.
// 따라서 fMain에서 상태를 Error로 설정하는 것을 권장.
switch (state)
{
case AGVState.Moving: return Color.White;
@@ -1794,7 +1799,7 @@ namespace AGVNavigationCore.Controls
{
case AGVState.Moving: return Color.DarkGreen;
case AGVState.Charging: return Color.DarkBlue;
case AGVState.Error: return Color.DarkRed;
case AGVState.Error: return Color.DarkRed; // Stop-Mark 시 Error 상태 사용
case AGVState.Docking: return Color.DarkOrange;
default: return Color.DarkGray;
}

View File

@@ -17,6 +17,16 @@ namespace AGVNavigationCore.Controls
var worldPoint = ScreenToWorld(e.Location);
var hitNode = GetNodeAt(worldPoint);
// 에뮬레이터 모드 처리
if (_canvasMode == CanvasMode.Emulator)
{
if (e.Button == MouseButtons.Right && hitNode != null)
{
NodeRightClicked?.Invoke(this, hitNode);
}
return;
}
// 🔥 어떤 모드에서든 노드/빈 공간 클릭 시 선택 이벤트 발생 (속성창 업데이트)
bool ctrlPressed = (ModifierKeys & Keys.Control) == Keys.Control;

View File

@@ -36,7 +36,8 @@ namespace AGVNavigationCore.Controls
public enum CanvasMode
{
Edit, // 편집 가능 (맵 에디터)
Sync // 동기화 모드 (장비 설정 동기화)
Sync, // 동기화 모드 (장비 설정 동기화)
Emulator // 에뮬레이터 모드
}
/// <summary>
@@ -146,6 +147,9 @@ namespace AGVNavigationCore.Controls
// 컨텍스트 메뉴
private ContextMenuStrip _contextMenu;
// 이벤트
public event EventHandler<MapNode> NodeRightClicked;
#endregion
#region Events

View File

@@ -81,6 +81,13 @@ namespace AGVNavigationCore.Models
private List<string> _detectedRfids = new List<string>(); // 감지된 RFID 목록
private bool _isPositionConfirmed = false; // 위치 확정 여부 (RFID 2개 이상 감지)
// 에뮬레이터용 추가 속성
public double Angle { get; set; } = 0; // 0 = Right, 90 = Down, 180 = Left, 270 = Up (Standard Math)
// But AGV Direction: Forward usually means "Front of AGV".
// Let's assume Angle is the orientation of the AGV in degrees.
public bool IsStopMarkOn { get; set; } = false;
#endregion
#region Properties
@@ -433,6 +440,27 @@ namespace AGVNavigationCore.Models
OnError("긴급 정지가 실행되었습니다.");
}
/// <summary>
/// 일시 정지 (경로 유지)
/// </summary>
public void Pause()
{
_isMoving = false;
_currentSpeed = 0;
}
/// <summary>
/// 이동 재개
/// </summary>
public void Resume()
{
if (_currentPath != null && _remainingNodes != null && _remainingNodes.Count > 0)
{
_isMoving = true;
SetState(AGVState.Moving);
}
}
#endregion
#region Public Methods - ( )