..
This commit is contained in:
@@ -120,6 +120,7 @@ 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.btSelectMapEditor = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this._menuStrip.SuspendLayout();
|
||||
this._toolStrip.SuspendLayout();
|
||||
this._statusStrip.SuspendLayout();
|
||||
@@ -154,6 +155,7 @@ namespace AGVSimulator.Forms
|
||||
this.맵다른이름으로저장ToolStripMenuItem,
|
||||
this.toolStripSeparator1,
|
||||
this.launchMapEditorToolStripMenuItem,
|
||||
this.btSelectMapEditor,
|
||||
this.toolStripSeparator4,
|
||||
this.exitToolStripMenuItem});
|
||||
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
||||
@@ -547,7 +549,7 @@ namespace AGVSimulator.Forms
|
||||
//
|
||||
// btPath2
|
||||
//
|
||||
this.btPath2.Location = new System.Drawing.Point(12, 201);
|
||||
this.btPath2.Location = new System.Drawing.Point(12, 177);
|
||||
this.btPath2.Name = "btPath2";
|
||||
this.btPath2.Size = new System.Drawing.Size(106, 25);
|
||||
this.btPath2.TabIndex = 10;
|
||||
@@ -588,6 +590,7 @@ namespace AGVSimulator.Forms
|
||||
// _targetNodeCombo
|
||||
//
|
||||
this._targetNodeCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this._targetNodeCombo.Font = new System.Drawing.Font("돋움체", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this._targetNodeCombo.Location = new System.Drawing.Point(10, 97);
|
||||
this._targetNodeCombo.Name = "_targetNodeCombo";
|
||||
this._targetNodeCombo.Size = new System.Drawing.Size(210, 20);
|
||||
@@ -605,6 +608,7 @@ namespace AGVSimulator.Forms
|
||||
// _startNodeCombo
|
||||
//
|
||||
this._startNodeCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this._startNodeCombo.Font = new System.Drawing.Font("돋움체", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this._startNodeCombo.Location = new System.Drawing.Point(10, 45);
|
||||
this._startNodeCombo.Name = "_startNodeCombo";
|
||||
this._startNodeCombo.Size = new System.Drawing.Size(210, 20);
|
||||
@@ -812,6 +816,13 @@ namespace AGVSimulator.Forms
|
||||
this.timer1.Interval = 500;
|
||||
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
|
||||
//
|
||||
// btSelectMapEditor
|
||||
//
|
||||
this.btSelectMapEditor.Name = "btSelectMapEditor";
|
||||
this.btSelectMapEditor.Size = new System.Drawing.Size(221, 22);
|
||||
this.btSelectMapEditor.Text = "Mapeditor 선택";
|
||||
this.btSelectMapEditor.Click += new System.EventHandler(this.btSelectMapEditor_Click);
|
||||
//
|
||||
// SimulatorForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
|
||||
@@ -925,5 +936,6 @@ namespace AGVSimulator.Forms
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.PropertyGrid propertyNode;
|
||||
private System.Windows.Forms.Button btPath2;
|
||||
private System.Windows.Forms.ToolStripMenuItem btSelectMapEditor;
|
||||
}
|
||||
}
|
||||
@@ -833,8 +833,8 @@ namespace AGVSimulator.Forms
|
||||
{
|
||||
for (int i = 0; i < _startNodeCombo.Items.Count; i++)
|
||||
{
|
||||
var item = _startNodeCombo.Items[i].ToString();
|
||||
if (item.Contains($"[{nodeId}]"))
|
||||
var item = _startNodeCombo.Items[i] as ComboBoxItem<MapNode>;//.ToString();
|
||||
if (item.Value.Id.Equals(nodeId))
|
||||
{
|
||||
_startNodeCombo.SelectedIndex = i;
|
||||
Program.WriteLine($"[SYSTEM] 시작 노드를 '{nodeId}'로 자동 선택했습니다.");
|
||||
@@ -958,10 +958,10 @@ namespace AGVSimulator.Forms
|
||||
{
|
||||
foreach (var node in _simulatorCanvas.Nodes)
|
||||
{
|
||||
if (node.IsActive && node.HasRfid())
|
||||
if (node.IsActive)
|
||||
{
|
||||
// {rfid} - [{node}] {name} 형식으로 ComboBoxItem 생성
|
||||
var displayText = $"{node.RfidId} - [{node.Id}]";
|
||||
// {rfid} - [{node}] {name} 형식으로 ComboBoxItem 생성
|
||||
var displayText = $"{node.StationType.ToString().PadRight(7)} | {node.ID2}";
|
||||
var item = new ComboBoxItem<MapNode>(node, displayText);
|
||||
|
||||
_startNodeCombo.Items.Add(item);
|
||||
@@ -1007,8 +1007,8 @@ namespace AGVSimulator.Forms
|
||||
_stopSimulationButton.Enabled = _simulationState.IsRunning;
|
||||
|
||||
_removeAgvButton.Enabled = _agvListCombo.SelectedItem != null;
|
||||
// btPath1.Enabled = _startNodeCombo.SelectedItem != null &&
|
||||
// _targetNodeCombo.SelectedItem != null;
|
||||
// btPath1.Enabled = _startNodeCombo.SelectedItem != null &&
|
||||
// _targetNodeCombo.SelectedItem != null;
|
||||
|
||||
// RFID 위치 설정 관련
|
||||
var hasSelectedAGV = _agvListCombo.SelectedItem != null;
|
||||
@@ -2571,8 +2571,8 @@ namespace AGVSimulator.Forms
|
||||
|
||||
if (!pathToGateway.Success) return (false, $"Gateway({gatewayNode.ID2})까지 경로 실패: {pathToGateway.ErrorMessage}");
|
||||
|
||||
//마지막경로는 게이트웨이이므로 제거하낟.
|
||||
if(pathToGateway.Path.Count > 1)
|
||||
//마지막경로는 게이트웨이이므로 제거하낟.(260113)
|
||||
if (pathToGateway.Path.Count > 1 && pathToGateway.Path.Last().Id == gatewayNode.Id)
|
||||
{
|
||||
pathToGateway.Path.RemoveAt(pathToGateway.Path.Count - 1);
|
||||
pathToGateway.DetailedPath.RemoveAt(pathToGateway.DetailedPath.Count - 1);
|
||||
@@ -2584,7 +2584,7 @@ namespace AGVSimulator.Forms
|
||||
MapNode GateprevNode = pathToGateway.Path.Last();
|
||||
NodeMotorInfo GatePrevDetail = pathToGateway.DetailedPath.Last();
|
||||
|
||||
|
||||
|
||||
var arrivalOrientation = GatePrevDetail.MotorDirection;
|
||||
|
||||
//아래코드오류발생함
|
||||
@@ -2643,21 +2643,33 @@ namespace AGVSimulator.Forms
|
||||
var isMonitorLeft = false;
|
||||
bool requiredDir = false;
|
||||
|
||||
|
||||
if (deltaX > 0) //게이트웨이가 우측에 있다
|
||||
{
|
||||
//이떄 모터방향이 후진이라면 모니터는 왼쪽이고, 반대는 오른쪽이다
|
||||
isMonitorLeft = PrevDirection == AgvDirection.Backward;
|
||||
}
|
||||
else
|
||||
{
|
||||
isMonitorLeft = PrevDirection == AgvDirection.Forward;
|
||||
}
|
||||
|
||||
//로더는 상/하 개념으로 처리해야한다.X축이아닌 Y축을 봐야한다.
|
||||
if (targetNode.StationType == StationType.Loader || targetNode.StationType == StationType.Charger2)
|
||||
{
|
||||
deltaX = GTNode.Position.Y - PrevNode.Position.Y;
|
||||
if (deltaX < 0) isMonitorLeft = PrevDirection == AgvDirection.Backward;
|
||||
else isMonitorLeft = PrevDirection == AgvDirection.Forward;
|
||||
}
|
||||
|
||||
switch (targetNode.StationType)
|
||||
{
|
||||
case StationType.Loader:
|
||||
case StationType.Charger2:
|
||||
case StationType.Charger1:
|
||||
case StationType.UnLoader:
|
||||
case StationType.Clearner:
|
||||
case StationType.Buffer:
|
||||
if (deltaX > 0) //게이트웨이가 우측에 있다
|
||||
{
|
||||
//이떄 모터방향이 후진이라면 모니터는 왼쪽이고, 반대는 오른쪽이다
|
||||
isMonitorLeft = PrevDirection == AgvDirection.Backward;
|
||||
}
|
||||
else
|
||||
{
|
||||
isMonitorLeft = PrevDirection == AgvDirection.Forward;
|
||||
}
|
||||
|
||||
//버퍼는 모니터가 왼쪽에 있으면 안된다.
|
||||
//충전기1만 전진 도킹을 한다.
|
||||
@@ -2932,6 +2944,29 @@ namespace AGVSimulator.Forms
|
||||
_simulatorCanvas.FitToNodes();
|
||||
}
|
||||
|
||||
private void btSelectMapEditor_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (var openDialog = new OpenFileDialog())
|
||||
{
|
||||
openDialog.Filter = "실행 파일 (*.exe)|*.exe|모든 파일 (*.*)|*.*";
|
||||
openDialog.Title = "MapEditor 실행 파일 선택";
|
||||
|
||||
if (!string.IsNullOrEmpty(_config.MapEditorExecutablePath) && File.Exists(_config.MapEditorExecutablePath))
|
||||
{
|
||||
openDialog.InitialDirectory = Path.GetDirectoryName(_config.MapEditorExecutablePath);
|
||||
openDialog.FileName = Path.GetFileName(_config.MapEditorExecutablePath);
|
||||
}
|
||||
|
||||
if (openDialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
_config.MapEditorExecutablePath = openDialog.FileName;
|
||||
_config.Save();
|
||||
|
||||
_statusLabel.Text = $"MapEditor 경로 설정: {Path.GetFileName(openDialog.FileName)}";
|
||||
MessageBox.Show($"MapEditor 실행 파일이 설정되었습니다:\n{openDialog.FileName}",
|
||||
"경로 설정 완료", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user