This commit is contained in:
backuppc
2025-12-22 16:02:57 +09:00
parent 5a4c73e4df
commit 3408e3fc30
8 changed files with 123 additions and 8 deletions

View File

@@ -815,6 +815,9 @@ namespace AGVNavigationCore.Controls
case StationType.Charger:
DrawTriangleNodeShape(g, node, brush);
break;
case StationType.Limit:
DrawRectangleNodeShape(g, node, brush);
break;
default:
DrawCircleNodeShape(g, node, brush);
break;
@@ -823,6 +826,83 @@ namespace AGVNavigationCore.Controls
}
private void DrawRectangleNodeShape(Graphics g, MapNode node, Brush brush)
{
// 드래그 중인 노드는 약간 크게 그리기
bool isDraggingThisNode = _isDragging && node == _selectedNode;
int sizeAdjustment = isDraggingThisNode ? 4 : 0;
var rect = new Rectangle(
node.Position.X - NODE_RADIUS - sizeAdjustment,
node.Position.Y - NODE_RADIUS - sizeAdjustment,
NODE_SIZE + sizeAdjustment * 2,
NODE_SIZE + sizeAdjustment * 2
);
// 드래그 중인 노드의 그림자 효과
if (isDraggingThisNode)
{
var shadowRect = new Rectangle(rect.X + 3, rect.Y + 3, rect.Width, rect.Height);
using (var shadowBrush = new SolidBrush(Color.FromArgb(100, 0, 0, 0)))
{
g.FillRectangle(shadowBrush, shadowRect);
}
}
// 노드 그리기
g.FillRectangle(brush, rect);
g.DrawRectangle(Pens.Black, rect);
// 드래그 중인 노드 강조 (가장 강력한 효과)
if (isDraggingThisNode)
{
// 청록색 두꺼운 테두리
g.DrawRectangle(new Pen(Color.Cyan, 3), rect);
// 펄스 효과
var pulseRect = new Rectangle(rect.X - 4, rect.Y - 4, rect.Width + 8, rect.Height + 8);
g.DrawRectangle(new Pen(Color.FromArgb(150, 0, 255, 255), 2) { DashStyle = DashStyle.Dash }, pulseRect);
}
// 선택된 노드 강조 (단일 또는 다중)
else if (node == _selectedNode || (_selectedNodes != null && _selectedNodes.Contains(node)))
{
g.DrawRectangle(_selectedNodePen, rect);
}
// 목적지 노드 강조
if (node == _destinationNode)
{
// 금색 테두리로 목적지 강조
g.DrawRectangle(_destinationNodePen, rect);
// 펄싱 효과를 위한 추가 원 그리기
var pulseRect = new Rectangle(rect.X - 3, rect.Y - 3, rect.Width + 6, rect.Height + 6);
g.DrawRectangle(new Pen(Color.Gold, 2) { DashStyle = DashStyle.Dash }, pulseRect);
}
// 호버된 노드 강조 (드래그 중이 아닐 때만)
if (node == _hoveredNode && !isDraggingThisNode)
{
var hoverRect = new Rectangle(rect.X - 2, rect.Y - 2, rect.Width + 4, rect.Height + 4);
g.DrawRectangle(new Pen(Color.Orange, 2), hoverRect);
}
// RFID 중복 노드 표시 (빨간 X자)
if (_duplicateRfidNodes.Contains(node.Id))
{
DrawDuplicateRfidMarker(g, node);
}
// CanCross 가능 노드 표시 (교차지점으로 사용 가능)
if (node.DisableCross == true)
{
var crossRect = new Rectangle(rect.X - 3, rect.Y - 3, rect.Width + 6, rect.Height + 6);
g.DrawRectangle(new Pen(Color.DeepSkyBlue, 3), crossRect);
}
g.DrawLine(Pens.Black, rect.X, rect.Y, rect.Right, rect.Bottom);
g.DrawLine(Pens.Black, rect.Right, rect.Top, rect.X, rect.Bottom);
}
private void DrawCircleNodeShape(Graphics g, MapNode node, Brush brush)
{
// 드래그 중인 노드는 약간 크게 그리기
@@ -1472,9 +1552,10 @@ namespace AGVNavigationCore.Controls
case StationType.Normal: bgColor = Color.DeepSkyBlue; break;
case StationType.Charger: bgColor = Color.Tomato; break;
case StationType.Loader:
case StationType.UnLoader: bgColor = Color.Gold ; break;
case StationType.Clearner: bgColor = Color.DeepSkyBlue ; break;
case StationType.UnLoader: bgColor = Color.Gold; break;
case StationType.Clearner: bgColor = Color.DeepSkyBlue; break;
case StationType.Buffer: bgColor = Color.WhiteSmoke; break;
case StationType.Limit: bgColor = Color.Red; break;
default: bgColor = Color.White; break;
}

View File

@@ -73,7 +73,13 @@ namespace AGVNavigationCore.Models
/// <summary>버퍼</summary>
Buffer,
/// <summary>충전기</summary>
Charger
Charger,
/// <summary>
/// 끝점(더이상 이동불가)
/// </summary>
Limit,
}
/// <summary>

View File

@@ -149,7 +149,7 @@ namespace AGVNavigationCore.Models
public override string ToString()
{
return $"{RfidId}({Id}): {AliasName} ({Type}) at ({Position.X}, {Position.Y})";
return $"RFID:{RfidId}(NODE:{Id}): AS:{AliasName} ({Type}) at ({Position.X}, {Position.Y})";
}
public bool IsNavigationNode()

View File

@@ -464,6 +464,8 @@ namespace AGVNavigationCore.PathFinding.Planning
{
nodeInfo.Speed = mapNode.SpeedLimit;
}
detailedPath1.Add(nodeInfo);
}
// path1에 상세 경로 정보 설정

View File

@@ -108,7 +108,7 @@ namespace AGVNavigationCore.PathFinding.Planning
/// </summary>
public override string ToString()
{
var result = $"{RfidId}[{NodeId}]:{MotorDirection}";
var result = $"R{RfidId}[N{NodeId}]:{MotorDirection}";
// 마그넷 방향이 직진이 아닌 경우 표시
if (MagnetDirection != MagnetDirection.Straight)