add mapcontrol

add remote path(gitlab)
This commit is contained in:
chi
2025-05-22 16:21:56 +09:00
parent 7dc068032f
commit 34130e9c86
23 changed files with 2368 additions and 181 deletions

View File

@@ -0,0 +1,70 @@
using System.Drawing;
using System.Collections.Generic;
using System.Linq;
namespace AGVMapControl.Models
{
public class AGV
{
public Point CurrentPosition { get; set; }
public string CurrentRFID { get; set; }
public Direction CurrentDirection { get; set; }
public bool IsMoving { get; set; }
public List<Point> CurrentPath { get; set; }
public List<Point> PlannedPath { get; set; }
public List<string> PathRFIDs { get; set; }
public AGV()
{
CurrentPath = new List<Point>();
PlannedPath = new List<Point>();
PathRFIDs = new List<string>();
CurrentDirection = Direction.Forward;
}
public void Move()
{
if (CurrentPath.Count > 0)
{
CurrentPosition = CurrentPath[0];
CurrentPath.RemoveAt(0);
}
}
public void SetNewPath(List<Point> path)
{
CurrentPath = new List<Point>(path);
}
public void ClearPlannedPath()
{
PlannedPath.Clear();
PathRFIDs.Clear();
}
}
public enum Direction
{
Forward,
Backward
}
public class PathNode
{
public Point Location { get; set; }
public string RFID { get; set; }
public double G { get; set; } // 시작점에서 현재 노드까지의 비용
public double H { get; set; } // 현재 노드에서 목표점까지의 예상 비용
public double F => G + H; // 총 비용
public PathNode Parent { get; set; }
public PathNode(Point location, string rfid)
{
Location = location;
RFID = rfid;
G = 0;
H = 0;
Parent = null;
}
}
}

View File

@@ -0,0 +1,14 @@
using System.Drawing;
using System;
namespace AGVMapControl.Models
{
public class CustomLine
{
public Point StartPoint { get; set; }
public Point EndPoint { get; set; }
public Color LineColor { get; set; }
public int LineWidth { get; set; }
}
}

View File

@@ -0,0 +1,20 @@
using System.Drawing;
using System;
using System.Collections.Generic;
namespace AGVMapControl.Models
{
public class MagnetLine
{
public Point StartPoint { get; set; }
public Point EndPoint { get; set; }
public List<Point> BranchPoints { get; set; }
public Dictionary<Point, BranchDirection> BranchDirections { get; set; }
public MagnetLine()
{
BranchPoints = new List<Point>();
BranchDirections = new Dictionary<Point, BranchDirection>();
}
}
}

View File

@@ -0,0 +1,14 @@
using System.Drawing;
using System;
using System.Collections.Generic;
namespace AGVMapControl.Models
{
public class MapData
{
public List<RFIDPoint> RFIDPoints { get; set; } = new List<RFIDPoint>();
public List<MagnetLine> MagnetLines { get; set; } = new List<MagnetLine>();
public List<MapText> MapTexts { get; set; } = new List<MapText>();
public List<CustomLine> CustomLines { get; set; } = new List<CustomLine>();
public List<RFIDLine> RFIDLines { get; set; } = new List<RFIDLine>();
}
}

View File

@@ -0,0 +1,13 @@
using System.Drawing;
using System;
using System.Collections.Generic;
namespace AGVMapControl.Models
{
public enum BranchDirection
{
Left,
Straight,
Right
}
}

View File

@@ -0,0 +1,14 @@
using System.Drawing;
using System;
using System.Collections.Generic;
namespace AGVMapControl.Models
{
public class MapText
{
public Point Location { get; set; }
public string Text { get; set; }
public Color TextColor { get; set; }
public Color BackgroundColor { get; set; }
public Font Font { get; set; }
}
}

View File

@@ -0,0 +1,20 @@
using System.Drawing;
using System;
using System.Collections.Generic;
namespace AGVMapControl.Models
{
public class RFIDLine
{
public Point StartPoint { get; set; }
public Point EndPoint { get; set; }
public string StartRFID { get; set; }
public string EndRFID { get; set; }
public bool IsBidirectional { get; set; } = true; // 양방향 이동 가능 여부
public float Distance { get; set; } // 두 RFID 포인트 사이의 거리
public List<string> ConnectedRFIDs { get; set; } = new List<string>(); // 연결된 모든 RFID 값들
public Dictionary<string, string> NextRFID { get; set; } = new Dictionary<string, string>(); // 각 RFID의 다음 RFID
public Dictionary<string, string> PrevRFID { get; set; } = new Dictionary<string, string>(); // 각 RFID의 이전 RFID
}
}

View File

@@ -0,0 +1,13 @@
using System.Drawing;
using System;
using System.Collections.Generic;
namespace AGVMapControl.Models
{
public class RFIDPoint
{
public Point Location { get; set; }
public string RFIDValue { get; set; }
public string NextRFID { get; set; } // 다음 RFID 포인트의 값
public bool IsBidirectional { get; set; } // 양방향 연결 여부
}
}

View File

@@ -0,0 +1,34 @@
using System.Drawing;
using System.Collections.Generic;
using System.Linq;
namespace AGVMapControl.Models
{
public class ToolBarItem
{
private bool _ishovering = false;
public int Idx { get; set; }
public Rectangle Bounds { get; set; }
public bool isHovering
{
get { return _ishovering; }
set
{
Dirty = _ishovering != value;
_ishovering = value;
}
}
public string Title { get; set; }
public bool Dirty { get; private set; }
public ToolBarItem()
{
Bounds = Rectangle.Empty;
}
}
}