..
This commit is contained in:
@@ -20,7 +20,7 @@ namespace AGVNavigationCore.Controls
|
||||
{
|
||||
#region Constants
|
||||
|
||||
private const int NODE_SIZE = 24;
|
||||
private const int NODE_SIZE = 18;
|
||||
private const int NODE_RADIUS = NODE_SIZE / 2;
|
||||
private const int GRID_SIZE = 20;
|
||||
private const float CONNECTION_WIDTH = 1.0f;
|
||||
@@ -56,6 +56,7 @@ namespace AGVNavigationCore.Controls
|
||||
DeleteConnection, // 연결 삭제 모드
|
||||
AddLabel, // 라벨 추가 모드
|
||||
AddImage, // 이미지 추가 모드
|
||||
ConnectDirection, // 방향 연결 모드
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -139,7 +140,7 @@ namespace AGVNavigationCore.Controls
|
||||
|
||||
string _alertmesage = "";
|
||||
bool showalert = false;
|
||||
|
||||
|
||||
// 깜박임 효과를 위한 타이머 및 상태
|
||||
private Timer _alertBlinkTimer;
|
||||
private bool _isAlertBlinkOn = true;
|
||||
@@ -176,7 +177,7 @@ namespace AGVNavigationCore.Controls
|
||||
//_isAlertBlinkOn = !_isAlertBlinkOn;
|
||||
//Invalidate();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 브러쉬 및 펜
|
||||
private Brush _normalNodeBrush;
|
||||
@@ -220,6 +221,7 @@ namespace AGVNavigationCore.Controls
|
||||
public event EventHandler<List<NodeBase>> NodesSelected; // 다중 선택 이벤트
|
||||
public event EventHandler<NodeBase> NodeDeleted;
|
||||
public event EventHandler<NodeBase> NodeMoved;
|
||||
public event EventHandler<(MapNode From, MapNode To)> ConnectionCreated; // 연결 생성 이벤트 추가
|
||||
public event EventHandler<(MapNode From, MapNode To)> ConnectionDeleted;
|
||||
public event EventHandler<MapImage> ImageDoubleClicked;
|
||||
public event EventHandler<MapLabel> LabelDoubleClicked;
|
||||
@@ -266,6 +268,18 @@ namespace AGVNavigationCore.Controls
|
||||
{
|
||||
if (_nodes != null && _nodes.Contains(node))
|
||||
{
|
||||
// 🔥 삭제되는 노드와 연결된 다른 노드들의 연결 정보도 삭제
|
||||
foreach (var otherNode in _nodes.ToList()) // ToList()로 복사본 순회 (안전장치)
|
||||
{
|
||||
if (otherNode == node) continue;
|
||||
|
||||
// 다른 노드 -> 삭제되는 노드 연결 제거
|
||||
if (otherNode.ConnectedNodes.Contains(node.Id))
|
||||
{
|
||||
otherNode.RemoveConnection(node.Id);
|
||||
}
|
||||
}
|
||||
|
||||
_nodes.Remove(node);
|
||||
Invalidate();
|
||||
}
|
||||
@@ -336,10 +350,10 @@ namespace AGVNavigationCore.Controls
|
||||
{
|
||||
// Zoom 값 범위 제한
|
||||
float newZoom = Math.Max(0.1f, Math.Min(5.0f, zoom));
|
||||
|
||||
|
||||
_panOffset = new PointF(panX, panY);
|
||||
_zoomFactor = newZoom;
|
||||
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
@@ -408,12 +422,12 @@ namespace AGVNavigationCore.Controls
|
||||
/// <summary>
|
||||
/// 선택된 노드 (단일)
|
||||
/// </summary>
|
||||
public MapNode SelectedNode
|
||||
public NodeBase SelectedNode
|
||||
{
|
||||
get { return this._selectedNode as MapNode; }
|
||||
set
|
||||
{
|
||||
_selectedNode = value;
|
||||
get { return this._selectedNode; }
|
||||
set
|
||||
{
|
||||
_selectedNode = value;
|
||||
if (value != null)
|
||||
{
|
||||
_selectedNodes.Clear();
|
||||
@@ -423,7 +437,7 @@ namespace AGVNavigationCore.Controls
|
||||
{
|
||||
_selectedNodes.Clear();
|
||||
}
|
||||
Invalidate();
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -746,8 +760,8 @@ namespace AGVNavigationCore.Controls
|
||||
_destinationNodePen = new Pen(Color.Orange, 4);
|
||||
_pathPen = new Pen(Color.Purple, 3);
|
||||
_agvPen = new Pen(Color.Red, 3);
|
||||
_highlightedConnectionPen = new Pen(Color.Red, 4) { DashStyle = DashStyle.Solid };
|
||||
_magnetPen = new Pen(Color.FromArgb(100, Color.LightSkyBlue), 15) { DashStyle = DashStyle.Solid };
|
||||
_highlightedConnectionPen = new Pen(Color.Red, 6) { DashStyle = DashStyle.Solid };
|
||||
_magnetPen = new Pen(Color.FromArgb(100, Color.LightSkyBlue), 15) { DashStyle = DashStyle.Solid, StartCap = LineCap.Round, EndCap = LineCap.Round };
|
||||
_markPen = new Pen(Color.White, 3); // 마크는 흰색 선으로 표시
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user