diff --git a/Analysis/CenterControl.cs b/Analysis/CenterControl.cs index 616b641..1c7f1bb 100644 --- a/Analysis/CenterControl.cs +++ b/Analysis/CenterControl.cs @@ -107,6 +107,8 @@ namespace NSAnalysis InitializeComponent(); SQLHelper.connStr = DatabaseDfn.SqlConnectStr(); + // + #region 加载皮肤 ThemeResolutionService.LoadPackageFile(ConfigDfn.strTheme); @@ -385,10 +387,10 @@ namespace NSAnalysis private void CenterControl_FormClosed(object sender, FormClosedEventArgs e) { MyBase.TraceWriteLine("-------------海克斯康面隙分析软件程序关闭---------------------"); - //LogDebugDfn.strEndTime = DateTime.Now.ToString("yyyy.MM.dd HH-mm-ss"); - //string CopyFileName = ConfigDfn.strFileFolder + "\\DebugFiles\\" + "Debug(" + LogDebugDfn.strStartTime + " To " + LogDebugDfn.strEndTime + ")" + ".txt"; - //if (File.Exists(LogDebugDfn.strDebugFile)) - // File.Copy(LogDebugDfn.strDebugFile, CopyFileName); + LogDebugDfn.strEndTime = DateTime.Now.ToString("yyyy.MM.dd HH-mm-ss"); + string CopyFileName = ConfigDfn.strFileFolder + "\\DebugFiles\\" + "Debug(" + LogDebugDfn.strStartTime + " To " + LogDebugDfn.strEndTime + ")" + ".txt"; + if (File.Exists(LogDebugDfn.strDebugFile)) + File.Copy(LogDebugDfn.strDebugFile, CopyFileName); System.Environment.Exit(0); } diff --git a/Analysis/Define/Define.cs b/Analysis/Define/Define.cs index c52e1c9..cc90385 100644 --- a/Analysis/Define/Define.cs +++ b/Analysis/Define/Define.cs @@ -292,12 +292,16 @@ namespace NSAnalysis public static string SqlConnectStr() { string strConnectString = ""; - strConnectString = @"Data Source=" + SqlServerName + + LoadConfig(); + strConnectString = @"Data Source=" + SqlServerName + ";initial Catalog=" + SqlDbName + ";User ID=" + SqlUserName + ";password=" + SqlPassword + ";"; - return strConnectString; + MyBase.TraceWriteLine("数据库连接字符串:" + strConnectString); + + return strConnectString; } public static void LoadConfig() @@ -307,6 +311,14 @@ namespace NSAnalysis SqlUserName = FileIni.ReadString(ConfigDfn.strConfigFile, strSection, "SqlUserName"); SqlPassword = FileIni.ReadString(ConfigDfn.strConfigFile, strSection, "SqlPassword"); SqlDbName = FileIni.ReadString(ConfigDfn.strConfigFile, strSection, "SqlDbName"); - } - } + + + //写入日志的 + MyBase.TraceWriteLine("数据库连接 SqlServerName:" + SqlServerName); + MyBase.TraceWriteLine("数据库连接 SqlUserName:" + SqlUserName); + MyBase.TraceWriteLine("数据库连接 SqlPassword:" + SqlPassword); + MyBase.TraceWriteLine("数据库连接 SqlDbName:" + SqlDbName); + + } + } } \ No newline at end of file diff --git a/Analysis/Program.cs b/Analysis/Program.cs index f3d07ff..60be98a 100644 --- a/Analysis/Program.cs +++ b/Analysis/Program.cs @@ -90,9 +90,9 @@ namespace NSAnalysis gCLMSModeID = FileIni.ReadInt(ConfigDfn.strConfigFile, "Chery", "CLMSModeID", 1); gAuthorizationMode = FileIni.ReadInt(ConfigDfn.strConfigFile, "Chery", "AuthorizationMode", 1); - #endregion 创建Log文件 - - if (gAuthorizationMode == 1) + #endregion 创建Log文件 + //Application.Run(new CenterControl()); + if (gAuthorizationMode == 1) { MyBase.TraceWriteLine("Log in using the CLMS authorization."); diff --git a/Analysis/bin/x64/Debug/DAL.dll b/Analysis/bin/x64/Debug/DAL.dll index 51cd81d..753dae3 100644 Binary files a/Analysis/bin/x64/Debug/DAL.dll and b/Analysis/bin/x64/Debug/DAL.dll differ diff --git a/Analysis/bin/x64/Debug/DAL.pdb b/Analysis/bin/x64/Debug/DAL.pdb index 9ccba13..621eea3 100644 Binary files a/Analysis/bin/x64/Debug/DAL.pdb and b/Analysis/bin/x64/Debug/DAL.pdb differ diff --git a/Analysis/bin/x64/Debug/Debug.txt b/Analysis/bin/x64/Debug/Debug.txt index 515fa61..c116366 100644 --- a/Analysis/bin/x64/Debug/Debug.txt +++ b/Analysis/bin/x64/Debug/Debug.txt @@ -1,21 +1,9 @@ -2025-03-07 11:51:04.897----软件Program Main函数开始执行-- -2025-03-07 11:51:04.904--加载配置文件——>开始 -2025-03-07 11:51:04.933--加载配置文件——>完成 -2025-03-07 11:51:04.935--Log in using the CLMS authorization. -2025-03-07 11:51:07.433-- 进入显示车身模式!显示车身界面。 -2025-03-07 11:51:07.943--启动PLC写线程! -2025-03-07 11:51:07.978-- 进入解析CSV文件模式,开始解析扫码CSV文件! -2025-03-07 11:51:07.980--软件首次启动, Nextsense EH3 CSV读取路径存在;不清空,读取NextSense生成 CSV报告路径下的所有文件,路径为:D:\cherytestEH3 -2025-03-07 11:51:07.981--连接PLC.... -2025-03-07 11:51:07.981--软件首次启动, Nextsense EHY CSV读取路径存在;不清空,读取NextSense生成 CSV报告路径下的所有文件,路径为:D:\cherytestEHY -2025-03-07 11:51:08.881--存在EHY CSV文件,开始解析: -2025-03-07 11:51:08.888--Copy D:\test\5mm_SelfTest_20250304_141005.csv TO D:\HexagonProjects\2024-20-奇瑞间隙面差\奇瑞间隙面差总装代码资料\Code\Analysis\bin\x64\Debug\File\NextSenseCSVBackup\5mm_SelfTest_20250304_141005.csv Done. 备份完成 -2025-03-07 11:51:08.894--开始解析NextSense EHY CSV 报告:D:\test\5mm_SelfTest_20250304_141005.csv -2025-03-07 11:51:11.466--PLC S7连接失败。 -2025-03-07 11:51:14.826--解析NextSense 自检报告完毕!检查数量=4 -2025-03-07 11:51:14.832--开始生成客户所需要的CSV格式文件: -2025-03-07 11:51:14.835--客户自检报告生成完毕,路径为:D:\QMLTest\20250307115114_SelfMeasure20250307115108.csv -2025-03-07 11:51:14.859--连接PLC失败 -2025-03-07 11:51:14.975--Right EH3 UI Refresh tmrRefreshData (strVIN.Length==21):CarType:EHY ;VIN: LNNBBDEC8RDA23997 -2025-03-07 11:51:14.985--Right EHY UI Refresh tmrRefreshData (strVIN.Length==21):CarType:EHY ;VIN: LNNBBDEC8RDA23997 -2025-03-07 11:51:15.160--显示右侧EHY车身数据界面。 +2025-05-19 14:11:36.576----软件Program Main函数开始执行-- +2025-05-19 14:11:36.578--加载配置文件——>开始 +2025-05-19 14:11:36.625--数据库连接 SqlServerName:127.0.0.1 +2025-05-19 14:11:36.626--数据库连接 SqlUserName:sa +2025-05-19 14:11:36.627--数据库连接 SqlPassword:Hexagon123 +2025-05-19 14:11:36.629--数据库连接 SqlDbName:NextSenseStandardDB +2025-05-19 14:11:36.630--加载配置文件——>完成 +2025-05-19 14:11:36.631--Log in using the CLMS authorization. +2025-05-19 14:11:36.758--CLMS check license failed! Please authorize the operation. diff --git a/Analysis/bin/x64/Debug/NSAnalysis.exe b/Analysis/bin/x64/Debug/NSAnalysis.exe index c26da79..4cb7cb3 100644 Binary files a/Analysis/bin/x64/Debug/NSAnalysis.exe and b/Analysis/bin/x64/Debug/NSAnalysis.exe differ diff --git a/Analysis/bin/x64/Debug/NSAnalysis.pdb b/Analysis/bin/x64/Debug/NSAnalysis.pdb index 211e687..394baec 100644 Binary files a/Analysis/bin/x64/Debug/NSAnalysis.pdb and b/Analysis/bin/x64/Debug/NSAnalysis.pdb differ diff --git a/Analysis/bin/x64/Debug/PLCModule.dll b/Analysis/bin/x64/Debug/PLCModule.dll index ce9e794..1a50002 100644 Binary files a/Analysis/bin/x64/Debug/PLCModule.dll and b/Analysis/bin/x64/Debug/PLCModule.dll differ diff --git a/Analysis/bin/x64/Debug/PLCModule.pdb b/Analysis/bin/x64/Debug/PLCModule.pdb index 6337271..1fce5fb 100644 Binary files a/Analysis/bin/x64/Debug/PLCModule.pdb and b/Analysis/bin/x64/Debug/PLCModule.pdb differ diff --git a/DAL/1.DAL.csproj b/DAL/1.DAL.csproj index ce42733..1548ec2 100644 --- a/DAL/1.DAL.csproj +++ b/DAL/1.DAL.csproj @@ -77,6 +77,12 @@ + + + {43566B10-5883-40B5-82B1-505D91629B33} + 4.PLCModule + + diff --git a/DAL/SQLHelper.cs b/DAL/SQLHelper.cs index 867cf69..cbdfbd6 100644 --- a/DAL/SQLHelper.cs +++ b/DAL/SQLHelper.cs @@ -1,4 +1,5 @@ -using System; +using PLCBaseFunction; +using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; @@ -32,7 +33,9 @@ namespace DAL if (iFlag == 0) { iFlag++;//必须放在前面,这样才起左右,放在后面,不会赋值 如果不点击确定的话 - MessageBox.Show("数据库打开连接失败,请检查数据库是否正确连接!原因:" + ex.ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); + + MyBase.TraceWriteLine(" 数据库打开连接失败" +ex.ToString()); + MessageBox.Show("数据库打开连接失败,请检查数据库是否正确连接!原因:" + ex.ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } return conn; } diff --git a/DAL/bin/Debug/DAL.dll b/DAL/bin/Debug/DAL.dll index 51cd81d..753dae3 100644 Binary files a/DAL/bin/Debug/DAL.dll and b/DAL/bin/Debug/DAL.dll differ diff --git a/DAL/bin/Debug/DAL.pdb b/DAL/bin/Debug/DAL.pdb index 9ccba13..621eea3 100644 Binary files a/DAL/bin/Debug/DAL.pdb and b/DAL/bin/Debug/DAL.pdb differ diff --git a/PLCModule/PLCModule/bin/Debug/PLCModule.dll b/PLCModule/PLCModule/bin/Debug/PLCModule.dll index ce9e794..1a50002 100644 Binary files a/PLCModule/PLCModule/bin/Debug/PLCModule.dll and b/PLCModule/PLCModule/bin/Debug/PLCModule.dll differ diff --git a/PLCModule/PLCModule/bin/Debug/PLCModule.pdb b/PLCModule/PLCModule/bin/Debug/PLCModule.pdb index 6337271..1fce5fb 100644 Binary files a/PLCModule/PLCModule/bin/Debug/PLCModule.pdb and b/PLCModule/PLCModule/bin/Debug/PLCModule.pdb differ