시뮬레이터에서 맵 로드시에 맵에 배경색이 있다면 적용 하게 함
Xbee Open 시에 return값 변경 return true -> return isopen LogFlushAll 함수추가 (_step_close 에서 사용)
This commit is contained in:
@@ -110,7 +110,7 @@ namespace AGVMapEditor.Forms
|
||||
|
||||
// 이벤트 연결
|
||||
_mapCanvas.NodeAdded += OnNodeAdded;
|
||||
_mapCanvas.NodeSelected += OnNodeSelected;
|
||||
//_mapCanvas.NodeSelected += OnNodeSelected;
|
||||
_mapCanvas.NodesSelected += OnNodesSelected; // 다중 선택 이벤트
|
||||
_mapCanvas.NodeMoved += OnNodeMoved;
|
||||
_mapCanvas.NodeDeleted += OnNodeDeleted;
|
||||
@@ -182,22 +182,22 @@ namespace AGVMapEditor.Forms
|
||||
// RFID 자동 할당
|
||||
}
|
||||
|
||||
private void OnNodeSelected(object sender, MapNode node)
|
||||
{
|
||||
_selectedNode = node;
|
||||
//private void OnNodeSelected(object sender, MapNode node)
|
||||
//{
|
||||
// _selectedNode = node;
|
||||
|
||||
if (node == null)
|
||||
{
|
||||
// 빈 공간 클릭 시 캔버스 속성 표시
|
||||
ShowCanvasProperties();
|
||||
}
|
||||
else
|
||||
{
|
||||
// 노드 클릭 시 노드 속성 표시
|
||||
UpdateNodeProperties();
|
||||
UpdateImageEditButton(); // 이미지 노드 선택 시 이미지 편집 버튼 활성화
|
||||
}
|
||||
}
|
||||
// if (node == null)
|
||||
// {
|
||||
// // 빈 공간 클릭 시 캔버스 속성 표시
|
||||
// ShowCanvasProperties();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // 노드 클릭 시 노드 속성 표시
|
||||
// UpdateNodeProperties();
|
||||
// UpdateImageEditButton(); // 이미지 노드 선택 시 이미지 편집 버튼 활성화
|
||||
// }
|
||||
//}
|
||||
|
||||
private void OnNodesSelected(object sender, List<MapNode> nodes)
|
||||
{
|
||||
|
||||
@@ -1468,6 +1468,7 @@ namespace AGVNavigationCore.Controls
|
||||
const int liftWidth = 16; // 리프트 너비 (더욱 크게)
|
||||
const int liftDistance = AGV_SIZE / 2 + 2; // AGV 본체 면에 바로 붙도록
|
||||
|
||||
|
||||
var currentPos = agv.CurrentPosition;
|
||||
var targetPos = agv.PrevPosition;
|
||||
var dockingDirection = agv.DockingDirection;
|
||||
|
||||
@@ -146,7 +146,6 @@ namespace AGVNavigationCore.Controls
|
||||
|
||||
// 맵 편집 이벤트
|
||||
public event EventHandler<MapNode> NodeAdded;
|
||||
public event EventHandler<MapNode> NodeSelected;
|
||||
public event EventHandler<List<MapNode>> NodesSelected; // 다중 선택 이벤트
|
||||
public event EventHandler<MapNode> NodeDeleted;
|
||||
public event EventHandler<MapNode> NodeMoved;
|
||||
|
||||
@@ -118,6 +118,8 @@ namespace AGVSimulator.Forms
|
||||
this._liftDirectionLabel = new System.Windows.Forms.Label();
|
||||
this._motorDirectionLabel = new System.Windows.Forms.Label();
|
||||
this.timer1 = new System.Windows.Forms.Timer(this.components);
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.propertyNode = new System.Windows.Forms.PropertyGrid();
|
||||
this._menuStrip.SuspendLayout();
|
||||
this._toolStrip.SuspendLayout();
|
||||
this._statusStrip.SuspendLayout();
|
||||
@@ -127,6 +129,7 @@ namespace AGVSimulator.Forms
|
||||
this._agvControlGroup.SuspendLayout();
|
||||
this._canvasPanel.SuspendLayout();
|
||||
this._agvInfoPanel.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// _menuStrip
|
||||
@@ -455,6 +458,7 @@ namespace AGVSimulator.Forms
|
||||
// _controlPanel
|
||||
//
|
||||
this._controlPanel.BackColor = System.Drawing.SystemColors.Control;
|
||||
this._controlPanel.Controls.Add(this.groupBox1);
|
||||
this._controlPanel.Controls.Add(this._statusGroup);
|
||||
this._controlPanel.Controls.Add(this._pathGroup);
|
||||
this._controlPanel.Controls.Add(this._agvControlGroup);
|
||||
@@ -789,6 +793,25 @@ namespace AGVSimulator.Forms
|
||||
this.timer1.Interval = 500;
|
||||
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.propertyNode);
|
||||
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.groupBox1.Location = new System.Drawing.Point(0, 546);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(233, 94);
|
||||
this.groupBox1.TabIndex = 4;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "노드 정보";
|
||||
//
|
||||
// propertyNode
|
||||
//
|
||||
this.propertyNode.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.propertyNode.Location = new System.Drawing.Point(3, 17);
|
||||
this.propertyNode.Name = "propertyNode";
|
||||
this.propertyNode.Size = new System.Drawing.Size(227, 74);
|
||||
this.propertyNode.TabIndex = 0;
|
||||
//
|
||||
// SimulatorForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
|
||||
@@ -821,6 +844,7 @@ namespace AGVSimulator.Forms
|
||||
this._canvasPanel.ResumeLayout(false);
|
||||
this._agvInfoPanel.ResumeLayout(false);
|
||||
this._agvInfoPanel.PerformLayout();
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
@@ -899,5 +923,7 @@ namespace AGVSimulator.Forms
|
||||
private System.Windows.Forms.ToolStripButton btMakeMap;
|
||||
private System.Windows.Forms.ToolStripMenuItem 맵저장SToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem 맵다른이름으로저장ToolStripMenuItem;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.PropertyGrid propertyNode;
|
||||
}
|
||||
}
|
||||
@@ -104,7 +104,7 @@ namespace AGVSimulator.Forms
|
||||
_simulatorCanvas.Dock = DockStyle.Fill;
|
||||
|
||||
// 목적지 선택 이벤트 구독
|
||||
_simulatorCanvas.NodeSelected += OnTargetNodeSelected;
|
||||
_simulatorCanvas.NodesSelected += OnTargetNodeSelected;
|
||||
|
||||
_canvasPanel.Controls.Add(_simulatorCanvas);
|
||||
}
|
||||
@@ -394,10 +394,13 @@ namespace AGVSimulator.Forms
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTargetNodeSelected(object sender, MapNode selectedNode)
|
||||
private void OnTargetNodeSelected(object sender, List<MapNode> selectedNodes)
|
||||
{
|
||||
try
|
||||
{
|
||||
// PropertyGrid 업데이트 (항상 수행)
|
||||
propertyNode.SelectedObject = selectedNodes.FirstOrDefault();
|
||||
|
||||
// 타겟계산 모드에서만 처리
|
||||
if (_isTargetCalcMode)
|
||||
{
|
||||
@@ -406,6 +409,7 @@ namespace AGVSimulator.Forms
|
||||
//_targetCalcButton.Text = "타겟계산";
|
||||
//_targetCalcButton.BackColor = SystemColors.Control;
|
||||
//_simulatorCanvas.CurrentEditMode = UnifiedAGVCanvas.EditMode.Select;
|
||||
var selectedNode = selectedNodes.FirstOrDefault();
|
||||
if (selectedNode == null) return;
|
||||
|
||||
// 목적지를 선택된 노드로 설정
|
||||
@@ -865,6 +869,13 @@ namespace AGVSimulator.Forms
|
||||
// 시뮬레이터 캔버스에 맵 설정
|
||||
_simulatorCanvas.Nodes = _mapNodes;
|
||||
|
||||
// 맵 설정 적용 (배경색, 그리드 표시)
|
||||
if (result.Settings != null)
|
||||
{
|
||||
_simulatorCanvas.BackColor = System.Drawing.Color.FromArgb(result.Settings.BackgroundColorArgb);
|
||||
_simulatorCanvas.ShowGrid = result.Settings.ShowGrid;
|
||||
}
|
||||
|
||||
// 설정에 마지막 맵 파일 경로 저장
|
||||
_config.LastMapFilePath = filePath;
|
||||
if (_config.AutoSave)
|
||||
@@ -1876,6 +1887,7 @@ namespace AGVSimulator.Forms
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 맵 데이터를 파일에 저장 (MapLoader 공통 저장 로직 사용)
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user