diff --git a/AGVLogic/AGVMapEditor/Forms/MainForm.cs b/AGVLogic/AGVMapEditor/Forms/MainForm.cs index 8625c82..c9da343 100644 --- a/AGVLogic/AGVMapEditor/Forms/MainForm.cs +++ b/AGVLogic/AGVMapEditor/Forms/MainForm.cs @@ -424,7 +424,7 @@ namespace AGVMapEditor.Forms var nodeId = GenerateNodeId(); var position = new Point(100 + this._mapCanvas.Nodes.Count * 50, 100 + this._mapCanvas.Nodes.Count * 50); - var node = new MapNode(nodeId, position, StationType.Normal); + var node = new MapNode(nodeId, position, Station.Normal); this._mapCanvas.Nodes.Add(node); _hasChanges = true; @@ -850,9 +850,9 @@ namespace AGVMapEditor.Forms case NodeType.Normal: var item = node as MapNode; - if (item.StationType == StationType.Normal) + if (item.StationType == Station.Normal) foreColor = Color.DimGray; - else if (item.StationType == StationType.Charger) + else if (item.StationType == Station.Charger) foreColor = Color.Red; else foreColor = Color.DarkGreen; diff --git a/AGVLogic/AGVNavigationCore/Controls/UnifiedAGVCanvas.Events.cs b/AGVLogic/AGVNavigationCore/Controls/UnifiedAGVCanvas.Events.cs index ab31487..951bf1f 100644 --- a/AGVLogic/AGVNavigationCore/Controls/UnifiedAGVCanvas.Events.cs +++ b/AGVLogic/AGVNavigationCore/Controls/UnifiedAGVCanvas.Events.cs @@ -980,7 +980,7 @@ namespace AGVNavigationCore.Controls { case NodeType.Normal: var item = _selectedNode as MapNode; - if (item.StationType == StationType.Charger) + if (item.StationType == Station.Charger) DrawTriangleGhost(g, ghostBrush); else DrawPentagonGhost(g, ghostBrush); @@ -1169,16 +1169,16 @@ namespace AGVNavigationCore.Controls switch (node.StationType) { - case StationType.Loader: - case StationType.Cleaner: - case StationType.Plating: - case StationType.Buffer: + case Station.Loder: + case Station.Cleaner: + case Station.Plating: + case Station.Buffer: DrawPentagonNodeShape(g, node, brush); break; - case StationType.Charger: + case Station.Charger: DrawTriangleNodeShape(g, node, brush); break; - case StationType.Limit: + case Station.Lmt: DrawRectangleNodeShape(g, node, brush); break; default: @@ -1616,20 +1616,20 @@ namespace AGVNavigationCore.Controls Color bgColor = Color.White; switch (node.StationType) { - case StationType.Charger: + case Station.Charger: fgColor = Color.White; bgColor = Color.Tomato; break; - case StationType.Buffer: + case Station.Buffer: fgColor = Color.Black; bgColor = Color.White; break; - case StationType.Plating: + case Station.Plating: fgColor = Color.Black; bgColor = Color.DeepSkyBlue; break; - case StationType.Loader: - case StationType.Cleaner: + case Station.Loder: + case Station.Cleaner: fgColor = Color.Black; bgColor = Color.Gold; break; @@ -1915,18 +1915,18 @@ namespace AGVNavigationCore.Controls switch (node.StationType) { - case StationType.Normal: + case Station.Normal: if (node.CanTurnLeft || node.CanTurnRight) bgColor = Color.Violet; else bgColor = Color.DeepSkyBlue; break; - case StationType.Charger: bgColor = Color.Tomato; break; - case StationType.Loader: - case StationType.Cleaner: bgColor = Color.Gold; break; - case StationType.Plating: bgColor = Color.DeepSkyBlue; break; - case StationType.Buffer: bgColor = Color.WhiteSmoke; break; - case StationType.Limit: bgColor = Color.Red; break; + case Station.Charger: bgColor = Color.Tomato; break; + case Station.Loder: + case Station.Cleaner: bgColor = Color.Gold; break; + case Station.Plating: bgColor = Color.DeepSkyBlue; break; + case Station.Buffer: bgColor = Color.WhiteSmoke; break; + case Station.Lmt: bgColor = Color.Red; break; default: bgColor = Color.White; break; } diff --git a/AGVLogic/AGVNavigationCore/Controls/UnifiedAGVCanvas.Mouse.cs b/AGVLogic/AGVNavigationCore/Controls/UnifiedAGVCanvas.Mouse.cs index 0d29027..aa295fe 100644 --- a/AGVLogic/AGVNavigationCore/Controls/UnifiedAGVCanvas.Mouse.cs +++ b/AGVLogic/AGVNavigationCore/Controls/UnifiedAGVCanvas.Mouse.cs @@ -582,12 +582,12 @@ namespace AGVNavigationCore.Controls { switch (node.StationType) { - case StationType.Loader: - case StationType.Cleaner: - case StationType.Plating: - case StationType.Buffer: + case Station.Loder: + case Station.Cleaner: + case Station.Plating: + case Station.Buffer: return IsPointInPentagon(point, node); - case StationType.Charger: + case Station.Charger: return IsPointInTriangle(point, node); default: return IsPointInCircle(point, node); diff --git a/AGVLogic/AGVNavigationCore/Models/Enums.cs b/AGVLogic/AGVNavigationCore/Models/Enums.cs index 198f68e..ca511ec 100644 --- a/AGVLogic/AGVNavigationCore/Models/Enums.cs +++ b/AGVLogic/AGVNavigationCore/Models/Enums.cs @@ -58,14 +58,14 @@ namespace AGVNavigationCore.Models /// /// 장비 타입 열거형 /// - public enum StationType + public enum Station { /// /// 일반노드 /// Normal, /// 로더 - Loader, + Loder, /// 클리너 Plating, /// 오프로더 @@ -78,7 +78,7 @@ namespace AGVNavigationCore.Models /// /// 끝점(더이상 이동불가) /// - Limit, + Lmt, } diff --git a/AGVLogic/AGVNavigationCore/Models/MapNode.cs b/AGVLogic/AGVNavigationCore/Models/MapNode.cs index 921c373..3da5bb5 100644 --- a/AGVLogic/AGVNavigationCore/Models/MapNode.cs +++ b/AGVLogic/AGVNavigationCore/Models/MapNode.cs @@ -17,18 +17,18 @@ namespace AGVNavigationCore.Models - public StationType StationType { get; set; } + public Station StationType { get; set; } [Browsable(false)] public bool CanDocking { get { - if (StationType == StationType.Buffer) return true; - if (StationType == StationType.Loader) return true; - if (StationType == StationType.Cleaner) return true; - if (StationType == StationType.Plating) return true; - if (StationType == StationType.Charger) return true; + if (StationType == Station.Buffer) return true; + if (StationType == Station.Loder) return true; + if (StationType == Station.Cleaner) return true; + if (StationType == Station.Plating) return true; + if (StationType == Station.Charger) return true; return false; } } @@ -111,7 +111,7 @@ namespace AGVNavigationCore.Models Type = NodeType.Normal; } - public MapNode(string nodeId, Point position, StationType type) : base(nodeId, position) + public MapNode(string nodeId, Point position, Station type) : base(nodeId, position) { Type = NodeType.Normal; } @@ -122,9 +122,9 @@ namespace AGVNavigationCore.Models { get { - if (StationType == StationType.Charger || StationType == StationType.Buffer || - StationType == StationType.Plating || StationType == StationType.Loader || - StationType == StationType.Cleaner) return true; + if (StationType == Station.Charger || StationType == Station.Buffer || + StationType == Station.Plating || StationType == Station.Loder || + StationType == Station.Cleaner) return true; return false; } } diff --git a/AGVLogic/AGVNavigationCore/Models/VirtualAGV.cs b/AGVLogic/AGVNavigationCore/Models/VirtualAGV.cs index 6a0fd53..1f632f4 100644 --- a/AGVLogic/AGVNavigationCore/Models/VirtualAGV.cs +++ b/AGVLogic/AGVNavigationCore/Models/VirtualAGV.cs @@ -367,7 +367,7 @@ namespace AGVNavigationCore.Models //도킹노드라면 markstop 을 나머지는 바로 스탑한다. eAGVCommandReason reason = eAGVCommandReason.MarkStop; - if (TargetNode.StationType == StationType.Normal || TargetNode.StationType == StationType.Limit) + if (TargetNode.StationType == Station.Normal || TargetNode.StationType == Station.Lmt) { //일반노드는 마크스탑포인트가 없으니 바로 종료되도록 한다 reason = eAGVCommandReason.Complete; diff --git a/AGVLogic/AGVNavigationCore/PathFinding/Planning/AGVPathfinder.cs b/AGVLogic/AGVNavigationCore/PathFinding/Planning/AGVPathfinder.cs index 31e0e5d..a3cc7ca 100644 --- a/AGVLogic/AGVNavigationCore/PathFinding/Planning/AGVPathfinder.cs +++ b/AGVLogic/AGVNavigationCore/PathFinding/Planning/AGVPathfinder.cs @@ -135,7 +135,18 @@ namespace AGVNavigationCore.PathFinding.Planning // 2. A* 경로 탐색 var pathResult = _basicPathfinder.FindPathAStar(startNode, targetNode); pathResult.PrevNode = _prevNode; - pathResult.PrevDirection = prevDirection; + //이전노드가 새로생서된 노드에 포함되어있다면 방향을 전환해줘야한다. + if (pathResult.Path.Where(t => t.RfidId == _prevNode.RfidId).Any() == false) + pathResult.PrevDirection = prevDirection; + else + { + if (prevDirection == AgvDirection.Forward) + pathResult.PrevDirection = AgvDirection.Backward; + else + pathResult.PrevDirection = AgvDirection.Forward; + } + + if (!pathResult.Success) return AGVPathResult.CreateFailure(pathResult.Message ?? "경로 없음", 0, 0); @@ -173,7 +184,7 @@ namespace AGVNavigationCore.PathFinding.Planning } - var nodeInfo = new NodeMotorInfo(i + 1, node.Id, node.RfidId, prevDirection, nextNode, magnetDirection); + var nodeInfo = new NodeMotorInfo(i + 1, node.Id, node.RfidId, pathResult.PrevDirection, nextNode, magnetDirection); // 속도 설정 var mapNode = _mapNodes.FirstOrDefault(n => n.Id == node.Id); @@ -435,7 +446,7 @@ namespace AGVNavigationCore.PathFinding.Planning } #endregion - public enum MapZoneMonitor + public enum MonDir { LeftTop, RightBtm, @@ -451,226 +462,280 @@ namespace AGVNavigationCore.PathFinding.Planning Junction, // Hub (11, 12, etc) Turn, } - public class MapZonePathData + public class PathData { - public StationType NodeSta { get; set; } - public StationType NodeEnd { get; set; } - public MapZoneMonitor Monitor { get; set; } + public Station NodeSta { get; set; } + public Station NodeEnd { get; set; } + public MonDir Monitor { get; set; } public List Path { get; set; } + public PathData(params string[] _path) + { + Path = new List(); + Path.AddRange(_path); + } } - public List GetMapZonePathData() + public List GetMapZonePathData() { - var retval = new List(); - + var retval = new List(); // Buffer -> ... - retval.Add(new MapZonePathData { NodeSta = StationType.Buffer, NodeEnd = StationType.Charger, Monitor = MapZoneMonitor.RightBtm, Path = new List { "36F", "35F", "31F", "32F", "33F", "34F", "20F", "9F", "8F", "7F", "11F", "3T", "3F", "11F", "7B", "10B", "6B", "73B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Buffer, NodeEnd = StationType.Charger, Monitor = MapZoneMonitor.LeftTop, Path = new List { "36B", "35B", "31B", "32B", "33B", "34B", "20B", "9B", "8B", "7B", "10B", "6B", "73B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Buffer, NodeEnd = StationType.Plating, Monitor = MapZoneMonitor.RightBtm, Path = new List { "36F", "35F", "31F", "32F", "33F", "34F", "20F", "9F", "8F", "7F", "11B", "72B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Buffer, NodeEnd = StationType.Plating, Monitor = MapZoneMonitor.LeftTop, Path = new List { "36B", "35B", "31B", "32B", "33B", "34B", "20B", "9B", "8B", "7B", "11B", "3T", "3B", "11B", "72B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Buffer, NodeEnd = StationType.Loader, Monitor = MapZoneMonitor.RightBtm, Path = new List { "36F", "35F", "31F", "32F", "33F", "34F", "20F", "9F", "8F", "7F", "11F", "3B", "71B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Buffer, NodeEnd = StationType.Loader, Monitor = MapZoneMonitor.LeftTop, Path = new List { "36B", "35B", "31B", "32B", "33B", "34B", "20B", "9B", "8B", "7B", "11B", "3T", "3B", "71B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Buffer, NodeEnd = StationType.Cleaner, Monitor = MapZoneMonitor.RightBtm, Path = new List { "36F", "35F", "31F", "32F", "33F", "34F", "20F", "9F", "8F", "7F", "11F", "3T", "3B", "70B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Buffer, NodeEnd = StationType.Cleaner, Monitor = MapZoneMonitor.LeftTop, Path = new List { "36B", "35B", "31B", "32B", "33B", "34B", "20B", "9B", "8B", "7B", "11B", "3B", "70B" } }); + // [[ LeftTop ]] + retval.AddRange(new List + { + new PathData( "36B", "35B", "31B", "32B", "33B", "34B", "20B", "9B", "8B", "7B", "10B", "6B", "73B") { Monitor = MonDir.LeftTop, NodeSta = Station.Buffer, NodeEnd = Station.Charger }, + new PathData( "36B", "35B", "31B", "32B", "33B", "34B", "20B", "9B", "8B", "7B", "11B", "3T", "3B", "11B", "72B") { Monitor = MonDir.LeftTop, NodeSta = Station.Buffer, NodeEnd = Station.Plating }, + new PathData( "36B", "35B", "31B", "32B", "33B", "34B", "20B", "9B", "8B", "7B", "11B", "3T", "3B", "71B") { Monitor = MonDir.LeftTop, NodeSta = Station.Buffer, NodeEnd = Station.Loder }, + new PathData( "36B", "35B", "31B", "32B", "33B", "34B", "20B", "9B", "8B", "7B", "11B", "3B", "70B") { Monitor = MonDir.LeftTop, NodeSta = Station.Buffer, NodeEnd = Station.Cleaner } + }); + + // [[ RightBtm ]] + retval.AddRange(new List + { + new PathData( "36F", "35F", "31F", "32F", "33F", "34F", "20F", "9F", "8F", "7F", "11F", "3T", "3F", "11F", "7B", "10B", "6B", "73B") { Monitor = MonDir.RightBtm, NodeSta = Station.Buffer, NodeEnd = Station.Charger }, + new PathData( "36F", "35F", "31F", "32F", "33F", "34F", "20F", "9F", "8F", "7F", "11B", "72B") { Monitor = MonDir.RightBtm, NodeSta = Station.Buffer, NodeEnd = Station.Plating }, + new PathData( "36F", "35F", "31F", "32F", "33F", "34F", "20F", "9F", "8F", "7F", "11F", "3B", "71B") { Monitor = MonDir.RightBtm, NodeSta = Station.Buffer, NodeEnd = Station.Loder }, + new PathData( "36F", "35F", "31F", "32F", "33F", "34F", "20F", "9F", "8F", "7F", "11F", "3T", "3B", "70B") { Monitor = MonDir.RightBtm, NodeSta = Station.Buffer, NodeEnd = Station.Cleaner } + }); + // Loader -> ... - retval.Add(new MapZonePathData { NodeSta = StationType.Loader, NodeEnd = StationType.Cleaner, Monitor = MapZoneMonitor.RightBtm, Path = new List { "71B", "3B", "70B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Loader, NodeEnd = StationType.Cleaner, Monitor = MapZoneMonitor.LeftTop, Path = new List { "71F", "3T", "3B", "70B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Loader, NodeEnd = StationType.Charger, Monitor = MapZoneMonitor.RightBtm, Path = new List { "71B", "3F", "11F", "7B", "10B", "6B", "73B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Loader, NodeEnd = StationType.Charger, Monitor = MapZoneMonitor.LeftTop, Path = new List { "71F", "3T", "3F", "11F", "7B", "10B", "6B", "73B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Loader, NodeEnd = StationType.Plating, Monitor = MapZoneMonitor.RightBtm, Path = new List { "71B", "3T", "3B", "11B", "72B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Loader, NodeEnd = StationType.Plating, Monitor = MapZoneMonitor.LeftTop, Path = new List { "71F", "3B", "11B", "72B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Loader, NodeEnd = StationType.Buffer, Monitor = MapZoneMonitor.RightBtm, Path = new List { "71B", "3T", "3B", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Loader, NodeEnd = StationType.Buffer, Monitor = MapZoneMonitor.LeftTop, Path = new List { "71F", "3B", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B" } }); + // [[ LeftTop ]] + retval.AddRange(new List + { + new PathData( "71F", "3T", "3B", "70B") { Monitor = MonDir.LeftTop, NodeSta = Station.Loder, NodeEnd = Station.Cleaner }, + new PathData( "71F", "3T", "3F", "11F", "7B", "10B", "6B", "73B") { Monitor = MonDir.LeftTop, NodeSta = Station.Loder, NodeEnd = Station.Charger }, + new PathData( "71F", "3B", "11B", "72B") { Monitor = MonDir.LeftTop, NodeSta = Station.Loder, NodeEnd = Station.Plating }, + new PathData( "71F", "3B", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B") { Monitor = MonDir.LeftTop, NodeSta = Station.Loder, NodeEnd = Station.Buffer } + }); + + // [[ RightBtm ]] + retval.AddRange(new List + { + new PathData( "71B", "3B", "70B") { Monitor = MonDir.RightBtm, NodeSta = Station.Loder, NodeEnd = Station.Cleaner }, + new PathData( "71B", "3F", "11F", "7B", "10B", "6B", "73B") { Monitor = MonDir.RightBtm, NodeSta = Station.Loder, NodeEnd = Station.Charger }, + new PathData( "71B", "3T", "3B", "11B", "72B") { Monitor = MonDir.RightBtm, NodeSta = Station.Loder, NodeEnd = Station.Plating }, + new PathData( "71B", "3T", "3B", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B") { Monitor = MonDir.RightBtm, NodeSta = Station.Loder, NodeEnd = Station.Buffer } + }); + // Cleaner -> ... - retval.Add(new MapZonePathData { NodeSta = StationType.Cleaner, NodeEnd = StationType.Loader, Monitor = MapZoneMonitor.RightBtm, Path = new List { "70F", "3T", "3B", "71B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Cleaner, NodeEnd = StationType.Loader, Monitor = MapZoneMonitor.LeftTop, Path = new List { "70B", "3B", "71B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Cleaner, NodeEnd = StationType.Charger, Monitor = MapZoneMonitor.RightBtm, Path = new List { "70F", "3F", "11F", "7B", "10B", "6B", "73B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Cleaner, NodeEnd = StationType.Charger, Monitor = MapZoneMonitor.LeftTop, Path = new List { "70B", "3T", "3F", "11F", "7B", "10B", "6B", "73B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Cleaner, NodeEnd = StationType.Plating, Monitor = MapZoneMonitor.RightBtm, Path = new List { "70F", "3T", "3B", "11B", "72B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Cleaner, NodeEnd = StationType.Plating, Monitor = MapZoneMonitor.LeftTop, Path = new List { "70B", "3B", "11B", "72B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Cleaner, NodeEnd = StationType.Buffer, Monitor = MapZoneMonitor.RightBtm, Path = new List { "70F", "3T", "3B", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Cleaner, NodeEnd = StationType.Buffer, Monitor = MapZoneMonitor.LeftTop, Path = new List { "70B", "3B", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B" } }); + // [[ LeftTop ]] + retval.AddRange(new List + { + new PathData( "70B", "3B", "71B") { Monitor = MonDir.LeftTop, NodeSta = Station.Cleaner, NodeEnd = Station.Loder }, + new PathData( "70B", "3T", "3F", "11F", "7B", "10B", "6B", "73B") { Monitor = MonDir.LeftTop, NodeSta = Station.Cleaner, NodeEnd = Station.Charger }, + new PathData( "70B", "3B", "11B", "72B") { Monitor = MonDir.LeftTop, NodeSta = Station.Cleaner, NodeEnd = Station.Plating }, + new PathData( "70B", "3B", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B") { Monitor = MonDir.LeftTop, NodeSta = Station.Cleaner, NodeEnd = Station.Buffer } + }); + + // [[ RightBtm ]] + retval.AddRange(new List + { + new PathData( "70F", "3T", "3B", "71B") { Monitor = MonDir.RightBtm, NodeSta = Station.Cleaner, NodeEnd = Station.Loder }, + new PathData( "70F", "3F", "11F", "7B", "10B", "6B", "73B") { Monitor = MonDir.RightBtm, NodeSta = Station.Cleaner, NodeEnd = Station.Charger }, + new PathData( "70F", "3T", "3B", "11B", "72B") { Monitor = MonDir.RightBtm, NodeSta = Station.Cleaner, NodeEnd = Station.Plating }, + new PathData( "70F", "3T", "3B", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B") { Monitor = MonDir.RightBtm, NodeSta = Station.Cleaner, NodeEnd = Station.Buffer } + }); + // Plating -> ... - retval.Add(new MapZonePathData { NodeSta = StationType.Plating, NodeEnd = StationType.Loader, Monitor = MapZoneMonitor.RightBtm, Path = new List { "72F", "11F", "3B", "71B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Plating, NodeEnd = StationType.Loader, Monitor = MapZoneMonitor.LeftTop, Path = new List { "72B", "11B", "3T", "3B", "71B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Plating, NodeEnd = StationType.Charger, Monitor = MapZoneMonitor.RightBtm, Path = new List { "72F", "11F", "3T", "3F", "11F", "7B", "10B", "6B", "73B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Plating, NodeEnd = StationType.Charger, Monitor = MapZoneMonitor.LeftTop, Path = new List { "72B", "11B", "3F", "11F", "7B", "10B", "6B", "73B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Plating, NodeEnd = StationType.Cleaner, Monitor = MapZoneMonitor.RightBtm, Path = new List { "72F", "11F", "3T", "3B", "70B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Plating, NodeEnd = StationType.Cleaner, Monitor = MapZoneMonitor.LeftTop, Path = new List { "72B", "11B", "3B", "70B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Plating, NodeEnd = StationType.Buffer, Monitor = MapZoneMonitor.RightBtm, Path = new List { "72F", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B" } }); - retval.Add(new MapZonePathData { NodeSta = StationType.Plating, NodeEnd = StationType.Buffer, Monitor = MapZoneMonitor.LeftTop, Path = new List { "72B", "11B", "3T", "3B", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B" } }); + // [[ LeftTop ]] + retval.AddRange(new List + { + new PathData( "72B", "11B", "3T", "3B", "71B") { Monitor = MonDir.LeftTop, NodeSta = Station.Plating, NodeEnd = Station.Loder }, + new PathData( "72B", "11B", "3F", "11F", "7B", "10B", "6B", "73B") { Monitor = MonDir.LeftTop, NodeSta = Station.Plating, NodeEnd = Station.Charger }, + new PathData( "72B", "11B", "3B", "70B") { Monitor = MonDir.LeftTop, NodeSta = Station.Plating, NodeEnd = Station.Cleaner }, + new PathData( "72B", "11B", "3T", "3B", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B") { Monitor = MonDir.LeftTop, NodeSta = Station.Plating, NodeEnd = Station.Buffer } + }); + + // [[ RightBtm ]] + retval.AddRange(new List + { + new PathData( "72F", "11F", "3B", "71B") { Monitor = MonDir.RightBtm, NodeSta = Station.Plating, NodeEnd = Station.Loder }, + new PathData( "72F", "11F", "3T", "3F", "11F", "7B", "10B", "6B", "73B") { Monitor = MonDir.RightBtm, NodeSta = Station.Plating, NodeEnd = Station.Charger }, + new PathData( "72F", "11F", "3T", "3B", "70B") { Monitor = MonDir.RightBtm, NodeSta = Station.Plating, NodeEnd = Station.Cleaner }, + new PathData( "72F", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B") { Monitor = MonDir.RightBtm, NodeSta = Station.Plating, NodeEnd = Station.Buffer } + }); + //일반노드도 일부 경로를 계산한다. // 일반노드 3 -> - - retval.Add(new MapZonePathData + // [[ LeftTop ]] + retval.AddRange(new List { - NodeSta = StationType.Normal, - NodeEnd = StationType.Loader, - Monitor = MapZoneMonitor.LeftTop, - Path = new List { "3B", "71B" } - }); - retval.Add(new MapZonePathData - { - NodeSta = StationType.Normal, - NodeEnd = StationType.Cleaner, - Monitor = MapZoneMonitor.LeftTop, - Path = new List { "3T", "3B", "70B" } - }); - retval.Add(new MapZonePathData - { - NodeSta = StationType.Normal, - NodeEnd = StationType.Plating, - Monitor = MapZoneMonitor.LeftTop, - Path = new List { "3B", "11B", "72B" } - }); - retval.Add(new MapZonePathData - { - NodeSta = StationType.Normal, - NodeEnd = StationType.Charger, - Monitor = MapZoneMonitor.LeftTop, - Path = new List { "3T", "3F", "11F", "7B", "10B", "6B", "73B" } - }); - retval.Add(new MapZonePathData - { - NodeSta = StationType.Normal, - NodeEnd = StationType.Buffer, - Monitor = MapZoneMonitor.LeftTop, - Path = new List { "3B", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B" } + new PathData( "3B", "71B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Loder }, + new PathData( "3T", "3B", "70B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Cleaner }, + new PathData( "3B", "11B", "72B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Plating }, + new PathData( "3T", "3F", "11F", "7B", "10B", "6B", "73B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Charger }, + new PathData( "3B", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Buffer } }); - retval.Add(new MapZonePathData + // [[ RightBtm ]] + retval.AddRange(new List { - NodeSta = StationType.Normal, - NodeEnd = StationType.Loader, - Monitor = MapZoneMonitor.RightBtm, - Path = new List { "3T", "3B", "71B" } - }); - retval.Add(new MapZonePathData - { - NodeSta = StationType.Normal, - NodeEnd = StationType.Cleaner, - Monitor = MapZoneMonitor.RightBtm, - Path = new List { "3B", "70B" } - }); - retval.Add(new MapZonePathData - { - NodeSta = StationType.Normal, - NodeEnd = StationType.Plating, - Monitor = MapZoneMonitor.RightBtm, - Path = new List { "3T", "3B", "11B", "72B" } - }); - retval.Add(new MapZonePathData - { - NodeSta = StationType.Normal, - NodeEnd = StationType.Charger, - Monitor = MapZoneMonitor.RightBtm, - Path = new List { "3F", "11F", "7B", "10B", "6B", "73B" } - }); - retval.Add(new MapZonePathData - { - NodeSta = StationType.Normal, - NodeEnd = StationType.Buffer, - Monitor = MapZoneMonitor.RightBtm, - Path = new List { "3T", "3B", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B" } + new PathData( "3T", "3B", "71B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Loder }, + new PathData( "3B", "70B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Cleaner }, + new PathData( "3T", "3B", "11B", "72B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Plating }, + new PathData( "3F", "11F", "7B", "10B", "6B", "73B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Charger }, + new PathData( "3T", "3B", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Buffer } }); + // 일반노드 7 -> - retval.Add(new MapZonePathData + // [[ LeftTop ]] + retval.AddRange(new List { - NodeSta = StationType.Normal, - NodeEnd = StationType.Loader, - Monitor = MapZoneMonitor.LeftTop, - Path = new List { "7F", "11F", "3B", "71B" } - }); - retval.Add(new MapZonePathData - { - NodeSta = StationType.Normal, - NodeEnd = StationType.Cleaner, - Monitor = MapZoneMonitor.LeftTop, - Path = new List { "7F", "11F", "3T", "3B", "70B" } - }); - retval.Add(new MapZonePathData - { - NodeSta = StationType.Normal, - NodeEnd = StationType.Plating, - Monitor = MapZoneMonitor.LeftTop, - Path = new List { "7F", "11B", "72B" } - }); - retval.Add(new MapZonePathData - { - NodeSta = StationType.Normal, - NodeEnd = StationType.Charger, - Monitor = MapZoneMonitor.LeftTop, - Path = new List { "7F", "11F", "3T", "3F", "11F", "7B", "10B", "6B", "73B" } - }); - retval.Add(new MapZonePathData - { - NodeSta = StationType.Normal, - NodeEnd = StationType.Buffer, - Monitor = MapZoneMonitor.LeftTop, - Path = new List { "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B" } + new PathData( "7F", "11F", "3B", "71B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Loder }, + new PathData( "7F", "11F", "3T", "3B", "70B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Cleaner }, + new PathData( "7F", "11B", "72B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Plating }, + new PathData( "7F", "11F", "3T", "3F", "11F", "7B", "10B", "6B", "73B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Charger }, + new PathData( "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Buffer } }); - retval.Add(new MapZonePathData + // [[ RightBtm ]] + retval.AddRange(new List { - NodeSta = StationType.Normal, - NodeEnd = StationType.Loader, - Monitor = MapZoneMonitor.RightBtm, - Path = new List { "7B", "11B", "3T", "3B", "71B" } - }); - retval.Add(new MapZonePathData - { - NodeSta = StationType.Normal, - NodeEnd = StationType.Cleaner, - Monitor = MapZoneMonitor.RightBtm, - Path = new List { "7B", "11B", "3B", "70B" } - }); - retval.Add(new MapZonePathData - { - NodeSta = StationType.Normal, - NodeEnd = StationType.Plating, - Monitor = MapZoneMonitor.RightBtm, - Path = new List { "7B", "11B", "3T", "3B", "11B", "72B" } - }); - retval.Add(new MapZonePathData - { - NodeSta = StationType.Normal, - NodeEnd = StationType.Charger, - Monitor = MapZoneMonitor.RightBtm, - Path = new List { "7B", "10B", "6B", "73B" } - }); - retval.Add(new MapZonePathData - { - NodeSta = StationType.Normal, - NodeEnd = StationType.Buffer, - Monitor = MapZoneMonitor.RightBtm, - Path = new List { "7B", "11B", "3T", "3B", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B" } + new PathData( "7B", "11B", "3T", "3B", "71B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Loder }, + new PathData( "7B", "11B", "3B", "70B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Cleaner }, + new PathData( "7B", "11B", "3T", "3B", "11B", "72B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Plating }, + new PathData( "7B", "10B", "6B", "73B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Charger }, + new PathData( "7B", "11B", "3T", "3B", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Buffer } }); //일반노드를 포함하여 모든 노드를 정의하자 - /* 예시 - *retval.Add(new MapZonePathData { NodeSta = StationType.Plating, NodeEnd = StationType.Loader, Monitor = MapZoneMonitor.RightBtm, Path = new List { "72F", "11F", "3B", "71B" } }); - //retval.Add(new MapZonePathData { NodeSta = StationType.Plating, NodeEnd = StationType.Loader, Monitor = MapZoneMonitor.LeftTop, Path = new List { "72B", "11B", "3T", "3B", "71B" } }); - //retval.Add(new MapZonePathData { NodeSta = StationType.Plating, NodeEnd = StationType.Charger, Monitor = MapZoneMonitor.RightBtm, Path = new List { "72F", "11F", "3T", "3F", "11F", "7B", "10B", "6B", "73B" } }); - //retval.Add(new MapZonePathData { NodeSta = StationType.Plating, NodeEnd = StationType.Charger, Monitor = MapZoneMonitor.LeftTop, Path = new List { "72B", "11B", "3F", "11F", "7B", "10B", "6B", "73B" } }); - //retval.Add(new MapZonePathData { NodeSta = StationType.Plating, NodeEnd = StationType.Cleaner, Monitor = MapZoneMonitor.RightBtm, Path = new List { "72F", "11F", "3T", "3B", "70B" } }); - //retval.Add(new MapZonePathData { NodeSta = StationType.Plating, NodeEnd = StationType.Cleaner, Monitor = MapZoneMonitor.LeftTop, Path = new List { "72B", "11B", "3B", "70B" } }); - //retval.Add(new MapZonePathData { NodeSta = StationType.Plating, NodeEnd = StationType.Buffer, Monitor = MapZoneMonitor.RightBtm, Path = new List { "72F", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B" } }); - //retval.Add(new MapZonePathData { NodeSta = StationType.Plating, NodeEnd = StationType.Buffer, Monitor = MapZoneMonitor.LeftTop, Path = new List { "72B", "11B", "3T", "3B", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B" } }); - */ - // 일반노드 6 -> + // [[ LeftTop ]] + retval.AddRange(new List + { + new PathData( "6B", "10B", "7F", "11F", "3B", "71B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Loder }, + new PathData( "6B", "10B", "7F", "11F", "3T", "3B", "70B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Cleaner }, + new PathData( "6B", "10B", "7F", "11B", "72B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Plating }, + new PathData( "6B", "10B", "7F", "11F", "3T", "3F","11F","7B","10B","6B","73B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Charger }, + new PathData( "6B", "10B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Buffer } + }); + + // [[ RightBtm ]] + retval.AddRange(new List + { + new PathData( "6F", "10F", "7B", "11B", "3T", "3B", "71B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Loder }, + new PathData( "6F", "10F", "7B", "11B", "3B", "70B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Cleaner }, + new PathData( "6F", "10F", "7B", "11F", "72F") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Plating }, + new PathData( "6B", "73B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Charger }, + new PathData( "6F", "10F", "7B", "11B","3T","3B","11B","7B","8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Buffer } + }); + + // 여기까지 검증 완료. + // 일반노드 10 -> + // [[ LeftTop ]] + retval.AddRange(new List + { + new PathData( "10B", "7F", "11F", "3B", "71B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Loder }, + new PathData( "10B", "7F", "11F", "3T", "3B", "70B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Cleaner }, + new PathData( "10B", "7F", "11B", "72B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Plating }, + new PathData( "10B", "7F", "11F", "3T","3F", "11F","7B", "10B", "6B", "73B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Charger }, + new PathData( "10B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Buffer } + }); + + // [[ RightBtm ]] + retval.AddRange(new List + { + new PathData( "10F", "7B", "11B", "3T", "3B", "71B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Loder }, + new PathData( "10F", "7B", "11B", "3B", "70B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Cleaner }, + new PathData( "10F", "7B", "11B", "3T", "3B", "11B", "72B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Plating }, + new PathData( "10B", "6B", "73B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Charger }, + new PathData( "10F", "7B", "11B", "3T", "3B", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Buffer } + }); + + // 일반노드 11 -> + // [[ LeftTop ]] + retval.AddRange(new List + { + new PathData( "11F", "3B", "71B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Loder }, + new PathData( "11F", "3T", "3B", "70B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Cleaner }, + new PathData( "11B", "72B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Plating }, + new PathData( "11F", "3T", "3F", "11F", "7B", "10B", "6B", "73B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Charger }, + new PathData( "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Buffer } + }); + + // [[ RightBtm ]] + retval.AddRange(new List + { + new PathData( "11B", "3T", "3B", "71B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Loder }, + new PathData( "11B", "3B", "70B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Cleaner }, + new PathData( "11B", "3T", "3B", "11B", "72B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Plating }, + new PathData( "11F", "7B", "10B", "6B", "73B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Charger }, + new PathData( "11B", "3T", "3B", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Buffer } + }); + + // 일반노드 8 -> + // [[ LeftTop ]] + retval.AddRange(new List + { + new PathData("8F", "7F", "11F", "3B", "71B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Loder }, + new PathData("8F", "7F", "11F", "3T", "3B", "70B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Cleaner }, + new PathData("8F", "7F", "11B", "72B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Plating }, + new PathData("8F", "7F", "11F", "3T", "3F", "11F", "7B", "10B", "6B", "73B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Charger }, + new PathData("8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Buffer } + }); + + // [[ RightBtm ]] + retval.AddRange(new List + { + new PathData("8B", "7B", "11B", "3T", "3B", "71B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Loder }, + new PathData("8B", "7B", "11B", "3B", "70B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Cleaner }, + new PathData("8B", "7B", "11B", "3T", "3B", "11B", "72B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Plating }, + new PathData("8B", "7B", "10B", "6B", "73B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Charger }, + new PathData("8B", "7B", "11B", "3T", "3B", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Buffer } + }); + + // 일반노드 9 -> + // [[ LeftTop ]] + retval.AddRange(new List + { + new PathData("9F", "8F", "7F", "11F", "3B", "71B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Loder }, + new PathData("9F", "8F", "7F", "11F", "3T", "3B", "70B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Cleaner }, + new PathData("9F", "8F", "7F", "11B", "72B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Plating }, + new PathData("9F", "8F", "7F", "11F", "3T", "3F", "11F", "7B", "10B", "6B", "73B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Charger }, + new PathData("9B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Buffer } + }); + + // [[ RightBtm ]] + retval.AddRange(new List + { + new PathData("9B", "8B", "7B", "11B", "3T", "3B", "71B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Loder }, + new PathData("9B", "8B", "7B", "11B", "3B", "70B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Cleaner }, + new PathData("9B", "8B", "7B", "11B", "3T", "3B", "11B", "72B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Plating }, + new PathData("9B", "8B", "7B", "10B", "6B", "73B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Charger }, + new PathData("9B", "8B", "7B", "11B", "3T", "3B", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Buffer } + }); + + // 일반노드 20 -> + // [[ LeftTop ]] + retval.AddRange(new List + { + new PathData("20F", "9F", "8F", "7F", "11F", "3B", "71B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Loder }, + new PathData("20F", "9F", "8F", "7F", "11F", "3T", "3B", "70B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Cleaner }, + new PathData("20F", "9F", "8F", "7F", "11B", "72B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Plating }, + new PathData("20F", "9F", "8F", "7F", "11F", "3T", "3F", "11F", "7B", "10B", "6B", "73B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Charger }, + new PathData("20B", "9B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B") { Monitor = MonDir.LeftTop, NodeSta = Station.Normal, NodeEnd = Station.Buffer } + }); + + // [[ RightBtm ]] + retval.AddRange(new List + { + new PathData("20B", "9B", "8B", "7B", "11B", "3T", "3B", "71B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Loder }, + new PathData("20B", "9B", "8B", "7B", "11B", "3B", "70B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Cleaner }, + new PathData("20B", "9B", "8B", "7B", "11B", "3T", "3B", "11B", "72B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Plating }, + new PathData("20B", "9B", "8B", "7B", "10B", "6B", "73B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Charger }, + new PathData("20B", "9B", "8B", "7B", "11B", "3T", "3B", "11B", "7B", "8B", "9B", "20B", "34B", "33B", "32B", "31B", "35B", "36B") { Monitor = MonDir.RightBtm, NodeSta = Station.Normal, NodeEnd = Station.Buffer } + }); return retval; @@ -731,51 +796,20 @@ namespace AGVNavigationCore.PathFinding.Planning // 시작 태그 검색용 (예: "91F") string startTag = $"{startNode.RfidId}{motDir}"; - // 시작과 লক্ষ্য가 다른 존일 때 시작점이 일반 노드(예: 3번)라면, - // (예: 70->3 전진 후 3에서 71 로더로 갈 때) - // 현재 방향 체계상 일반노드에서의 GetMonitorMode() 결과가 최종 zonepath의 Monitor 기준과 - // 반전되어 구해지는 현상이 있으므로, 이 경우에만 monitorMode를 반대로 뒤집어서 찾는다. - if (startZone != targetZone && startNode.StationType == StationType.Normal) - { - //monitorMode = monitorMode == MapZoneMonitor.LeftTop ? MapZoneMonitor.RightBtm : MapZoneMonitor.LeftTop; - } - // 모니터방향이 일치하고 대상노드가 동일한 경로를 찾는다 var zonepath = GetMapZonePathData(); - IEnumerable candidates; - //시작이 일반노드라면 , 경로가 등록된 주변 노드로 이동해서 이후경로를 계산하자 - //일반노드용 기준은 7,3이있다. - //11번은 3로 이동해서 경로를 계산한다. - //10,6번은 7로 이동해서 경로를 계산한다. - //대상노드까지 CalculateScriptedPath를 재귀로 호출해서 계산을 완료한 후, 대상에서 목적지 계산해서 전체 경로를 만들어낸다. - if (startNode.StationType == StationType.Normal && startNode.RfidId != 3 && startNode.RfidId != 7) + //목표가 일반노드라면 단순 경로 생성해서 반환한다. + if (targetNode.StationType == Station.Normal) { - var newtargetRFID = startNode.RfidId == 11 ? 3 : 7; - var refNode = _mapNodes.FirstOrDefault(n => n.RfidId == newtargetRFID); - if (refNode != null && refNode.Id != startNode.Id) - { - // 기준 노드(7 or 3)까지의 기본 경로를 먼저 구함 - var pathToRef = this.FindBasicPath(startNode, refNode, prevNode, prevDir); - if (pathToRef != null && pathToRef.Success) - { - var lastDet = pathToRef.DetailedPath.Last(); - var secondLastNode = pathToRef.Path.Count > 1 ? pathToRef.Path[pathToRef.Path.Count - 2] : prevNode; - - // 기준 노드(7 or 3)에서 목적지까지의 경로를 재귀적으로 계산 (이 때 하드코딩된 zonepath가 활용됨) - var pathFromRef = CalculateScriptedPath(refNode, targetNode, secondLastNode, lastDet.MotorDirection); - if (pathFromRef != null && pathFromRef.Success) - { - // 중복 노드 제거를 위해 첫 번째 경로의 마지막 노드 정보를 제거하고 합침 - pathToRef.Path.RemoveAt(pathToRef.Path.Count - 1); - pathToRef.DetailedPath.RemoveAt(pathToRef.DetailedPath.Count - 1); - return CombinePaths(pathToRef, pathFromRef); - } - } - } + var simplepath = this.FindBasicPath(startNode, targetNode, prevNode, prevDir); + return simplepath; } + + IEnumerable candidates; + //이곳에서 시작,종료노드가 완전히 일치하는 경로를 찾고 있다면 그것을 바로 반환한다 //그런경우는 복잡하게 추가 계산할 필요가 없으니까 var exactMatchList = zonepath.Where(d => @@ -783,12 +817,10 @@ namespace AGVNavigationCore.PathFinding.Planning d.NodeEnd == targetNode.StationType && d.Monitor == monitorMode); - var exactMatch = exactMatchList.FirstOrDefault(d=> + var exactMatch = exactMatchList.FirstOrDefault(d => d.Path.First().StartsWith(startNode.RfidId.ToString()) && d.Path.Last().StartsWith(targetNode.RfidId.ToString())); - - if (exactMatch != null) { int startIndex = exactMatch.Path.FindIndex(p => p == startTag); @@ -803,6 +835,7 @@ namespace AGVNavigationCore.PathFinding.Planning } + // 시작Zone과 목표Zone이 다른 경우에만 하드코딩된 zonepath 검색 if (startZone != targetZone) { @@ -827,7 +860,7 @@ namespace AGVNavigationCore.PathFinding.Planning if (candidates.Any()) { - MapZonePathData bestPath = null; + PathData bestPath = null; int bestStartIndex = -1; int bestEndIndex = -1; int minPathLength = int.MaxValue; @@ -868,13 +901,29 @@ namespace AGVNavigationCore.PathFinding.Planning //추가로 처리해준다. if (startZone == MapZone.Buffer && targetZone == MapZone.Buffer) { - if (startNode.Id == targetNode.Id) + //모니터가 왼쪽이라면 턴을 해야하낟. + + if (monitorMode == MonDir.LeftTop) { - //시작과 목표가 동일하다 - if (monitorMode == MapZoneMonitor.RightBtm) + //위치는 현재위치이나 모니터방향이 일치하지 않으므로 턴을 한후 경로를 다시 찾아야한다. 오버슛이 필요하지 않다 + var BufferPath = ("36B,35B,31B,32B,33B,34B,20B,9B,8B,7B,11B,3T,3B,11B,7B,8B,9B,20B,34B,33B,32B,31B,35B,36B").Split(','); + var startTagB = startNode.RfidId + "B"; //이 경우에는 반드시 우측으로 가야하니 Back 이동을 해야 한다 + var endTagB = targetNode.RfidId + "B"; + int firstIdx = Array.IndexOf(BufferPath, startTagB); + int lastIdx = Array.LastIndexOf(BufferPath, endTagB); + if (firstIdx != -1 && lastIdx != -1 && firstIdx < lastIdx) { - //방향과 모두 일치하므로 더이상 이동할 필요가 없다 - //현재위치를 그대로 반환하자 + var slicedPath = BufferPath.Skip(firstIdx).Take(lastIdx - firstIdx + 1).ToList(); + return ConvertHardcodedPathToResult(slicedPath, startNode, prevNode, prevDir); + } + return AGVPathResult.CreateFailure("버퍼 공용 경로에서 정기 턴 경로를 생성할 수 없습니다."); + } + else + { + //여긴 모니터가 우측방향에 있는 경우이며, 우측에 있다면 큰 문제없이 좌로 이동해서 목적지를 설정하면 된다 + if (startNode.Id == targetNode.Id) + { + //방향과 모두 일치하므로 더이상 이동할 필요가 없다 - 현재위치를 그대로 반환한다 var result = new AGVPathResult { Success = true }; result.Path = new List { startNode }; result.DetailedPath = new List { new NodeMotorInfo(1, startNode.Id, startNode.RfidId, prevDir, null, MagnetDirection.Straight, false) }; @@ -883,274 +932,75 @@ namespace AGVNavigationCore.PathFinding.Planning } else { - //위치는 현재위치이나 모니터방향이 일치하지 않으므로 턴을 한후 경로를 다시 찾아야한다. - - //버퍼는 턴포인트까지는 항상B로 이동해야한다. - startTag = startNode.RfidId + "B"; - // 1.현재위치에서 턴포인트(3)까지 이동하는 경로를 찾는다. - var path1Candidate = zonepath.FirstOrDefault(d => + //버퍼위치에서 다른 버퍼위치로 이동하는 경우인데. 목표위치가 좌측에 있다면 그대로 이동하면된다. + bool isTargetLeft = targetNode.Position.X < startNode.Position.X; + if (isTargetLeft) { - int sIdx = d.Path.FindIndex(p => p == startTag); - int tIdx = d.Path.FindIndex(p => p == "3T"); - return sIdx != -1 && tIdx != -1 && sIdx <= tIdx; - }); - - if (path1Candidate == null) return AGVPathResult.CreateFailure("턴 포인트(3)로 향하는 하드코딩 경로를 찾을 수 없습니다."); - - int path1StartIdx = path1Candidate.Path.FindIndex(p => p == startTag); // 방향까지 일치하는게 우선 - int path1EndIdx = path1Candidate.Path.FindIndex(p => p == "3T"); - - var slicedPath1 = path1Candidate.Path.Skip(path1StartIdx).Take(path1EndIdx - path1StartIdx + 1).ToList(); - var path1 = ConvertHardcodedPathToResult(slicedPath1, startNode, prevNode, prevDir); - if (path1 == null || !path1.Success) return AGVPathResult.CreateFailure("턴 포인트(3) 경로 변환 실패"); - - var lastPrev = path1.Path.Count > 1 ? path1.Path[path1.Path.Count - 2] : prevNode; - var lastDir = path1.DetailedPath.Last().MotorDirection; - var turnNode = path1.Path.Last(); - - // 2.턴포인트에서 목표까지 이동하는 경로를 찾는다. - var path2Candidate = zonepath.FirstOrDefault(d => - { - if (d.Monitor != monitorMode) return false; - int tIdx = d.Path.FindIndex(p => p == "3T"); - int eIdx = d.Path.FindLastIndex(p => p == $"{targetNode.RfidId}B"); - return tIdx != -1 && eIdx != -1 && tIdx <= eIdx; - }); - - if (path2Candidate == null) return AGVPathResult.CreateFailure("턴 포인트에서 목표로 향하는 하드코딩 경로를 찾을 수 없습니다."); - - int path2StartIdx = path2Candidate.Path.FindIndex(p => p == "3T"); - int path2EndIdx = path2Candidate.Path.FindLastIndex(p => p == $"{targetNode.RfidId}B"); - - var slicedPath2 = path2Candidate.Path.Skip(path2StartIdx).Take(path2EndIdx - path2StartIdx + 1).ToList(); - var path2 = ConvertHardcodedPathToResult(slicedPath2, turnNode, lastPrev, lastDir); - if (path2 == null || !path2.Success) return AGVPathResult.CreateFailure("턴 포인트에서 목표로 향하는 경로 변환 실패"); - - // 3. 1+2 경로를 생성한다. - path1.Path.RemoveAt(path1.Path.Count - 1); - path1.DetailedPath.RemoveAt(path1.DetailedPath.Count - 1); - - // 경로를 반환한다. - return CombinePaths(path1, path2); - } - } - else - { - //시작과 목표노드가 다른경우의 처리 - if (monitorMode == MapZoneMonitor.RightBtm) - { - //모니터가 우측이라면 방향은 맞다 - if (startNode.StationType == StationType.Normal) - { - //일반노드에서 시작했다면 그대로 목표로 이동한다 - //A*로 경로를 생성해서 진행한다.모터는 B로 이동하면된다 - return this.FindBasicPath(startNode, targetNode, prevNode, AgvDirection.Backward); + //대상이 좌측에 있으므로 기본 경로내에서 + var BufferPath = ("7B,8B,9B,20B,34B,33B,32B,31B,35B,36B").Split(','); + var startTagB = startNode.RfidId + "B"; + var endTagB = targetNode.RfidId + "B"; + int firstIdx = Array.IndexOf(BufferPath, startTagB); + int lastIdx = Array.LastIndexOf(BufferPath, endTagB); + if (firstIdx != -1 && lastIdx != -1 && firstIdx < lastIdx) + { + var slicedPath = BufferPath.Skip(firstIdx).Take(lastIdx - firstIdx + 1).ToList(); + return ConvertHardcodedPathToResult(slicedPath, startNode, prevNode, prevDir); + } + return AGVPathResult.CreateFailure("버퍼 공용 경로에서 정기 턴 경로를 생성할 수 없습니다."); } else { - //버퍼위치에서 다른 버퍼위치로 이동하는 경우인데. - //목표위치가 좌측에 있다면 그대로 이동하면된다. - bool isTargetLeft = targetNode.Position.X < startNode.Position.X; - if (isTargetLeft) + // 목표위치가 우측에 있다면 목표위치보다 한번 더 우측으로 이동해서 좌측으로 다시 진입 + var endBufferNode = _mapNodes.FirstOrDefault(n => n.RfidId == 7); + if (endBufferNode == null) return AGVPathResult.CreateFailure("버퍼 끝 노드(7)를 찾을 수 없습니다."); + + var overPathFull = this.FindBasicPath(startNode, endBufferNode, prevNode, AgvDirection.Forward); + if (overPathFull == null || !overPathFull.Success) + return AGVPathResult.CreateFailure("Overshoot 전체 경로(7번 방향) 탐색 실패"); + + int targetIdx = overPathFull.Path.FindIndex(n => n.Id == targetNode.Id); + if (targetIdx == -1 || targetIdx == overPathFull.Path.Count - 1) + return AGVPathResult.CreateFailure("Overshoot를 위한 여유 공간(다음 노드)이 없습니다."); + + // 목표 노드 다음 노드(오버슈트 지점)까지만 잘라내어 새 경로 구성 + var overPath = new AGVPathResult { - return this.FindBasicPath(startNode, targetNode, prevNode, AgvDirection.Backward); - } - else + Success = true, + Path = overPathFull.Path.Take(targetIdx + 2).ToList(), + DetailedPath = overPathFull.DetailedPath.Take(targetIdx + 2).ToList() + }; + + var autoOverNode = overPath.Path.Last(); // 오버슈트 된 곳 + var lastDet = overPath.DetailedPath.Last(); + lastDet.MotorDirection = AgvDirection.Backward; //방향을 변경 해준다. + + // 오버슈트 위치에서 다시 Backward로 뒤로 한 칸 이동해 targetNode에 최종 진입 + overPath.Path.Add(targetNode); + overPath.DetailedPath.Add(new NodeMotorInfo(lastDet.seq + 1, targetNode.Id, targetNode.RfidId, AgvDirection.Backward) { - // 목표위치가 우측에 있다면 목표위치보다 한번 더 우측으로 이동해서 좌측으로 다시 진입 - var endBufferNode = _mapNodes.FirstOrDefault(n => n.RfidId == 7); - if (endBufferNode == null) return AGVPathResult.CreateFailure("버퍼 끝 노드(7)를 찾을 수 없습니다."); + Speed = SpeedLevel.L, + }); - var overPathFull = this.FindBasicPath(startNode, endBufferNode, prevNode, AgvDirection.Forward); - if (overPathFull == null || !overPathFull.Success) - return AGVPathResult.CreateFailure("Overshoot 전체 경로(7번 방향) 탐색 실패"); - - int targetIdx = overPathFull.Path.FindIndex(n => n.Id == targetNode.Id); - if (targetIdx == -1 || targetIdx == overPathFull.Path.Count - 1) - return AGVPathResult.CreateFailure("Overshoot를 위한 여유 공간(다음 노드)이 없습니다."); - - // 목표 노드 다음 노드(오버슈트 지점)까지만 잘라내어 새 경로 구성 - var overPath = new AGVPathResult - { - Success = true, - Path = overPathFull.Path.Take(targetIdx + 2).ToList(), - DetailedPath = overPathFull.DetailedPath.Take(targetIdx + 2).ToList() - }; - - var autoOverNode = overPath.Path.Last(); // 오버슈트 된 곳 - var lastDet = overPath.DetailedPath.Last(); - lastDet.MotorDirection = AgvDirection.Backward; //방향을 변경 해준다. - - // 오버슈트 위치에서 다시 Backward로 뒤로 한 칸 이동해 targetNode에 최종 진입 - overPath.Path.Add(targetNode); - overPath.DetailedPath.Add(new NodeMotorInfo(lastDet.seq + 1, targetNode.Id, targetNode.RfidId, AgvDirection.Backward) - { - Speed = SpeedLevel.L, - }); - - return overPath; - } + return overPath; } - } - else - { - //모니터가 좌측이라면 턴이 필요하다. 버퍼에서 -> 턴위치까지 경로를 계산한다. - //1. 현재위치에서 턴까지 후진으로 이동을한다(현재는 사용자의 코딩 스타일에 맞춰 하드코딩된 zonepath에서 추출 적용) - var path1Candidate = zonepath.FirstOrDefault(d => - { - int sIdx = d.Path.FindIndex(p => p == startTag); - int tIdx = d.Path.FindIndex(p => p == "3T"); - return sIdx != -1 && tIdx != -1 && sIdx <= tIdx; - }); - if (path1Candidate == null) return AGVPathResult.CreateFailure("턴 포인트(3)로 향하는 하드코딩 경로를 찾을 수 없습니다."); - - int path1StartIdx = path1Candidate.Path.FindIndex(p => p == startTag); - int path1EndIdx = path1Candidate.Path.FindIndex(p => p == "3T"); - - var slicedPath1 = path1Candidate.Path.Skip(path1StartIdx).Take(path1EndIdx - path1StartIdx + 1).ToList(); - var path1 = ConvertHardcodedPathToResult(slicedPath1, startNode, prevNode, prevDir); - if (path1 == null || !path1.Success) return AGVPathResult.CreateFailure("턴 포인트(3) 경로 변환 실패"); - - var lastPrev = path1.Path.Count > 1 ? path1.Path[path1.Path.Count - 2] : prevNode; - var lastDir = path1.DetailedPath.Last().MotorDirection; - var turnNode = path1.Path.Last(); - - //2. zonepath 에서 해당 경로를 찾아서 업데이트 한다. - var path2Candidate = zonepath.FirstOrDefault(d => - { - if (d.Monitor != monitorMode) return false; - int tIdx = d.Path.FindIndex(p => p == "3T"); - int eIdx = d.Path.FindLastIndex(p => p == $"{targetNode.RfidId}B"); - return tIdx != -1 && eIdx != -1 && tIdx <= eIdx; - }); - - if (path2Candidate == null) return AGVPathResult.CreateFailure("턴 포인트에서 목표로 향하는 하드코딩 경로를 찾을 수 없습니다."); - - int path2StartIdx = path2Candidate.Path.FindIndex(p => p == "3T"); - int path2EndIdx = path2Candidate.Path.FindLastIndex(p => p == $"{targetNode.RfidId}B"); - - var slicedPath2 = path2Candidate.Path.Skip(path2StartIdx).Take(path2EndIdx - path2StartIdx + 1).ToList(); - var path2 = ConvertHardcodedPathToResult(slicedPath2, turnNode, lastPrev, lastDir); - if (path2 == null || !path2.Success) return AGVPathResult.CreateFailure("턴 포인트에서 목표로 향하는 경로 변환 실패"); - - // 3. 1+2 경로 통합 - path1.Path.RemoveAt(path1.Path.Count - 1); - path1.DetailedPath.RemoveAt(path1.DetailedPath.Count - 1); - - return CombinePaths(path1, path2); } } - } - else if (startZone == MapZone.Loader && targetZone == MapZone.Loader) - { - //모니터가 아래에 있다면 방향이 일치하지 않으므로 턴(3)을 해야 한후 목표까지 이동해야한다 - if (monitorMode == MapZoneMonitor.RightBtm) - { - var newpath = new List { "71B", "3T", "3B", "71B" }; - int startIndex = newpath.FindIndex(p => matchNode(p, startNode.RfidId)); - if (startIndex != -1) newpath = newpath.Skip(startIndex).ToList(); - return ConvertHardcodedPathToResult(newpath, startNode, prevNode, prevDir); - } - else if (startNode.RfidId.Equals(targetNode.RfidId)) //시작과 목표가 같을경우 - { - var result = new AGVPathResult { Success = true }; - result.Path = new List { startNode }; - result.DetailedPath = new List { new NodeMotorInfo(1, startNode.Id, startNode.RfidId, prevDir, null, MagnetDirection.Straight, false) }; - result.TotalDistance = 0; - return result; - } - else - { - //시작과 목표가 다른경우이므로 현재위치에서 목표까지 단순경로 생성해서 반환하면 된다. - return this.FindBasicPath(startNode, targetNode, prevNode, prevDir); - } - } - else if (startZone == MapZone.Cleaner && targetZone == MapZone.Cleaner) - { - //모니터가 위에 있다면 방향이 일치하지 않으므로 턴(3)을 해야 한후 목표까지 이동해야한다 - if (monitorMode == MapZoneMonitor.LeftTop) - { - var newpath = new List { "70B", "3T", "3B", "70B" }; - int startIndex = newpath.FindIndex(p => matchNode(p, startNode.RfidId)); - if (startIndex != -1) newpath = newpath.Skip(startIndex).ToList(); - return ConvertHardcodedPathToResult(newpath, startNode, prevNode, prevDir); - } - else if (startNode.RfidId.Equals(targetNode.RfidId)) //시작과 목표가 같을경우 - { - var result = new AGVPathResult { Success = true }; - result.Path = new List { startNode }; - result.DetailedPath = new List { new NodeMotorInfo(1, startNode.Id, startNode.RfidId, prevDir, null, MagnetDirection.Straight, false) }; - result.TotalDistance = 0; - return result; - } - else - { - //시작과 목표가 다른경우이므로 현재위치에서 목표까지 단순경로 생성해서 반환하면 된다. - return this.FindBasicPath(startNode, targetNode, prevNode, prevDir); - } - } - else if (startZone == MapZone.Plating && targetZone == MapZone.Plating) - { - //모티너가 좌측에 있다면 방향이 일치하지 않으므로 턴(3)을 해야 한후 목표까지 이동해야한다. - if (monitorMode == MapZoneMonitor.LeftTop) - { - var newpath = new List { "72B", "11B", "3T", "3B", "11B", "72B" }; - int startIndex = newpath.FindIndex(p => matchNode(p, startNode.RfidId)); - if (startIndex != -1) newpath = newpath.Skip(startIndex).ToList(); - return ConvertHardcodedPathToResult(newpath, startNode, prevNode, prevDir); - } - else if (startNode.RfidId.Equals(targetNode.RfidId)) //시작과 목표가 같을경우 - { - var result = new AGVPathResult { Success = true }; - result.Path = new List { startNode }; - result.DetailedPath = new List { new NodeMotorInfo(1, startNode.Id, startNode.RfidId, prevDir, null, MagnetDirection.Straight, false) }; - result.TotalDistance = 0; - return result; - } - else - { - //시작과 목표가 다른경우이므로 현재위치에서 목표까지 단순경로 생성해서 반환하면 된다. - return this.FindBasicPath(startNode, targetNode, prevNode, prevDir); - } - } - else if (startZone == MapZone.Charger && targetZone == MapZone.Charger) - { - //모니터가 위에 있다면 방향이 일치하지 않으므로 턴(3)을 해야 한후 목표까지 이동해야한다 - if (monitorMode == MapZoneMonitor.LeftTop) - { - var newpath = new List { "73B", "6B", "10B", "7F", "11F", "3T", "3F", "11F", "7B", "10B", "6B", "73B" }; - int startIndex = newpath.FindIndex(p => matchNode(p, startNode.RfidId)); - if (startIndex != -1) newpath = newpath.Skip(startIndex).ToList(); - return ConvertHardcodedPathToResult(newpath, startNode, prevNode, prevDir); - } - else if (startNode.RfidId.Equals(targetNode.RfidId)) //시작과 목표가 같을경우 - { - var result = new AGVPathResult { Success = true }; - result.Path = new List { startNode }; - result.DetailedPath = new List { new NodeMotorInfo(1, startNode.Id, startNode.RfidId, prevDir, null, MagnetDirection.Straight, false) }; - result.TotalDistance = 0; - return result; - } - else - { - //시작과 목표가 다른경우이므로 현재위치에서 목표까지 단순경로 생성해서 반환하면 된다. - return this.FindBasicPath(startNode, targetNode, prevNode, prevDir); - } + } else { // } - return AGVPathResult.CreateFailure("경로를 계산할 수 없습니다"); } - private MapZoneMonitor GetMonitorMode(MapNode startNode, MapNode prevNode, AgvDirection prevDir) + private MonDir GetMonitorMode(MapNode startNode, MapNode prevNode, AgvDirection prevDir) { - if (prevNode == null) return MapZoneMonitor.RightBtm; + if (prevNode == null) return MonDir.RightBtm; //모니터방향도 상황에 따라 다른경우가 있다. 이것도 하드코딩하다. //prev -> start 와 모터방향(prevdir) 에 따라서 경우의 수를 입력한다. @@ -1162,16 +1012,16 @@ namespace AGVNavigationCore.PathFinding.Planning if (prevDir == AgvDirection.Forward) { if (prevNode.RfidId == 70) - return MapZoneMonitor.RightBtm; + return MonDir.RightBtm; else if (prevNode.RfidId == 11 || prevNode.RfidId == 71) - return MapZoneMonitor.LeftTop; + return MonDir.LeftTop; } else if (prevDir == AgvDirection.Backward) { if (prevNode.RfidId == 70) - return MapZoneMonitor.LeftTop; + return MonDir.LeftTop; else if (prevNode.RfidId == 11 || prevNode.RfidId == 71) - return MapZoneMonitor.RightBtm; + return MonDir.RightBtm; } } @@ -1181,16 +1031,16 @@ namespace AGVNavigationCore.PathFinding.Planning if (prevDir == AgvDirection.Forward) { if (prevNode.RfidId == 10 || prevNode.RfidId == 11) - return MapZoneMonitor.RightBtm; + return MonDir.RightBtm; else if (prevNode.RfidId == 8) - return MapZoneMonitor.LeftTop; + return MonDir.LeftTop; } else if (prevDir == AgvDirection.Backward) { if (prevNode.RfidId == 10 || prevNode.RfidId == 11) - return MapZoneMonitor.LeftTop; + return MonDir.LeftTop; else if (prevNode.RfidId == 8) - return MapZoneMonitor.RightBtm; + return MonDir.RightBtm; } } @@ -1200,12 +1050,12 @@ namespace AGVNavigationCore.PathFinding.Planning if (prevDir == AgvDirection.Forward) { if (prevNode.RfidId == 3) - return MapZoneMonitor.LeftTop; + return MonDir.LeftTop; } else if (prevDir == AgvDirection.Backward) { if (prevNode.RfidId == 3) - return MapZoneMonitor.RightBtm; + return MonDir.RightBtm; } } @@ -1215,12 +1065,12 @@ namespace AGVNavigationCore.PathFinding.Planning if (prevDir == AgvDirection.Forward) { if (prevNode.RfidId == 3) - return MapZoneMonitor.RightBtm; + return MonDir.RightBtm; } else if (prevDir == AgvDirection.Backward) { if (prevNode.RfidId == 3) - return MapZoneMonitor.LeftTop; + return MonDir.LeftTop; } } @@ -1231,12 +1081,12 @@ namespace AGVNavigationCore.PathFinding.Planning if (prevDir == AgvDirection.Forward) { if (prevNode.RfidId == 6) - return MapZoneMonitor.LeftTop; + return MonDir.LeftTop; } else if (prevDir == AgvDirection.Backward) { if (prevNode.RfidId == 6) - return MapZoneMonitor.RightBtm; + return MonDir.RightBtm; } } @@ -1246,12 +1096,12 @@ namespace AGVNavigationCore.PathFinding.Planning if (prevDir == AgvDirection.Forward) { if (prevNode.RfidId == 11) - return MapZoneMonitor.LeftTop; + return MonDir.LeftTop; } else if (prevDir == AgvDirection.Backward) { if (prevNode.RfidId == 11) - return MapZoneMonitor.RightBtm; + return MonDir.RightBtm; } } @@ -1261,27 +1111,41 @@ namespace AGVNavigationCore.PathFinding.Planning if (prevDir == AgvDirection.Forward) { if (prevNode.RfidId == 20) - return MapZoneMonitor.LeftTop; + return MonDir.LeftTop; else { int bdx = startNode.Position.X - prevNode.Position.X; - if (bdx < 0) return MapZoneMonitor.LeftTop; - else return MapZoneMonitor.RightBtm; + if (bdx < 0) return MonDir.LeftTop; + else return MonDir.RightBtm; } } else if (prevDir == AgvDirection.Backward) { if (prevNode.RfidId == 20) - return MapZoneMonitor.RightBtm; + return MonDir.RightBtm; else { int bdx = startNode.Position.X - prevNode.Position.X; - if (bdx < 0) return MapZoneMonitor.RightBtm; - else return MapZoneMonitor.LeftTop; + if (bdx < 0) return MonDir.RightBtm; + else return MonDir.LeftTop; } } } + if (startNode.RfidId == 8 || startNode.RfidId == 9 || startNode.RfidId == 20) + { + if(prevNode.Position.X > startNode.Position.X) //오른쪽에서 왔다. + { + if (prevDir == AgvDirection.Forward) return MonDir.LeftTop; //오른쪽에서 전진으로 왔다면 모니터는 좌측에있다. + else return MonDir.RightBtm; //오른쪽에서 후진으로 왔다면 모니터는 우측에 있다. + } + else //왼쪽에서 왔다 + { + if (prevDir == AgvDirection.Forward) return MonDir.RightBtm; + else return MonDir.LeftTop; + } + } + int dx = startNode.Position.X - prevNode.Position.X; int dy = startNode.Position.Y - prevNode.Position.Y; @@ -1296,7 +1160,7 @@ namespace AGVNavigationCore.PathFinding.Planning isMonitorLeft = (prevDir == AgvDirection.Forward); } - return isMonitorLeft ? MapZoneMonitor.LeftTop : MapZoneMonitor.RightBtm; + return isMonitorLeft ? MonDir.LeftTop : MonDir.RightBtm; @@ -1463,8 +1327,8 @@ namespace AGVNavigationCore.PathFinding.Planning // 2. Buffer-to-Buffer 예외 처리 // 05~31 구간 체크 - var node_buff_sta = _mapNodes.Where(t => t.StationType == StationType.Buffer).OrderBy(s => s.RfidId).FirstOrDefault();// (n => n.RfidId == 5); - var node_buff_end = _mapNodes.Where(t => t.StationType == StationType.Buffer).OrderByDescending(s => s.RfidId).FirstOrDefault();// + var node_buff_sta = _mapNodes.Where(t => t.StationType == Station.Buffer).OrderBy(s => s.RfidId).FirstOrDefault();// (n => n.RfidId == 5); + var node_buff_end = _mapNodes.Where(t => t.StationType == Station.Buffer).OrderByDescending(s => s.RfidId).FirstOrDefault();// bool fixpath = false; Retval = null; @@ -1490,7 +1354,7 @@ namespace AGVNavigationCore.PathFinding.Planning { - if (targetNode.StationType == StationType.Limit || targetNode.StationType == StationType.Normal) + if (targetNode.StationType == Station.Lmt || targetNode.StationType == Station.Normal) { //일반노드라면 방향 무관하게 그냥 이동하게한다. Retval = this.FindBasicPath(startNode, targetNode, prevNode, prevDir); @@ -1668,7 +1532,7 @@ namespace AGVNavigationCore.PathFinding.Planning // 기타 검증 로직 (마지막 노드 도킹, 시작노드 일치 등) var lastnode = Retval.Path.Last(); - if (lastnode.StationType != StationType.Normal) + if (lastnode.StationType != Station.Normal) { var lastnodePath = Retval.DetailedPath.Last(); if (lastnode.DockDirection == DockingDirection.Forward && lastnodePath.MotorDirection != AgvDirection.Forward) @@ -1716,15 +1580,15 @@ namespace AGVNavigationCore.PathFinding.Planning var firstnode = Retval.Path.FirstOrDefault(); var firstDet = Retval.DetailedPath.First(); var failmessage = $"[{firstnode.ID2}] 노드의 시작모터 방향({firstDet.MotorDirection})이 올바르지 않습니다"; - if (firstnode.StationType == StationType.Charger && firstDet.MotorDirection != AgvDirection.Forward) + if (firstnode.StationType == Station.Charger && firstDet.MotorDirection != AgvDirection.Forward) return AGVPathResult.CreateFailure(failmessage); - else if (firstnode.StationType == StationType.Loader && firstDet.MotorDirection != AgvDirection.Backward) + else if (firstnode.StationType == Station.Loder && firstDet.MotorDirection != AgvDirection.Backward) return AGVPathResult.CreateFailure(failmessage); - else if (firstnode.StationType == StationType.Cleaner && firstDet.MotorDirection != AgvDirection.Backward) + else if (firstnode.StationType == Station.Cleaner && firstDet.MotorDirection != AgvDirection.Backward) return AGVPathResult.CreateFailure(failmessage); - else if (firstnode.StationType == StationType.Plating && firstDet.MotorDirection != AgvDirection.Backward) + else if (firstnode.StationType == Station.Plating && firstDet.MotorDirection != AgvDirection.Backward) return AGVPathResult.CreateFailure(failmessage); - else if (firstnode.StationType == StationType.Buffer) + else if (firstnode.StationType == Station.Buffer) { //버퍼는 도킹이되어잇느닞 확인하고. 그때 방향을 체크해야한다. } @@ -1803,7 +1667,7 @@ namespace AGVNavigationCore.PathFinding.Planning if (deltaX < 0) { - var nextNode = start.ConnectedMapNodes.Where(t => t.Id != prev.Id && t.StationType == StationType.Buffer).FirstOrDefault(); + var nextNode = start.ConnectedMapNodes.Where(t => t.Id != prev.Id && t.StationType == Station.Buffer).FirstOrDefault(); if (nextNode != null) { retval.DetailedPath.Add(new NodeMotorInfo(1, target.Id, target.RfidId, prevDir)); @@ -1833,7 +1697,7 @@ namespace AGVNavigationCore.PathFinding.Planning else { retval.DetailedPath.Add(new NodeMotorInfo(1, target.Id, target.RfidId, prevDir)); - var nextNode = start.ConnectedMapNodes.Where(t => t.Id != prev.Id && t.StationType == StationType.Buffer).FirstOrDefault(); + var nextNode = start.ConnectedMapNodes.Where(t => t.Id != prev.Id && t.StationType == Station.Buffer).FirstOrDefault(); retval.Path.Add(nextNode); var lastDefailt = retval.DetailedPath.Last(); retval.DetailedPath.Add(new NodeMotorInfo(lastDefailt.seq + 1, nextNode.Id, nextNode.RfidId, AgvDirection.Backward) @@ -1880,7 +1744,7 @@ namespace AGVNavigationCore.PathFinding.Planning if (deltaX > 0) isMonitorLeft = PrevDirection == AgvDirection.Backward; else isMonitorLeft = PrevDirection == AgvDirection.Forward; - if (targetNode.StationType == StationType.Loader) + if (targetNode.StationType == Station.Loder) { deltaX = GTNode.Position.Y - PrevNode.Position.Y; if (deltaX < 0) isMonitorLeft = PrevDirection == AgvDirection.Backward; @@ -1889,11 +1753,11 @@ namespace AGVNavigationCore.PathFinding.Planning switch (targetNode.StationType) { - case StationType.Loader: - case StationType.Charger: - case StationType.Cleaner: - case StationType.Plating: - case StationType.Buffer: + case Station.Loder: + case Station.Charger: + case Station.Cleaner: + case Station.Plating: + case Station.Buffer: var rlt1 = new AGVPathResult(); rlt1.Success = true; @@ -1944,11 +1808,11 @@ namespace AGVNavigationCore.PathFinding.Planning private MapNode GetTurnNode(MapNode node) { var rfid = 0; - if (node.StationType == StationType.Cleaner) rfid = 3; - else if (node.StationType == StationType.Charger) rfid = 3; - else if (node.StationType == StationType.Plating) rfid = 3; - else if (node.StationType == StationType.Loader) rfid = 3; - else if (node.StationType == StationType.Buffer) rfid = 3; + if (node.StationType == Station.Cleaner) rfid = 3; + else if (node.StationType == Station.Charger) rfid = 3; + else if (node.StationType == Station.Plating) rfid = 3; + else if (node.StationType == Station.Loder) rfid = 3; + else if (node.StationType == Station.Buffer) rfid = 3; if (rfid == 0) return null; return _mapNodes.FirstOrDefault(t => t.RfidId == rfid); @@ -1959,7 +1823,7 @@ namespace AGVNavigationCore.PathFinding.Planning switch (gatewayNode.RfidId) { case 6: - if (targetNode.StationType == StationType.Buffer) + if (targetNode.StationType == Station.Buffer) return new List { "0006BL", "0007FS", "0013BL", "0006BL" }; else return new List { "0006BL", "0007FS", "0013BL", "0006BS" }; diff --git a/AGVLogic/AGVSimulator/fMain.cs b/AGVLogic/AGVSimulator/fMain.cs index efb1690..466df95 100644 --- a/AGVLogic/AGVSimulator/fMain.cs +++ b/AGVLogic/AGVSimulator/fMain.cs @@ -1598,7 +1598,7 @@ namespace AGVSimulator.Forms MotorDirection = directionName, CurrentPosition = GetNodeDisplayName(currentNode), TargetPosition = GetNodeDisplayName(targetNode), - DockingPosition = (targetNode.StationType == StationType.Charger) ? "충전기" : "장비" + DockingPosition = (targetNode.StationType == Station.Charger) ? "충전기" : "장비" }; if (calcResult.Success) diff --git a/HMI/Project/StateMachine/Step/_SM_RUN.cs b/HMI/Project/StateMachine/Step/_SM_RUN.cs index b0aede7..2f1858b 100644 --- a/HMI/Project/StateMachine/Step/_SM_RUN.cs +++ b/HMI/Project/StateMachine/Step/_SM_RUN.cs @@ -123,7 +123,7 @@ namespace Project switch (target.StationType) { - case AGVNavigationCore.Models.StationType.Buffer: + case AGVNavigationCore.Models.Station.Buffer: var lastPath = PUB._virtualAGV.CurrentPath.DetailedPath.LastOrDefault(); if (lastPath.NodeId.Equals(PUB._virtualAGV.CurrentNode.Id)) { @@ -139,19 +139,19 @@ namespace Project PUB.sm.SetNewRunStep(ERunStep.ERROR); } break; - case AGVNavigationCore.Models.StationType.Charger: + case AGVNavigationCore.Models.Station.Charger: break; - case AGVNavigationCore.Models.StationType.Loader: + case AGVNavigationCore.Models.Station.Loder: PUB.XBE.StepMC = Device.eDocStep.ReadyForEnter; break; - case AGVNavigationCore.Models.StationType.Plating: + case AGVNavigationCore.Models.Station.Plating: PUB.XBE.StepMC = Device.eDocStep.ReadyForEnter; break; - case AGVNavigationCore.Models.StationType.Cleaner: + case AGVNavigationCore.Models.Station.Cleaner: PUB.XBE.StepMC = Device.eDocStep.ReadyForEnter; break; diff --git a/HMI/Project/StateMachine/Step/_SM_RUN_BUFFER_IN.cs b/HMI/Project/StateMachine/Step/_SM_RUN_BUFFER_IN.cs index 3851c8e..c6cd4e0 100644 --- a/HMI/Project/StateMachine/Step/_SM_RUN_BUFFER_IN.cs +++ b/HMI/Project/StateMachine/Step/_SM_RUN_BUFFER_IN.cs @@ -69,7 +69,7 @@ namespace Project else if (PUB.sm.RunStepSeq == idx++) { //버퍼 노드 여부 확인 - if (PUB._virtualAGV.CurrentNode.StationType != AGVNavigationCore.Models.StationType.Buffer) + if (PUB._virtualAGV.CurrentNode.StationType != AGVNavigationCore.Models.Station.Buffer) { SetRunStepError(ENIGProtocol.AGVErrorCode.NOT_BUFFERPOINT, $"[{funcname}-{PUB.sm.RunStepSeq}] 현재 위치가 버퍼가 아닙니다({PUB._virtualAGV.CurrentNode.StationType})"); return false; diff --git a/HMI/Project/StateMachine/Step/_SM_RUN_BUFFER_OUT.cs b/HMI/Project/StateMachine/Step/_SM_RUN_BUFFER_OUT.cs index 98375a9..f447991 100644 --- a/HMI/Project/StateMachine/Step/_SM_RUN_BUFFER_OUT.cs +++ b/HMI/Project/StateMachine/Step/_SM_RUN_BUFFER_OUT.cs @@ -71,7 +71,7 @@ namespace Project else if (PUB.sm.RunStepSeq == idx++) { //버퍼 노드 여부 확인 - if (PUB._virtualAGV.CurrentNode.StationType != AGVNavigationCore.Models.StationType.Buffer) + if (PUB._virtualAGV.CurrentNode.StationType != AGVNavigationCore.Models.Station.Buffer) { SetRunStepError(ENIGProtocol.AGVErrorCode.NOT_BUFFERPOINT, $"[{funcname}-{PUB.sm.RunStepSeq}] 현재 위치가 버퍼가 아닙니다({PUB._virtualAGV.CurrentNode.StationType})"); return false; diff --git a/HMI/Project/StateMachine/Step/_SM_RUN_ENTER.cs b/HMI/Project/StateMachine/Step/_SM_RUN_ENTER.cs index 53f3771..df465d6 100644 --- a/HMI/Project/StateMachine/Step/_SM_RUN_ENTER.cs +++ b/HMI/Project/StateMachine/Step/_SM_RUN_ENTER.cs @@ -38,9 +38,9 @@ namespace Project else if (PUB.sm.RunStepSeq == idx++) { //장비 노드 여부 확인 (버퍼가 아닌 도킹 가능 노드여야 함) - if (PUB._virtualAGV.CurrentNode.StationType != StationType.Loader && - PUB._virtualAGV.CurrentNode.StationType != StationType.Plating && - PUB._virtualAGV.CurrentNode.StationType != StationType.Cleaner) + if (PUB._virtualAGV.CurrentNode.StationType != Station.Loder && + PUB._virtualAGV.CurrentNode.StationType != Station.Plating && + PUB._virtualAGV.CurrentNode.StationType != Station.Cleaner) { SetRunStepError(ENIGProtocol.AGVErrorCode.NOT_EQUIPMENTPOINT, $"[{funcname}-{PUB.sm.RunStepSeq}] 현재 위치가 장비 노드가 아닙니다({PUB._virtualAGV.CurrentNode.StationType})"); return false; diff --git a/HMI/Project/StateMachine/Step/_SM_RUN_EXIT.cs b/HMI/Project/StateMachine/Step/_SM_RUN_EXIT.cs index 5adaffa..65d2f5a 100644 --- a/HMI/Project/StateMachine/Step/_SM_RUN_EXIT.cs +++ b/HMI/Project/StateMachine/Step/_SM_RUN_EXIT.cs @@ -39,9 +39,9 @@ namespace Project else if (PUB.sm.RunStepSeq == idx++) { //장비 노드 여부 확인 (버퍼가 아닌 도킹 가능 노드여야 함) - if (PUB._virtualAGV.CurrentNode.StationType != StationType.Loader && - PUB._virtualAGV.CurrentNode.StationType != StationType.Plating && - PUB._virtualAGV.CurrentNode.StationType != StationType.Cleaner) + if (PUB._virtualAGV.CurrentNode.StationType != Station.Loder && + PUB._virtualAGV.CurrentNode.StationType != Station.Plating && + PUB._virtualAGV.CurrentNode.StationType != Station.Cleaner) { SetRunStepError(ENIGProtocol.AGVErrorCode.NOT_EQUIPMENTPOINT, $"[{funcname}-{PUB.sm.RunStepSeq}] 현재 위치가 장비 노드가 아닙니다({PUB._virtualAGV.CurrentNode.StationType})"); return false; diff --git a/HMI/Project/StateMachine/Step/_Util.cs b/HMI/Project/StateMachine/Step/_Util.cs index e554195..dadaae3 100644 --- a/HMI/Project/StateMachine/Step/_Util.cs +++ b/HMI/Project/StateMachine/Step/_Util.cs @@ -319,7 +319,7 @@ namespace Project // 목적지 도착 여부 확인 if (PUB.AGV.signal1.mark_sensor == false) { - if (PUB._virtualAGV.TargetNode.StationType != StationType.Normal) + if (PUB._virtualAGV.TargetNode.StationType != Station.Normal) { PUB.log.AddAT($"목표({PUB._virtualAGV.TargetNode.RfidId})도착되었으나 마크센서가 감지되지 않아 완료처리 하지않습니다"); return false; diff --git a/HMI/Project/StateMachine/_AGV.cs b/HMI/Project/StateMachine/_AGV.cs index 3aae25e..edcf140 100644 --- a/HMI/Project/StateMachine/_AGV.cs +++ b/HMI/Project/StateMachine/_AGV.cs @@ -72,7 +72,7 @@ namespace Project PUB.log.Add($"AGV Turn Complete:{e.Direction}"); //일반노드에서 턴작업이 진행되었다면, 이전경로와 현재경로의 모터 방향을 바꿔준다(일반노드에서만 사용) - if (PUB._virtualAGV.CurrentNode != null && PUB._virtualAGV.CurrentNode.StationType == StationType.Normal) + if (PUB._virtualAGV.CurrentNode != null && PUB._virtualAGV.CurrentNode.StationType == Station.Normal) { var prevnodeid = PUB._virtualAGV.PrevNode;//.Id; var currnodeid = PUB._virtualAGV.CurrentNode;//.Id; @@ -270,7 +270,7 @@ namespace Project PUB.SaveLastPosition(); //노드가 들어왔는데. 일반 노드라면.. 턴 정보를 제거한다. - if (CurrentNode.StationType != StationType.Buffer && PUB._virtualAGV.Turn != AGVTurn.None) + if (CurrentNode.StationType != Station.Buffer && PUB._virtualAGV.Turn != AGVTurn.None) { PUB.log.AddAT($"현재노드위치가 버퍼가 아니라서 턴정보를 초기화합니다{PUB._virtualAGV.Turn}"); PUB._virtualAGV.Turn = AGVTurn.None; diff --git a/HMI/Project/StateMachine/_Xbee.cs b/HMI/Project/StateMachine/_Xbee.cs index e67fed9..6188c41 100644 --- a/HMI/Project/StateMachine/_Xbee.cs +++ b/HMI/Project/StateMachine/_Xbee.cs @@ -109,16 +109,16 @@ namespace Project //버퍼의 경우 직전에 멈추기 때문에 스테이션종류를 보정해준다 var StationType = currNode.StationType; - if (StationType == StationType.Normal && targetNode.StationType == StationType.Buffer) - StationType = StationType.Buffer; + if (StationType == Station.Normal && targetNode.StationType == Station.Buffer) + StationType = Station.Buffer; ERunStep nextStep = ERunStep.READY; switch (StationType) { - case StationType.Loader: nextStep = ERunStep.LOADER_IN; break; - case StationType.Cleaner: nextStep = ERunStep.UNLOADER_IN; break; - case StationType.Buffer: nextStep = ERunStep.BUFFER_IN; break; - case StationType.Plating: nextStep = ERunStep.CLEANER_IN; break; + case Station.Loder: nextStep = ERunStep.LOADER_IN; break; + case Station.Cleaner: nextStep = ERunStep.UNLOADER_IN; break; + case Station.Buffer: nextStep = ERunStep.BUFFER_IN; break; + case Station.Plating: nextStep = ERunStep.CLEANER_IN; break; default: PUB.log.AddE($"[{logPrefix}-{cmd}] 해당 노드타입({StationType})은 작업을 지원하지 않습니다."); return; @@ -190,16 +190,16 @@ namespace Project //버퍼의 경우 직전에 멈추기 때문에 스테이션종류를 보정해준다 var StationType = currNode.StationType; - if (StationType == StationType.Normal && targetNode.StationType == StationType.Buffer) - StationType = StationType.Buffer; + if (StationType == Station.Normal && targetNode.StationType == Station.Buffer) + StationType = Station.Buffer; ERunStep nextStep = ERunStep.READY; switch (StationType) { - case StationType.Loader: nextStep = ERunStep.LOADER_OUT; break; - case StationType.Cleaner: nextStep = ERunStep.UNLOADER_OUT; break; - case StationType.Buffer: nextStep = ERunStep.BUFFER_OUT; break; - case StationType.Plating: nextStep = ERunStep.CLEANER_OUT; break; + case Station.Loder: nextStep = ERunStep.LOADER_OUT; break; + case Station.Cleaner: nextStep = ERunStep.UNLOADER_OUT; break; + case Station.Buffer: nextStep = ERunStep.BUFFER_OUT; break; + case Station.Plating: nextStep = ERunStep.CLEANER_OUT; break; default: PUB.logdebug.Add($"[AI_TRACE] REJECTED: Unsupported station type {StationType} for command {cmd}"); PUB.log.AddE($"[{logPrefix}-{cmd}] 해당 노드타입({StationType})은 작업을 지원하지 않습니다."); @@ -287,7 +287,7 @@ namespace Project //노드가 들어왔는데. 일반 노드라면.. 턴 정보를 제거한다. if (PUB._virtualAGV.CurrentNode != null && - PUB._virtualAGV.CurrentNode.StationType != StationType.Buffer && + PUB._virtualAGV.CurrentNode.StationType != Station.Buffer && PUB._virtualAGV.Turn != AGVTurn.None) { PUB.log.AddAT($"[{logPrefix}-Goto] 현재노드위치가 버퍼가 아니라서 턴정보를 초기화합니다{PUB._virtualAGV.Turn}"); diff --git a/HMI/Project/ViewForm/fAuto.cs b/HMI/Project/ViewForm/fAuto.cs index 7a2d6f7..688d3a0 100644 --- a/HMI/Project/ViewForm/fAuto.cs +++ b/HMI/Project/ViewForm/fAuto.cs @@ -76,7 +76,7 @@ namespace Project.ViewForm menu.Items.Add(pickOff); // Charge - if (mapnode.StationType == StationType.Charger ) + if (mapnode.StationType == Station.Charger ) { var charge = new ToolStripMenuItem("Charge (Move & Charge)"); charge.Click += (s, args) => ExecuteManualCommand(mapnode, ENIGProtocol.AGVCommandHE.Charger); @@ -209,7 +209,7 @@ namespace Project.ViewForm ENIGProtocol.AGVCommandHE targetCmd = ENIGProtocol.AGVCommandHE.Goto; string confirmMsg = ""; - if (targetNode.StationType == StationType.Charger) + if (targetNode.StationType == Station.Charger) { if (MessageBox.Show($"[{targetNode.Id}] 충전기로 이동하여 충전을 진행하시겠습니까?", "작업 확인", MessageBoxButtons.YesNo) == DialogResult.Yes) {