"refactor:Improve-map-loading-and-use-canvas-nodes"

This commit is contained in:
2025-12-14 22:55:09 +09:00
parent 764fbbd204
commit 3c8eae889c
13 changed files with 218 additions and 199 deletions

View File

@@ -23,7 +23,7 @@ namespace AGVNavigationCore.Controls
private const int NODE_SIZE = 24;
private const int NODE_RADIUS = NODE_SIZE / 2;
private const int GRID_SIZE = 20;
private const float CONNECTION_WIDTH = 2.0f;
private const float CONNECTION_WIDTH = 1.0f;
private const int SNAP_DISTANCE = 10;
private const int AGV_SIZE = 40;
private const int CONNECTION_ARROW_SIZE = 8;
@@ -355,6 +355,28 @@ namespace AGVNavigationCore.Controls
}
}
/// <summary>
/// Map file loading 결과를 셋팅합니다
/// </summary>
/// <param name="result"></param>
public void SetMapLoadResult(MapLoader.MapLoadResult result)
{
this.Nodes = result.Nodes;
this.Labels = result.Labels; // 추가
this.Images = result.Images; // 추가
this.Marks = result.Marks;
this.Magnets = result.Magnets;
// 🔥 맵 설정 적용 (배경색, 그리드 표시)
if (result.Settings != null)
{
this.BackColor = Color.FromArgb(result.Settings.BackgroundColorArgb);
this.ShowGrid = result.Settings.ShowGrid;
}
this.FitToNodes();
}
/// <summary>
/// 노드 목록
/// </summary>
@@ -598,7 +620,7 @@ namespace AGVNavigationCore.Controls
_gridBrush = new SolidBrush(Color.LightGray);
// 펜
_connectionPen = new Pen(Color.DarkBlue, CONNECTION_WIDTH);
_connectionPen = new Pen(Color.White, CONNECTION_WIDTH);
_connectionPen.DashStyle = DashStyle.Dash;
_connectionPen.EndCap = LineCap.ArrowAnchor;