From ddbf638cff780e0338fb29942f389c0a53ed8cd0 Mon Sep 17 00:00:00 2001 From: gudae Date: Fri, 30 Oct 2026 10:30:52 +0900 Subject: [PATCH] final_Housing --- .gitignore | 8 + App.xaml | 55 + App.xaml.cs | 16 + Database.ini | 13 + Hardware.ini | 97 ++ Housing.csproj | 40 + Housing.sln | 37 + InspectionSettings.ini | 8 + Login/StartupLoginWindow.xaml | 678 ++++++++++ Login/StartupLoginWindow.xaml.cs | 476 +++++++ LoginOptions.json | 23 + MainWindow.xaml | 708 ++++++++++ MainWindow.xaml.cs | 1133 +++++++++++++++++ Models/BoardMeasurementResult.cs | 12 + Models/HousingAssemblyRecord.cs | 22 + Models/InspectionJudgementSettings.cs | 27 + Models/ResistanceStorage.cs | 20 + Resources/Housing_voltage_current_icon.ico | Bin 0 -> 148004 bytes Resources/mobidigm-logo.png | Bin 0 -> 9475 bytes Services/BarcodeScannerSettings.cs | 69 + Services/BoardHardwareSettings.cs | 71 ++ Services/BoardTestService.cs | 167 +++ Services/DatabaseSettings.cs | 59 + Services/EquipmentMeasurementService.cs | 403 ++++++ Services/EquipmentMeasurementSettings.cs | 105 ++ Services/HousingAssemblyRepository.cs | 350 +++++ Services/HousingSettingsPaths.cs | 52 + Services/IScpiClient.cs | 7 + Services/IniFile.cs | 45 + Services/InspectionSettingsStore.cs | 69 + Services/LoginAccountRepository.cs | 62 + Services/LoginHistoryStore.cs | 99 ++ Services/LoginSelectionOptions.cs | 174 +++ Services/LoginSettings.cs | 82 ++ Services/Ni6501StartSignalWatcher.cs | 191 +++ Services/ScpiMeasurement.cs | 80 ++ Services/SerialBarcodeScanner.cs | 426 +++++++ Services/SerialBoardClient.cs | 244 ++++ Services/SerialScpiClient.cs | 210 +++ Services/StartSignalSettings.cs | 126 ++ Services/StartSignalWatcher.cs | 40 + Services/TcpScpiClient.cs | 92 ++ Services/TcpStartSignalWatcher.cs | 151 +++ Services/VisaScpiClient.cs | 214 ++++ add-resistance-column.sql | 29 + init.sql | 241 ++++ installer/Bundle.wxs | 12 + installer/Housing.wxs | 137 ++ installer/README.md | 33 + installer/build.ps1 | 27 + .../MeasurementChecks.csproj | 12 + tools/MeasurementChecks/Program.cs | 374 ++++++ tools/SettingsPathChecks/Check-Installer.ps1 | 117 ++ tools/SettingsPathChecks/Program.cs | 56 + .../SettingsPathChecks.csproj | 11 + 55 files changed, 8010 insertions(+) create mode 100644 .gitignore create mode 100644 App.xaml create mode 100644 App.xaml.cs create mode 100644 Database.ini create mode 100644 Hardware.ini create mode 100644 Housing.csproj create mode 100644 Housing.sln create mode 100644 InspectionSettings.ini create mode 100644 Login/StartupLoginWindow.xaml create mode 100644 Login/StartupLoginWindow.xaml.cs create mode 100644 LoginOptions.json create mode 100644 MainWindow.xaml create mode 100644 MainWindow.xaml.cs create mode 100644 Models/BoardMeasurementResult.cs create mode 100644 Models/HousingAssemblyRecord.cs create mode 100644 Models/InspectionJudgementSettings.cs create mode 100644 Models/ResistanceStorage.cs create mode 100644 Resources/Housing_voltage_current_icon.ico create mode 100644 Resources/mobidigm-logo.png create mode 100644 Services/BarcodeScannerSettings.cs create mode 100644 Services/BoardHardwareSettings.cs create mode 100644 Services/BoardTestService.cs create mode 100644 Services/DatabaseSettings.cs create mode 100644 Services/EquipmentMeasurementService.cs create mode 100644 Services/EquipmentMeasurementSettings.cs create mode 100644 Services/HousingAssemblyRepository.cs create mode 100644 Services/HousingSettingsPaths.cs create mode 100644 Services/IScpiClient.cs create mode 100644 Services/IniFile.cs create mode 100644 Services/InspectionSettingsStore.cs create mode 100644 Services/LoginAccountRepository.cs create mode 100644 Services/LoginHistoryStore.cs create mode 100644 Services/LoginSelectionOptions.cs create mode 100644 Services/LoginSettings.cs create mode 100644 Services/Ni6501StartSignalWatcher.cs create mode 100644 Services/ScpiMeasurement.cs create mode 100644 Services/SerialBarcodeScanner.cs create mode 100644 Services/SerialBoardClient.cs create mode 100644 Services/SerialScpiClient.cs create mode 100644 Services/StartSignalSettings.cs create mode 100644 Services/StartSignalWatcher.cs create mode 100644 Services/TcpScpiClient.cs create mode 100644 Services/TcpStartSignalWatcher.cs create mode 100644 Services/VisaScpiClient.cs create mode 100644 add-resistance-column.sql create mode 100644 init.sql create mode 100644 installer/Bundle.wxs create mode 100644 installer/Housing.wxs create mode 100644 installer/README.md create mode 100644 installer/build.ps1 create mode 100644 tools/MeasurementChecks/MeasurementChecks.csproj create mode 100644 tools/MeasurementChecks/Program.cs create mode 100644 tools/SettingsPathChecks/Check-Installer.ps1 create mode 100644 tools/SettingsPathChecks/Program.cs create mode 100644 tools/SettingsPathChecks/SettingsPathChecks.csproj diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a26b00c --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.vs/ +bin/ +obj/ +.wix/ +installer/output/ +publish/ +UpgradeLog*.htm +*.Backup.tmp diff --git a/App.xaml b/App.xaml new file mode 100644 index 0000000..cd2a08d --- /dev/null +++ b/App.xaml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/App.xaml.cs b/App.xaml.cs new file mode 100644 index 0000000..4f609c9 --- /dev/null +++ b/App.xaml.cs @@ -0,0 +1,16 @@ +using System.Windows; + +namespace Housing; + +public partial class App : Application +{ + protected override void OnStartup(StartupEventArgs e) + { + base.OnStartup(e); + ShutdownMode = ShutdownMode.OnMainWindowClose; + + var mainWindow = new MainWindow(); + MainWindow = mainWindow; + mainWindow.Show(); + } +} diff --git a/Database.ini b/Database.ini new file mode 100644 index 0000000..28e333a --- /dev/null +++ b/Database.ini @@ -0,0 +1,13 @@ +[Database] +IP=192.168.10.10,1433 +Database=NE1aW_PT_Sensor +DbId=su_user +DbPw=amotech821 +Encrypt=False +TrustServerCertificate=True +Timeout=15 + +[Login] +Procedure=dbo.CheckOperator +ProcessName=Housing +OfflinePreview=True diff --git a/Hardware.ini b/Hardware.ini new file mode 100644 index 0000000..1f0da67 --- /dev/null +++ b/Hardware.ini @@ -0,0 +1,97 @@ +[Board] +PortName=COM5 +BaudRate=115200 +ReadTimeout=5000 +PreConnectCommand=x00o +ConnectCommand=x00c_001101:owt28006727ea97c7801 +ReadIdCommand=x00c_001101:ow2800326003e +PostReadIdCommand=x00o +CalDefaultCommand=x00c_001001:owt28006727ea97c7801 +EndToken= +DtrEnable=false +RtsEnable=false + +[BarcodeScanner] +Enabled=true +PortName=Auto +BaudRate=9600 +ReadTimeout=500 +IdleCommitMilliseconds=250 +DtrEnable=true +RtsEnable=true + +[StartSignal] +; USB-6501 +Enabled=true +Connection=Ni6501 +PhysicalChannel=Dev1/port0/line0 +ActiveState=Low +PollIntervalMilliseconds=50 +; 0 = wait until the equipment start button is pressed, without a time limit. +TimeoutMilliseconds=0 +PostSignalDelayMilliseconds=2000 +RequireInactiveBeforeStart=true + +[Equipment] +; V 출력: Keysight 34465A DMM 값 +; A 출력: Keysight E36233A Power Supply CH1 Current 값 +; USB 장비는 Keysight Connection Expert 또는 NI MAX에서 보이는 VISA 주소를 Resource +Timeout=5000 +SettleMilliseconds=300 +PreBoardCommand=VOLT 5, (@2);OUTP ON, (@2) +PreBoardDelayMilliseconds=2000 +LogoutCommand=OUTP OFF, (@1) + +; 34465A DMM +VoltageConnection=LAN +VoltageResource= +VoltageIdnMatch=34465A +VoltageHost=192.168.10.13 +VoltagePort=5025 +VoltageSetupCommand= +VoltageReadCommand=MEAS:VOLT:DC? + +; Separate resistance meter. Change its address/commands here. +; Read after V/current and CH1 output OFF. Normal response: Ohm -> kOhm; overload: 999 + OL status. +; Resistance is required for inspection; Disabled stops the inspection with an error. +ResistanceConnection=LAN +ResistanceResource= +; Optional model identifier to validate with *IDN? (leave blank until the model is known). +ResistanceIdnMatch= +ResistanceHost=192.168.10.34 +ResistancePort=5025 +ResistancePortName= +ResistanceBaudRate=115200 +ResistanceTerminator=LF +ResistanceReadCommand=MEAS:RES? +ResistanceSetupCommand= +; Query the CURRENT power supply to confirm CH1 output is OFF before resistance measurement. +ResistancePowerOffQuery=OUTP? (@1) +ResistanceSettleMilliseconds=300 + +; E36233A Power Supply +CurrentConnection=LAN +CurrentResource= +CurrentIdnMatch=E36233A +; Change this to the E36233A LAN IP if the instrument uses a different address. +CurrentHost=192.168.10.12 +CurrentPort=5025 +CurrentPortName= +CurrentBaudRate=9600 +CurrentTerminator=LF +CurrentSetupCommand=OUTP ON, (@1) +CurrentCleanupCommand=OUTP OFF, (@1) +CurrentReadCommand=MEAS:CURR? (@1) + +; COM 포트로 잡히는 장비 예시: +; VoltageConnection=Serial +; VoltagePortName=Auto +; VoltageBaudRate=115200 + +; LAN 장비 예시: +; VoltageConnection=Tcp +; VoltageHost=192.168.0.10 +; VoltagePort=5025 + +; E36233A 파워서플라이에서 CH1 전압까지 읽고 싶을 때 예시: +; VoltageReadCommand=MEAS:VOLT? CH1 diff --git a/Housing.csproj b/Housing.csproj new file mode 100644 index 0000000..30bf7b3 --- /dev/null +++ b/Housing.csproj @@ -0,0 +1,40 @@ + + + WinExe + net9.0-windows + true + Housing + enable + enable + Resources\Housing_voltage_current_icon.ico + + + + + + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + diff --git a/Housing.sln b/Housing.sln new file mode 100644 index 0000000..59d6d8a --- /dev/null +++ b/Housing.sln @@ -0,0 +1,37 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 18 +VisualStudioVersion = 18.3.11520.95 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Housing", "Housing.csproj", "{7364A567-F115-4ACE-9207-C6FDEEF0A394}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7364A567-F115-4ACE-9207-C6FDEEF0A394}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7364A567-F115-4ACE-9207-C6FDEEF0A394}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7364A567-F115-4ACE-9207-C6FDEEF0A394}.Debug|x64.ActiveCfg = Debug|Any CPU + {7364A567-F115-4ACE-9207-C6FDEEF0A394}.Debug|x64.Build.0 = Debug|Any CPU + {7364A567-F115-4ACE-9207-C6FDEEF0A394}.Debug|x86.ActiveCfg = Debug|Any CPU + {7364A567-F115-4ACE-9207-C6FDEEF0A394}.Debug|x86.Build.0 = Debug|Any CPU + {7364A567-F115-4ACE-9207-C6FDEEF0A394}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7364A567-F115-4ACE-9207-C6FDEEF0A394}.Release|Any CPU.Build.0 = Release|Any CPU + {7364A567-F115-4ACE-9207-C6FDEEF0A394}.Release|x64.ActiveCfg = Release|Any CPU + {7364A567-F115-4ACE-9207-C6FDEEF0A394}.Release|x64.Build.0 = Release|Any CPU + {7364A567-F115-4ACE-9207-C6FDEEF0A394}.Release|x86.ActiveCfg = Release|Any CPU + {7364A567-F115-4ACE-9207-C6FDEEF0A394}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {3209F145-2010-45EC-8A1A-998F1D3CAE2F} + EndGlobalSection +EndGlobal diff --git a/InspectionSettings.ini b/InspectionSettings.ini new file mode 100644 index 0000000..ad00bd1 --- /dev/null +++ b/InspectionSettings.ini @@ -0,0 +1,8 @@ +[Judgement] +VMin=0.00 +VMax=9.99 +AMin=0.00 +AMax=9.99 +; Resistance limits in kOhm. Set both values in the UI before the first inspection. +RMin= +RMax= diff --git a/Login/StartupLoginWindow.xaml b/Login/StartupLoginWindow.xaml new file mode 100644 index 0000000..4ef65a8 --- /dev/null +++ b/Login/StartupLoginWindow.xaml @@ -0,0 +1,678 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +