diff --git a/.vs/marking_gui.slnx/v18/.suo b/.vs/marking_gui.slnx/v18/.suo index 8c54e72..6307935 100644 Binary files a/.vs/marking_gui.slnx/v18/.suo and b/.vs/marking_gui.slnx/v18/.suo differ diff --git a/.vs/marking_gui.slnx/v18/DocumentLayout.backup.json b/.vs/marking_gui.slnx/v18/DocumentLayout.backup.json index 165fc2d..f151ae1 100644 --- a/.vs/marking_gui.slnx/v18/DocumentLayout.backup.json +++ b/.vs/marking_gui.slnx/v18/DocumentLayout.backup.json @@ -5,6 +5,14 @@ { "AbsoluteMoniker": "D:0:0:{9E96D5BE-9375-4ED3-82DE-F200F83EBC2F}|marking_gui\\marking_gui.csproj|c:\\users\\computer1\\desktop\\mobi\\marking_gui\\marking_gui\\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}", "RelativeMoniker": "D:0:0:{9E96D5BE-9375-4ED3-82DE-F200F83EBC2F}|marking_gui\\marking_gui.csproj|solutionrelative:marking_gui\\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}" + }, + { + "AbsoluteMoniker": "D:0:0:{9E96D5BE-9375-4ED3-82DE-F200F83EBC2F}|marking_gui\\marking_gui.csproj|c:\\users\\computer1\\desktop\\mobi\\marking_gui\\marking_gui\\qrverificationwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}", + "RelativeMoniker": "D:0:0:{9E96D5BE-9375-4ED3-82DE-F200F83EBC2F}|marking_gui\\marking_gui.csproj|solutionrelative:marking_gui\\qrverificationwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}" + }, + { + "AbsoluteMoniker": "D:0:0:{9E96D5BE-9375-4ED3-82DE-F200F83EBC2F}|marking_gui\\marking_gui.csproj|c:\\users\\computer1\\desktop\\mobi\\marking_gui\\marking_gui\\settingswindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}", + "RelativeMoniker": "D:0:0:{9E96D5BE-9375-4ED3-82DE-F200F83EBC2F}|marking_gui\\marking_gui.csproj|solutionrelative:marking_gui\\settingswindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}" } ], "DocumentGroupContainers": [ @@ -14,12 +22,36 @@ "DocumentGroups": [ { "DockedWidth": 200, - "SelectedChildIndex": 1, + "SelectedChildIndex": 3, "Children": [ { "$type": "Bookmark", "Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}" }, + { + "$type": "Document", + "DocumentIndex": 1, + "Title": "QrVerificationWindow.xaml", + "DocumentMoniker": "C:\\Users\\COMPUTER1\\Desktop\\mobi\\marking_gui\\marking_gui\\QrVerificationWindow.xaml", + "RelativeDocumentMoniker": "marking_gui\\QrVerificationWindow.xaml", + "ToolTip": "C:\\Users\\COMPUTER1\\Desktop\\mobi\\marking_gui\\marking_gui\\QrVerificationWindow.xaml", + "RelativeToolTip": "marking_gui\\QrVerificationWindow.xaml", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|", + "WhenOpened": "2026-07-29T04:12:09.69Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 2, + "Title": "SettingsWindow.xaml", + "DocumentMoniker": "C:\\Users\\COMPUTER1\\Desktop\\mobi\\marking_gui\\marking_gui\\SettingsWindow.xaml", + "RelativeDocumentMoniker": "marking_gui\\SettingsWindow.xaml", + "ToolTip": "C:\\Users\\COMPUTER1\\Desktop\\mobi\\marking_gui\\marking_gui\\SettingsWindow.xaml", + "RelativeToolTip": "marking_gui\\SettingsWindow.xaml", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|", + "WhenOpened": "2026-07-29T04:12:06.926Z", + "EditorCaption": "" + }, { "$type": "Document", "DocumentIndex": 0, diff --git a/.vs/marking_gui.slnx/v18/DocumentLayout.json b/.vs/marking_gui.slnx/v18/DocumentLayout.json index 165fc2d..f151ae1 100644 --- a/.vs/marking_gui.slnx/v18/DocumentLayout.json +++ b/.vs/marking_gui.slnx/v18/DocumentLayout.json @@ -5,6 +5,14 @@ { "AbsoluteMoniker": "D:0:0:{9E96D5BE-9375-4ED3-82DE-F200F83EBC2F}|marking_gui\\marking_gui.csproj|c:\\users\\computer1\\desktop\\mobi\\marking_gui\\marking_gui\\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}", "RelativeMoniker": "D:0:0:{9E96D5BE-9375-4ED3-82DE-F200F83EBC2F}|marking_gui\\marking_gui.csproj|solutionrelative:marking_gui\\mainwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}" + }, + { + "AbsoluteMoniker": "D:0:0:{9E96D5BE-9375-4ED3-82DE-F200F83EBC2F}|marking_gui\\marking_gui.csproj|c:\\users\\computer1\\desktop\\mobi\\marking_gui\\marking_gui\\qrverificationwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}", + "RelativeMoniker": "D:0:0:{9E96D5BE-9375-4ED3-82DE-F200F83EBC2F}|marking_gui\\marking_gui.csproj|solutionrelative:marking_gui\\qrverificationwindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}" + }, + { + "AbsoluteMoniker": "D:0:0:{9E96D5BE-9375-4ED3-82DE-F200F83EBC2F}|marking_gui\\marking_gui.csproj|c:\\users\\computer1\\desktop\\mobi\\marking_gui\\marking_gui\\settingswindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}", + "RelativeMoniker": "D:0:0:{9E96D5BE-9375-4ED3-82DE-F200F83EBC2F}|marking_gui\\marking_gui.csproj|solutionrelative:marking_gui\\settingswindow.xaml||{F11ACC28-31D1-4C80-A34B-F4E09D3D753C}" } ], "DocumentGroupContainers": [ @@ -14,12 +22,36 @@ "DocumentGroups": [ { "DockedWidth": 200, - "SelectedChildIndex": 1, + "SelectedChildIndex": 3, "Children": [ { "$type": "Bookmark", "Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}" }, + { + "$type": "Document", + "DocumentIndex": 1, + "Title": "QrVerificationWindow.xaml", + "DocumentMoniker": "C:\\Users\\COMPUTER1\\Desktop\\mobi\\marking_gui\\marking_gui\\QrVerificationWindow.xaml", + "RelativeDocumentMoniker": "marking_gui\\QrVerificationWindow.xaml", + "ToolTip": "C:\\Users\\COMPUTER1\\Desktop\\mobi\\marking_gui\\marking_gui\\QrVerificationWindow.xaml", + "RelativeToolTip": "marking_gui\\QrVerificationWindow.xaml", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|", + "WhenOpened": "2026-07-29T04:12:09.69Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 2, + "Title": "SettingsWindow.xaml", + "DocumentMoniker": "C:\\Users\\COMPUTER1\\Desktop\\mobi\\marking_gui\\marking_gui\\SettingsWindow.xaml", + "RelativeDocumentMoniker": "marking_gui\\SettingsWindow.xaml", + "ToolTip": "C:\\Users\\COMPUTER1\\Desktop\\mobi\\marking_gui\\marking_gui\\SettingsWindow.xaml", + "RelativeToolTip": "marking_gui\\SettingsWindow.xaml", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003549|", + "WhenOpened": "2026-07-29T04:12:06.926Z", + "EditorCaption": "" + }, { "$type": "Document", "DocumentIndex": 0, diff --git a/docs/developer_manual.md b/docs/developer_manual.md index c668be9..8b1f1c9 100644 --- a/docs/developer_manual.md +++ b/docs/developer_manual.md @@ -56,7 +56,7 @@ LotNoTag=YYMMDD ; 제품 모델명 (Product Name) 치환 태그 ProductTag=PRODUCT -; 2D QR 코드 데이터 치환 태그 +; QR 코드 데이터 치환 태그 QrCodeTag=QRCODETAG ; 검사 라인 코드 치환 태그 diff --git a/marking_gui.Setup/Bundle.wxs b/marking_gui.Setup/Bundle.wxs index e4077c1..d951c8c 100644 --- a/marking_gui.Setup/Bundle.wxs +++ b/marking_gui.Setup/Bundle.wxs @@ -1,8 +1,8 @@ - + - + diff --git a/marking_gui/App.xaml.cs b/marking_gui/App.xaml.cs index 36ae1aa..5a0d098 100644 --- a/marking_gui/App.xaml.cs +++ b/marking_gui/App.xaml.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Configuration; using System.Data; using System.Linq; +using System.Threading; using System.Threading.Tasks; using System.Windows; @@ -13,11 +14,26 @@ namespace marking_gui /// public partial class App : Application { + private static Mutex? _mutex = null; + [System.Runtime.InteropServices.DllImport("kernel32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)] private static extern bool SetDllDirectory(string lpPathName); protected override void OnStartup(StartupEventArgs e) { + // 전역 Mutex 생성으로 프로그램 중복 실행 원천 방지 + const string appName = "MarkingGui_SingleInstance_Mutex_9921"; + bool createdNew; + + _mutex = new Mutex(true, appName, out createdNew); + + if (!createdNew) + { + MessageBox.Show("프로그램이 이미 실행 중입니다.\n\n중복 실행할 수 없습니다.", "중복 실행 방지", MessageBoxButton.OK, MessageBoxImage.Warning); + Application.Current.Shutdown(); + return; + } + // 바로가기 등으로 실행 시 작업 디렉토리가 꼬이는 현상을 방지하기 위해 작업 디렉토리를 실행 파일 폴더로 강제 동기화 try { @@ -59,6 +75,18 @@ namespace marking_gui protected override void OnExit(ExitEventArgs e) { Services.LoggerService.Info("=================== [프로그램 정상 종료] ==================="); + + if (_mutex != null) + { + try + { + _mutex.ReleaseMutex(); + _mutex.Dispose(); + } + catch { } + _mutex = null; + } + base.OnExit(e); } diff --git a/marking_gui/MainWindow.xaml b/marking_gui/MainWindow.xaml index 861f332..a4c8c69 100644 --- a/marking_gui/MainWindow.xaml +++ b/marking_gui/MainWindow.xaml @@ -281,7 +281,7 @@ - + @@ -298,8 +298,14 @@ - - + + + + + + + + @@ -462,31 +468,38 @@ - + - - + + - + + + + + + + + - - + + - - + + - - + + - + - + - + @@ -560,8 +573,8 @@