.agvmap 확장자제거하고 .json 으로 통일한 mapeditor 와 호환성 유지

This commit is contained in:
backuppc
2025-12-15 08:33:42 +09:00
parent a8cb952ea4
commit 9db88e5d6b
6 changed files with 21 additions and 21 deletions

View File

@@ -546,8 +546,8 @@ namespace AGVMapEditor.Forms
{
var openFileDialog = new OpenFileDialog
{
Filter = "AGV Map Files (*.agvmap;*.json)|*.agvmap;*.json|All Files (*.*)|*.*",
DefaultExt = "agvmap",
Filter = "AGV Map Files (*.json)|*.json|All Files (*.*)|*.*",
DefaultExt = "json",
};
@@ -595,9 +595,9 @@ namespace AGVMapEditor.Forms
{
var saveFileDialog = new SaveFileDialog
{
Filter = "AGV Map Files (*.agvmap)|*.agvmap",
DefaultExt = "agvmap",
FileName = "NewMap.agvmap"
Filter = "AGV Map Files (*.json)|*.json",
DefaultExt = "json",
FileName = "NewMap.json"
};
if (saveFileDialog.ShowDialog() == DialogResult.OK)

View File

@@ -11,7 +11,7 @@ namespace AGVNavigationCore.Utils
{
/// <summary>
/// DirectionalPathfinder 테스트 클래스
/// NewMap.agvmap을 로드하여 방향별 다음 노드를 검증
/// NewMap.json 로드하여 방향별 다음 노드를 검증
/// </summary>
public class DirectionalPathfinderTest
{
@@ -26,7 +26,7 @@ namespace AGVNavigationCore.Utils
}
/// <summary>
/// NewMap.agvmap 파일 로드
/// NewMap.json 파일 로드
/// </summary>
public bool LoadMapFile(string filePath)
{

View File

@@ -14,7 +14,7 @@ namespace AGVNavigationCore.Utils
{
public void RunTests()
{
string mapFilePath = @"C:\Data\Source\(5613#) ENIG AGV\Source\Cs_HMI\Data\NewMap.agvmap";
string mapFilePath = @"C:\Data\Source\(5613#) ENIG AGV\Source\Cs_HMI\Data\NewMap.json";
var tester = new DirectionalPathfinderTest();

View File

@@ -231,7 +231,7 @@ namespace AGVSimulator.Forms
{
using (var openDialog = new OpenFileDialog())
{
openDialog.Filter = "AGV Map Files (*.agvmap)|*.agvmap|모든 파일 (*.*)|*.*";
openDialog.Filter = "AGV Map Files (*.json)|*.json|모든 파일 (*.*)|*.*";
openDialog.Title = "맵 파일 열기";
if (openDialog.ShowDialog() == DialogResult.OK)
@@ -2038,9 +2038,9 @@ namespace AGVSimulator.Forms
using (var saveDialog = new SaveFileDialog())
{
saveDialog.Filter = "AGV Map Files (*.agvmap)|*.agvmap|모든 파일 (*.*)|*.*";
saveDialog.Filter = "AGV Map Files (*.json)|*.json|모든 파일 (*.*)|*.*";
saveDialog.Title = "맵 파일 저장";
saveDialog.DefaultExt = "agvmap";
saveDialog.DefaultExt = "json";
// 현재 파일이 있으면 기본 파일명으로 설정
if (!string.IsNullOrEmpty(_currentMapFilePath))
@@ -2051,7 +2051,7 @@ namespace AGVSimulator.Forms
else
{
// 기본 파일명: 날짜_시간 형식
saveDialog.FileName = $"ScanMap_{DateTime.Now:yyyyMMdd_HHmmss}.agvmap";
saveDialog.FileName = $"ScanMap_{DateTime.Now:yyyyMMdd_HHmmss}.json";
}
if (saveDialog.ShowDialog() == DialogResult.OK)

View File

@@ -40,7 +40,6 @@ namespace Project.ViewForm
private void InitializeMapCanvas()
{
// RfidMappings 제거 - MapNode에 통합됨
// 이벤트 연결
@@ -63,7 +62,8 @@ namespace Project.ViewForm
{
if (e.Button != MouseButtons.Right) return;
if (node == null) return;
if ((node is MapNode mapnode) == false) return;
var mapnode = node as MapNode;
if (mapnode == null) return;
// 도킹 가능한 노드인지 또는 작업 노드인지 확인
if (mapnode.isDockingNode == false) return;
@@ -159,12 +159,12 @@ namespace Project.ViewForm
//맵파일로딩
if (PUB.setting.LastMapFile.isEmpty()) PUB.setting.LastMapFile = System.IO.Path.Combine(mapPath.FullName, "default.agvmap");
if (PUB.setting.LastMapFile.isEmpty()) PUB.setting.LastMapFile = System.IO.Path.Combine(mapPath.FullName, "default.json");
System.IO.FileInfo filePath = new System.IO.FileInfo(PUB.setting.LastMapFile);
if (filePath.Exists == false) filePath = new System.IO.FileInfo(System.IO.Path.Combine(mapPath.FullName, "default.agvmap"));
if (filePath.Exists == false) filePath = new System.IO.FileInfo(System.IO.Path.Combine(mapPath.FullName, "default.json"));
if (filePath.Exists == false) //그래도없다면 맵폴더에서 파일을 찾아본다.
{
var files = mapPath.GetFiles("*.agvmap");
var files = mapPath.GetFiles("*.json");
if (files.Any()) filePath = files[0];
}

View File

@@ -769,8 +769,8 @@ namespace Project
//mapsave
using (var sd = new SaveFileDialog())
{
sd.Filter = "AGV Map Files (*.agvmap)|*.agvmap|All Files (*.*)|*.*";
sd.DefaultExt = "agvmap";
sd.Filter = "AGV Map Files (*.json)|*.json|All Files (*.*)|*.*";
sd.DefaultExt = "json";
sd.FileName = PUB._mapCanvas.MapFileName;
if (sd.ShowDialog() == DialogResult.OK)
{
@@ -785,8 +785,8 @@ namespace Project
var od = new OpenFileDialog
{
Filter = "AGV Map Files (*.agvmap;*.json)|*.agvmap;*.json|All Files (*.*)|*.*",
DefaultExt = "agvmap",
Filter = "AGV Map Files (*.json)|*.json|All Files (*.*)|*.*",
DefaultExt = "json",
FileName = PUB._mapCanvas.MapFileName,
};