From b76569d02f9e3c1916a9b421f812374744f12c35 Mon Sep 17 00:00:00 2001 From: SHM Date: Fri, 25 Oct 2024 13:40:03 +0900 Subject: [PATCH] =?UTF-8?q?[=EC=84=B1=ED=98=84=EB=AA=A8]=20JsonConvertTool?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80,=20=EC=84=9C=EB=A8=B8=EB=A6=AC=20?= =?UTF-8?q?=EC=88=98=EB=9F=89=20=EB=B2=84=EA=B7=B8=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UI/View/Test List/UcTestListView.cs | 4 +- .../TestListReleaseCopyWizard.cs | 6 +- .../TestListReleaseInfoEdit.cs | 4 +- .../UcTRABaseView.cs | 2 +- CPXV2 TRA V2/SystemX.Product.CP.TRA.sln | 16 +- .../SystemX.Product.CP.TRA/DB/DataBaseConn.cs | 12 +- .../DataManager/DMDetailOverview.cs | 4 + .../DataManager/DMOverview.cs | 6 +- .../DataManager/DMStepTrend.cs | 10 +- .../DataManager/DMTestSummary.cs | 66 ++--- .../MainForm.Designer.cs | 172 ++++++------- .../SystemX.Product.CP.TRA/MainForm.cs | 17 +- .../SystemX.Product.CP.TRA/MainForm.resx | 66 +++-- .../SystemX.Product.CP.TRA.csproj | 18 +- .../UIControl/UcTRADetailTestResult.cs | 3 +- .../UIControl/UcTRAStepTrend.Designer.cs | 113 ++++----- .../UIControl/UcTRAStepTrend.cs | 130 +++------- .../UIControl/UcTRASummaryTestResult.cs | 55 +--- .../Cfg/DBConnInfo.xml | 41 +++ .../Cfg/LogInformation.xml | 17 ++ .../Cfg/MapLogOption.xml | 16 ++ .../MainForm.Designer.cs | 24 +- .../SystemX.Net.Middleware.UI/MainForm.cs | 55 +++- .../SystemX.Net.Middleware.UI/MainForm.resx | 3 + .../SystemX.Net.Middleware.UI/Program.cs | 2 +- .../Sub/CPXV2_CpLogProcess.cs | 236 ++++++++++++++++-- .../SystemX.Net.CP.Middleware.Log.csproj | 3 + .../Cfg/CallMadeQueryInfo.xml | 217 ++++++++++++++++ .../Cfg/DBConnInfo.xml | 33 +++ .../Cfg/LogProcessInfo.xml | 14 ++ .../Cfg/MapLogOption.xml | 17 ++ .../Cfg/ServerInformation.xml | 39 +++ .../MainForm Sub/Function.cs | 2 +- .../MainForm.Designer.cs | 2 +- .../SystemX.Net.Middleware.UI/MainForm.cs | 33 ++- .../SystemX.Net.Middleware.UI/Program.cs | 2 +- .../Command Protocol/HOST_INFO_CHECK.cs | 17 +- .../Command Protocol/PROCESS_QUERY.cs | 4 +- .../SystemX.Net.CP.Middleware.PD.csproj | 5 + .../SystemX.Net.CP.XAdaptor.UIM.csproj | 7 +- .../SystemX.Net.PCAdaptor/XAdaptorManager.cs | 4 +- .../SystemX.Net.PCAdaptor/XList/lstList.cs | 16 +- .../XPCAdaptor/IXPCAdaptor.cs | 5 +- .../XPCAdaptor/XPCAdaptor.cs | 67 +++-- .../XAdaptor.PC.Interface.Implement.cs | 31 ++- .../XPCAdaptor/XPCAdaptorSub/TaskStream.cs | 16 +- .../XPCAdaptor/XPCAdaptorSub/Tasks.cs | 35 ++- .../SystemX.Net.PCAdaptorUI/MainForm.cs | 8 +- .../SystemX.Net.CP.Platform.csproj | 5 +- .../SystemX.Net.DB/DBType/DBTMSSQL.cs | 5 +- .../SystemX.PLC/SystemX.PLC.csproj | 5 +- .../SystemX.XEFCore/SystemX.XEFCore.csproj | 5 +- 52 files changed, 1148 insertions(+), 547 deletions(-) create mode 100644 SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/Cfg/DBConnInfo.xml create mode 100644 SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/Cfg/LogInformation.xml create mode 100644 SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/Cfg/MapLogOption.xml create mode 100644 SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Cfg/CallMadeQueryInfo.xml create mode 100644 SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Cfg/DBConnInfo.xml create mode 100644 SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Cfg/LogProcessInfo.xml create mode 100644 SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Cfg/MapLogOption.xml create mode 100644 SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Cfg/ServerInformation.xml diff --git a/CPXV2 PTS/SystemX.Product.CP.PTS/UI/View/Test List/UcTestListView.cs b/CPXV2 PTS/SystemX.Product.CP.PTS/UI/View/Test List/UcTestListView.cs index dfea417..6dd517a 100644 --- a/CPXV2 PTS/SystemX.Product.CP.PTS/UI/View/Test List/UcTestListView.cs +++ b/CPXV2 PTS/SystemX.Product.CP.PTS/UI/View/Test List/UcTestListView.cs @@ -1028,7 +1028,7 @@ namespace SystemX.Product.ALIS.UI.View.InfoList $"Y.ModelName, " + //$"Y.Comment AS 'Model-Comment', " + $"X.Comment, " + - $"X.Description, " + + $"I.Description, " + $"X.UseTLPosition AS 'Test-List Position', " + $"K.LatestStepVersion AS 'Step Version' " + $"FROM PROD_Variant AS X " + @@ -1157,7 +1157,7 @@ namespace SystemX.Product.ALIS.UI.View.InfoList $"Y.ModelName, " + //$"Y.Comment AS 'Model-Comment', " + $"X.Comment, " + - $"X.Description, " + + $"I.Description, " + $"X.UseTLPosition AS 'Test-List Position', " + $"Z.LatestStepVersion AS 'Step Version' " + //$"X.TestListData " + diff --git a/CPXV2 PTS/SystemX.Product.CP.PTS/UI/View/Test List/Wizard/TestList Release/TestListReleaseCopyWizard.cs b/CPXV2 PTS/SystemX.Product.CP.PTS/UI/View/Test List/Wizard/TestList Release/TestListReleaseCopyWizard.cs index 2e1e95e..22abd79 100644 --- a/CPXV2 PTS/SystemX.Product.CP.PTS/UI/View/Test List/Wizard/TestList Release/TestListReleaseCopyWizard.cs +++ b/CPXV2 PTS/SystemX.Product.CP.PTS/UI/View/Test List/Wizard/TestList Release/TestListReleaseCopyWizard.cs @@ -208,7 +208,7 @@ namespace SystemX.Product.ALIS.UI.View.InfoList CheckTestListInfo(dtTestList); */ - DataTable dtTestList = ctrlDB.GetTable($"SELECT X.No, X.ProdNo_P, Y.TestType, Y.Version, Y.ProdCode, Y.FileName, X.Comment, X.Description FROM [PROD_Variant] AS X WITH(NOLOCK) " + + DataTable dtTestList = ctrlDB.GetTable($"SELECT X.No, X.ProdNo_P, Y.TestType, Y.Version, Y.ProdCode, Y.FileName, X.Comment, Y.Description FROM [PROD_Variant] AS X WITH(NOLOCK) " + $"INNER JOIN [STOR_TestListFile] AS Y WITH(NOLOCK) ON X.TestListFileNo = Y.No " + $"WHERE X.No = " + lstCopyTestListRelease[0].VariantNo + " ORDER BY No ASC;"); @@ -662,7 +662,7 @@ namespace SystemX.Product.ALIS.UI.View.InfoList CheckTestListInfo(dtTestList); */ - DataTable dtTestList = ctrlDB.GetTable($"SELECT X.No, X.ProdNo_P, Y.TestType, Y.Version, Y.ProdCode, Y.FileName, X.Comment, X.Description FROM [PROD_Variant] AS X WITH(NOLOCK) " + + DataTable dtTestList = ctrlDB.GetTable($"SELECT X.No, X.ProdNo_P, Y.TestType, Y.Version, Y.ProdCode, Y.FileName, X.Comment, Y.Description FROM [PROD_Variant] AS X WITH(NOLOCK) " + $"INNER JOIN [STOR_TestListFile] AS Y WITH(NOLOCK) ON X.TestListFileNo = Y.No " + $"WHERE X.No = " + lstCopyTestListRelease[0].VariantNo + " ORDER BY No ASC;"); @@ -703,7 +703,7 @@ namespace SystemX.Product.ALIS.UI.View.InfoList "WHERE ProdNo_P = '" + textBoxPProdNoInput.Text + "' "; */ - string strSetQueryText = $"SELECT X.No, X.ProdNo_P, Y.TestType, Y.Version, Y.ProdCode, Y.FileName, X.Comment, X.Description FROM [PROD_Variant] AS X WITH(NOLOCK) " + + string strSetQueryText = $"SELECT X.No, X.ProdNo_P, Y.TestType, Y.Version, Y.ProdCode, Y.FileName, X.Comment, Y.Description FROM [PROD_Variant] AS X WITH(NOLOCK) " + $"INNER JOIN [STOR_TestListFile] AS Y WITH(NOLOCK) ON X.TestListFileNo = Y.No " + $"WHERE X.ProdNo_P = '" + textBoxPProdNoInput.Text + "' "; diff --git a/CPXV2 PTS/SystemX.Product.CP.PTS/UI/View/Test List/Wizard/TestList Release/TestListReleaseInfoEdit.cs b/CPXV2 PTS/SystemX.Product.CP.PTS/UI/View/Test List/Wizard/TestList Release/TestListReleaseInfoEdit.cs index 17f9209..08bf442 100644 --- a/CPXV2 PTS/SystemX.Product.CP.PTS/UI/View/Test List/Wizard/TestList Release/TestListReleaseInfoEdit.cs +++ b/CPXV2 PTS/SystemX.Product.CP.PTS/UI/View/Test List/Wizard/TestList Release/TestListReleaseInfoEdit.cs @@ -215,7 +215,7 @@ namespace SystemX.Product.ALIS.UI.View.InfoList CheckTestCodeInfo(dtTestCode); - DataTable dtTestList = ctrlDB.GetTable($"SELECT X.No, X.ProdNo_P, Y.TestType, Y.Version, Y.ProdCode, Y.FileName, X.Comment, X.Description FROM [PROD_Variant] AS X WITH(NOLOCK) " + + DataTable dtTestList = ctrlDB.GetTable($"SELECT X.No, X.ProdNo_P, Y.TestType, Y.Version, Y.ProdCode, Y.FileName, X.Comment, Y.Description FROM [PROD_Variant] AS X WITH(NOLOCK) " + $"INNER JOIN [STOR_TestListFile] AS Y WITH(NOLOCK) ON X.TestListFileNo = Y.No " + $"WHERE X.No = " + getSelTestListRelInfo.VariantNo + " ORDER BY No ASC;"); @@ -396,7 +396,7 @@ namespace SystemX.Product.ALIS.UI.View.InfoList textBoxDispTestListComment.Text = ""; textBoxDispTestListDescription.Text = ""; - string strSetQueryText = $"SELECT X.No, X.ProdNo_P, Y.TestType, Y.Version, Y.ProdCode, Y.FileName, X.Comment, X.Description FROM [PROD_Variant] AS X WITH(NOLOCK) " + + string strSetQueryText = $"SELECT X.No, X.ProdNo_P, Y.TestType, Y.Version, Y.ProdCode, Y.FileName, X.Comment, Y.Description FROM [PROD_Variant] AS X WITH(NOLOCK) " + $"INNER JOIN [STOR_TestListFile] AS Y WITH(NOLOCK) ON X.TestListFileNo = Y.No " + $"WHERE X.ProdNo_P = '" + textBoxPProdNoInput.Text + "' "; diff --git a/CPXV2 TRA V2/SystemX.Product.CP.TRA.BaseView/UcTRABaseView.cs b/CPXV2 TRA V2/SystemX.Product.CP.TRA.BaseView/UcTRABaseView.cs index b8a7a23..edc9926 100644 --- a/CPXV2 TRA V2/SystemX.Product.CP.TRA.BaseView/UcTRABaseView.cs +++ b/CPXV2 TRA V2/SystemX.Product.CP.TRA.BaseView/UcTRABaseView.cs @@ -21,7 +21,7 @@ namespace SystemX.Product.TRA.UIControl NgHistory, ProductHistory, TestResult, - TestSummary, + TestSumamry, TestTrend } diff --git a/CPXV2 TRA V2/SystemX.Product.CP.TRA.sln b/CPXV2 TRA V2/SystemX.Product.CP.TRA.sln index 47142b0..2b7f382 100644 --- a/CPXV2 TRA V2/SystemX.Product.CP.TRA.sln +++ b/CPXV2 TRA V2/SystemX.Product.CP.TRA.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.9.34728.123 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.33027.164 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{18C1E9B6-823D-49DB-8253-ED32EEA21DB1}" EndProject @@ -12,8 +12,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemX.Product.CP.TRA", "S EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SystemX.Product.CP.TRA.BaseView", "SystemX.Product.CP.TRA.BaseView\SystemX.Product.CP.TRA.BaseView.csproj", "{910BB092-A5F3-4ACE-BBF8-C19434F1FA8E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JsonConvertTool", "JsonConvertTool\JsonConvertTool.csproj", "{7D1035C0-4E6B-493B-B11A-7D7CF8B082FD}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -38,20 +36,12 @@ Global {910BB092-A5F3-4ACE-BBF8-C19434F1FA8E}.Release|Any CPU.Build.0 = Release|Any CPU {910BB092-A5F3-4ACE-BBF8-C19434F1FA8E}.Release|x64.ActiveCfg = Release|Any CPU {910BB092-A5F3-4ACE-BBF8-C19434F1FA8E}.Release|x64.Build.0 = Release|Any CPU - {7D1035C0-4E6B-493B-B11A-7D7CF8B082FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7D1035C0-4E6B-493B-B11A-7D7CF8B082FD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7D1035C0-4E6B-493B-B11A-7D7CF8B082FD}.Debug|x64.ActiveCfg = Debug|Any CPU - {7D1035C0-4E6B-493B-B11A-7D7CF8B082FD}.Debug|x64.Build.0 = Debug|Any CPU - {7D1035C0-4E6B-493B-B11A-7D7CF8B082FD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7D1035C0-4E6B-493B-B11A-7D7CF8B082FD}.Release|Any CPU.Build.0 = Release|Any CPU - {7D1035C0-4E6B-493B-B11A-7D7CF8B082FD}.Release|x64.ActiveCfg = Release|Any CPU - {7D1035C0-4E6B-493B-B11A-7D7CF8B082FD}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - VisualSVNWorkingCopyRoot = . SolutionGuid = {34BF09E0-D510-452D-8E8B-B0D1C6FE25BF} + VisualSVNWorkingCopyRoot = . EndGlobalSection EndGlobal diff --git a/CPXV2 TRA V2/SystemX.Product.CP.TRA/DB/DataBaseConn.cs b/CPXV2 TRA V2/SystemX.Product.CP.TRA/DB/DataBaseConn.cs index 2c9990f..40d7875 100644 --- a/CPXV2 TRA V2/SystemX.Product.CP.TRA/DB/DataBaseConn.cs +++ b/CPXV2 TRA V2/SystemX.Product.CP.TRA/DB/DataBaseConn.cs @@ -136,14 +136,14 @@ namespace DataBaseConnection.Control if(list?.Count > 0) { //short term - var shortTermCatalogName = list.Find(x => x.ToLower().Contains("short") && x.ToLower().Contains("json")); + var shortTermCatalogName = list.Find(x => x.ToLower().Contains("short")); if(string.IsNullOrEmpty(shortTermCatalogName) ==false) { ShortTermCatalogName = shortTermCatalogName; } //long term - var longTermCatalogName = list.FindAll(x => x.ToLower().Contains("long") && x.ToLower().Contains("json")); + var longTermCatalogName = list.FindAll(x => x.ToLower().Contains("long")); if(longTermCatalogName?.Count() > 0) { LongTermCatalogName?.Clear(); @@ -165,8 +165,6 @@ namespace DataBaseConnection.Control { try { - SqlConnection connecction; - connShortTerm1 = new SqlConnection($"Data Source=localhost; Initial Catalog={ShortTermCatalogName}; Integrated Security = SSPI; MultipleActiveResultSets=True;"); // MultipleActiveResultSets=True;"); connShortTerm1.Open(); @@ -174,7 +172,7 @@ namespace DataBaseConnection.Control { connLongTerm1.Add(catalog, new SqlConnection($"Data Source=localhost; Initial Catalog={catalog}; Integrated Security = SSPI; MultipleActiveResultSets=True;")); // MultipleActiveResultSets=True;"); - if (connLongTerm1.TryGetValue(catalog, out connecction) == true) + if (connLongTerm1.TryGetValue(catalog, out var connecction) == true) { connecction.Open(); } @@ -193,8 +191,6 @@ namespace DataBaseConnection.Control { try { - SqlConnection connecction; - connShortTerm2 = new SqlConnection($"Data Source=localhost; Initial Catalog={ShortTermCatalogName}; Integrated Security = SSPI; MultipleActiveResultSets=True;"); // MultipleActiveResultSets=True;"); connShortTerm2.Open(); @@ -202,7 +198,7 @@ namespace DataBaseConnection.Control { connLongTerm2.Add(catalog, new SqlConnection($"Data Source=localhost; Initial Catalog={catalog}; Integrated Security = SSPI; MultipleActiveResultSets=True;")); // MultipleActiveResultSets=True;"); - if (connLongTerm2.TryGetValue(catalog, out connecction) == true) + if (connLongTerm2.TryGetValue(catalog, out var connecction) == true) { connecction.Open(); } diff --git a/CPXV2 TRA V2/SystemX.Product.CP.TRA/DataManager/DMDetailOverview.cs b/CPXV2 TRA V2/SystemX.Product.CP.TRA/DataManager/DMDetailOverview.cs index 52b0b5b..140fc96 100644 --- a/CPXV2 TRA V2/SystemX.Product.CP.TRA/DataManager/DMDetailOverview.cs +++ b/CPXV2 TRA V2/SystemX.Product.CP.TRA/DataManager/DMDetailOverview.cs @@ -186,6 +186,7 @@ namespace SystemX.Product.TRA.DataManager else { strQuery += $"ROW_NUMBER() OVER(PARTITION BY {DMCommon.SummaryLogTable}.[ProdNo_C], {DMCommon.SummaryLogTable}.[ProdNo_P] ORDER BY CONVERT(CHAR(23), MAX({DMCommon.SummaryLogTable}.[TestDT]), 121) DESC) AS RN "; + //strQuery += $"ROW_NUMBER() OVER(PARTITION BY {DMCommon.SummaryLogTable}.[ProdNo_C], {DMCommon.SummaryLogTable}.[Testcode] ORDER BY CONVERT(CHAR(23), MAX({DMCommon.SummaryLogTable}.[TestDT]), 121) DESC) AS RN "; } strQuery += $"FROM {DMCommon.SummaryLogTable} "; @@ -316,11 +317,14 @@ namespace SystemX.Product.TRA.DataManager strQuery += $"COUNT(CASE WHEN {DMCommon.SummaryLogTable}.[Result] != 'OK' THEN 1 END) AS {eColList.NG.ToString()},"; strQuery += $"ROW_NUMBER() OVER(PARTITION BY {DMCommon.SummaryLogTable}.[ProdNo_C], {DMCommon.SummaryLogTable}.[ProdNo_P] ORDER BY CONVERT(CHAR(23), MAX({DMCommon.SummaryLogTable}.[TestDT]), 121) DESC) AS RN,"; + //strQuery += $"ROW_NUMBER() OVER(PARTITION BY {DMCommon.SummaryLogTable}.[ProdNo_C], {DMCommon.SummaryLogTable}.[Testcode] ORDER BY CONVERT(CHAR(23), MAX({DMCommon.SummaryLogTable}.[TestDT]), 121) DESC) AS RN,"; + //strQuery += $"ROW_NUMBER() OVER(PARTITION BY {DMCommon.SummaryLogTable}.[ProdNo_C] ORDER BY CONVERT(CHAR(23), MAX({DMCommon.SummaryLogTable}.[TestDT]), 121) DESC) AS RN,"; strQuery += $"{DMCommon.SummaryLogTable}.[TestListCntID] "; strQuery += $"FROM {DMCommon.SummaryLogTable} "; strQuery += $"WITH(NOLOCK) "; + //strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = CONVERT(NVARCHAR, {DMCommon.SummaryLogTable}.[TestListVariantNo]) "; switch (GetSelectInfo) { diff --git a/CPXV2 TRA V2/SystemX.Product.CP.TRA/DataManager/DMOverview.cs b/CPXV2 TRA V2/SystemX.Product.CP.TRA/DataManager/DMOverview.cs index c07caf0..ab2f6bb 100644 --- a/CPXV2 TRA V2/SystemX.Product.CP.TRA/DataManager/DMOverview.cs +++ b/CPXV2 TRA V2/SystemX.Product.CP.TRA/DataManager/DMOverview.cs @@ -210,7 +210,9 @@ namespace SystemX.Product.TRA.DataManager } else { + //strQuery += $"ROW_NUMBER() OVER(PARTITION BY {DMCommon.SummaryLogTable}.[ProdNo_C], {DMCommon.SummaryLogTable}.[ProdNo_P] ORDER BY CONVERT(CHAR(23), MAX({DMCommon.SummaryLogTable}.[TestDT]), 121) DESC) AS RN,"; strQuery += $"ROW_NUMBER() OVER(PARTITION BY {DMCommon.SummaryLogTable}.[ProdNo_C], {DMCommon.SummaryLogTable}.[Testcode] ORDER BY CONVERT(CHAR(23), MAX({DMCommon.SummaryLogTable}.[TestDT]), 121) DESC) AS RN,"; + //strQuery += $"ROW_NUMBER() OVER(PARTITION BY {DMCommon.SummaryLogTable}.[ProdNo_C] ORDER BY CONVERT(CHAR(23), MAX({DMCommon.SummaryLogTable}.[TestDT]), 121) DESC) AS RN,"; strQuery = strQuery.Remove(strQuery.Length - 1, 1); } @@ -229,8 +231,8 @@ namespace SystemX.Product.TRA.DataManager strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo "; break; case eOverviewModelNameInfo.P1: - strQuery += $"LEFT JOIN [P1].[CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] "; - strQuery += $"LEFT JOIN [P1].[CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo "; + strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] "; + strQuery += $"LEFT JOIN [CPXV2].[dbo].[PROD_Group] AS Y WITH(NOLOCK) ON Y.No = X.GroupNo "; break; case eOverviewModelNameInfo.P2: strQuery += $"LEFT JOIN [P2].[CPXV2].[dbo].[PROD_Variant] AS X WITH(NOLOCK) ON X.No = {DMCommon.SummaryLogTable}.[TestListVariantNo] "; diff --git a/CPXV2 TRA V2/SystemX.Product.CP.TRA/DataManager/DMStepTrend.cs b/CPXV2 TRA V2/SystemX.Product.CP.TRA/DataManager/DMStepTrend.cs index c1d19b8..a61cd2e 100644 --- a/CPXV2 TRA V2/SystemX.Product.CP.TRA/DataManager/DMStepTrend.cs +++ b/CPXV2 TRA V2/SystemX.Product.CP.TRA/DataManager/DMStepTrend.cs @@ -49,7 +49,7 @@ namespace SystemX.Product.TRA.DataManager } } - public DataTable SearchTestResult(DateTime dtTest, ulong nAccNo) + public DataTable SearchTestResult(DateTime dtTest) { if (TrendSelectView == eSelectDataView.DataDocumentViewC1) { @@ -81,11 +81,9 @@ namespace SystemX.Product.TRA.DataManager strQuery += $"*"; strQuery += " "; strQuery += $"from {DMCommon.ResultLogTable} "; - strQuery += $"WITH(NOLOCK) "; - strQuery += $"where [No] = {nAccNo}"; - strQuery += " "; - //strQuery += $"order by "; - //strQuery += $"[No]"; + strQuery += $"WITH(NOLOCK) "; + strQuery += $"order by "; + strQuery += $"[No]"; strQuery += ";"; if (DatabaseConnControl.ScanLongTermLog) SQLCmd = new SqlCommand(strQuery, LongTermDBConn); diff --git a/CPXV2 TRA V2/SystemX.Product.CP.TRA/DataManager/DMTestSummary.cs b/CPXV2 TRA V2/SystemX.Product.CP.TRA/DataManager/DMTestSummary.cs index e9bfe51..4f4b377 100644 --- a/CPXV2 TRA V2/SystemX.Product.CP.TRA/DataManager/DMTestSummary.cs +++ b/CPXV2 TRA V2/SystemX.Product.CP.TRA/DataManager/DMTestSummary.cs @@ -299,17 +299,19 @@ namespace SystemX.Product.TRA.DataManager public DataTable SearchTestSummary(string[] testReqID, List vnpSummaryNo) { - string strGetDataTime = testReqID?.First().Split('@',';')[0]; - - int nGetDataTimeYYYY = Convert.ToInt32(strGetDataTime.Substring(0, 4)); - int nGetDataTimemm = Convert.ToInt32(strGetDataTime.Substring(4, 2)); - int nGetDataTimeDD = Convert.ToInt32(strGetDataTime.Substring(6, 2)); - int nGetDataTimeHH = Convert.ToInt32(strGetDataTime.Substring(8, 2)); - int nGetDataTimeMM = Convert.ToInt32(strGetDataTime.Substring(10, 2)); - int nGetDataTimeSS = Convert.ToInt32(strGetDataTime.Substring(12, 2)); - int nGetDataTimeFFF = Convert.ToInt32(strGetDataTime.Substring(14, 3)); - - DateTime start = new DateTime(nGetDataTimeYYYY, nGetDataTimemm, nGetDataTimeDD, nGetDataTimeHH, nGetDataTimeMM, nGetDataTimeSS, nGetDataTimeFFF);//Convert.ToDateTime(testReqID?.First().Split('@')[0]); + DateTime start = DateTime.Now; + try + { + string requId = testReqID?.First(); + if (string.IsNullOrEmpty(requId) == false && requId.Contains(";") == true || requId.Contains("@") == true) + { + start = Convert.ToDateTime(requId.Split(';','@')[0]); + } + } + catch (Exception e) + { + //start = DateTime + } if (TestSummarySelectView == eSelectDataView.DataDocumentViewC1) { @@ -365,48 +367,24 @@ namespace SystemX.Product.TRA.DataManager list.AddRange(JsonConvert.DeserializeObject>(dtResult.Rows[i]["LogData"].ToString().GzipDecompress())); } - /* - strQuery += $"SELECT "; - strQuery += $"Y.[StepID], "; - strQuery += $"AVG(CASE WHEN (Y.[MeasValStr] = NULL OR Y.[MeasValStr] = '') AND (Y.[Message] = NULL OR Y.[Message] = '') AND (Y.[MeasVal] != 0.00000 AND Y.[Result] != 'NONE') THEN Y.[MeasVal] ELSE NULL END) AS Average, "; - strQuery += $"COUNT(Y.[Result]) AS Total, "; - strQuery += $"COUNT(CASE WHEN Y.[Result] = 'OK' THEN 1 END) AS OK, "; - strQuery += $"COUNT(CASE WHEN Y.[Result] = 'NG' OR X.[Result] = 'ERROR' THEN 1 END) AS NG "; - strQuery += $" "; - strQuery += $"FROM [{DMCommon.SummaryLogTable}] AS X WITH(NOLOCK) "; - strQuery += $"INNER JOIN [{strTableTerm}] AS Y WITH(NOLOCK) ON (Y.AccessKey BETWEEN X.AccessStart AND X.AccessEnd) "; - */ - dtResult = list.GroupBy(x => x.StepID).Select(y => new { StepID = y.First().StepID, - Average = GetAvg(y.ToList()), + Average = GetAvg(y.Average(z => z.MeasVal)), Total = y.Count(), - OK = y.Count(z => z.Result.Contains("OK")), - NG = y.Count(z => !z.Result.Contains("OK")) - }).OrderBy(y => y.StepID).ToDataTable(); + OK = y.Count(z => !z.Result.Contains("NG") && !z.Result.Contains("ERROR")), + NG = y.Count() - y.Count(z => !z.Result.Contains("NG") && !z.Result.Contains("ERROR")) + }).OrderBy(y=>y.StepID).ToDataTable(); return dtResult; } - string GetAvg(List res) + string GetAvg(decimal avg) { - CPXV2Log.Tables.HIST_TestResult value = res.First(); - - if (string.IsNullOrEmpty(value.MeasValStr) && - string.IsNullOrEmpty(value.Message) && - ((value.MeasVal != 0) && - string.Compare(value.Result, "NONE") != 0)) - return res.Average(x => x.MeasVal).ToString(); - - string strDefaultValue = string.Empty; - - if (string.IsNullOrEmpty(value.MeasValStr) == false) - strDefaultValue = value.MeasValStr; - else if (string.IsNullOrEmpty(value.Message) == false) - strDefaultValue = value.Message; - - return strDefaultValue; + if (avg > 0) + return avg.ToString(); + else + return string.Empty; } DataTable GetRawResult(DetailTestDataCollection data) diff --git a/CPXV2 TRA V2/SystemX.Product.CP.TRA/MainForm.Designer.cs b/CPXV2 TRA V2/SystemX.Product.CP.TRA/MainForm.Designer.cs index a632b12..790e0a3 100644 --- a/CPXV2 TRA V2/SystemX.Product.CP.TRA/MainForm.Designer.cs +++ b/CPXV2 TRA V2/SystemX.Product.CP.TRA/MainForm.Designer.cs @@ -30,27 +30,27 @@ { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); - DevExpress.Skins.SkinPaddingEdges skinPaddingEdges1 = new DevExpress.Skins.SkinPaddingEdges(); - DevExpress.XtraBars.Ribbon.GalleryItemGroup galleryItemGroup1 = new DevExpress.XtraBars.Ribbon.GalleryItemGroup(); - DevExpress.XtraBars.Ribbon.GalleryItem galleryItem1 = new DevExpress.XtraBars.Ribbon.GalleryItem(); - DevExpress.Utils.SuperToolTip superToolTip1 = new DevExpress.Utils.SuperToolTip(); - DevExpress.Utils.ToolTipItem toolTipItem1 = new DevExpress.Utils.ToolTipItem(); - DevExpress.XtraBars.Ribbon.GalleryItem galleryItem2 = new DevExpress.XtraBars.Ribbon.GalleryItem(); - DevExpress.Utils.SuperToolTip superToolTip2 = new DevExpress.Utils.SuperToolTip(); - DevExpress.Utils.ToolTipItem toolTipItem2 = new DevExpress.Utils.ToolTipItem(); - DevExpress.XtraBars.Ribbon.GalleryItem galleryItem3 = new DevExpress.XtraBars.Ribbon.GalleryItem(); - DevExpress.Utils.SuperToolTip superToolTip3 = new DevExpress.Utils.SuperToolTip(); - DevExpress.Utils.ToolTipItem toolTipItem3 = new DevExpress.Utils.ToolTipItem(); - DevExpress.XtraBars.Ribbon.GalleryItem galleryItem4 = new DevExpress.XtraBars.Ribbon.GalleryItem(); - DevExpress.Utils.SuperToolTip superToolTip4 = new DevExpress.Utils.SuperToolTip(); - DevExpress.Utils.ToolTipItem toolTipItem4 = new DevExpress.Utils.ToolTipItem(); - DevExpress.XtraBars.Ribbon.GalleryItem galleryItem5 = new DevExpress.XtraBars.Ribbon.GalleryItem(); - DevExpress.Utils.SuperToolTip superToolTip5 = new DevExpress.Utils.SuperToolTip(); - DevExpress.Utils.ToolTipItem toolTipItem5 = new DevExpress.Utils.ToolTipItem(); - DevExpress.XtraBars.Ribbon.GalleryItem galleryItem6 = new DevExpress.XtraBars.Ribbon.GalleryItem(); - DevExpress.Utils.SuperToolTip superToolTip6 = new DevExpress.Utils.SuperToolTip(); - DevExpress.Utils.ToolTipItem toolTipItem6 = new DevExpress.Utils.ToolTipItem(); - DevExpress.Skins.SkinPaddingEdges skinPaddingEdges2 = new DevExpress.Skins.SkinPaddingEdges(); + DevExpress.Skins.SkinPaddingEdges skinPaddingEdges5 = new DevExpress.Skins.SkinPaddingEdges(); + DevExpress.XtraBars.Ribbon.GalleryItemGroup galleryItemGroup3 = new DevExpress.XtraBars.Ribbon.GalleryItemGroup(); + DevExpress.XtraBars.Ribbon.GalleryItem galleryItem13 = new DevExpress.XtraBars.Ribbon.GalleryItem(); + DevExpress.Utils.SuperToolTip superToolTip13 = new DevExpress.Utils.SuperToolTip(); + DevExpress.Utils.ToolTipItem toolTipItem13 = new DevExpress.Utils.ToolTipItem(); + DevExpress.XtraBars.Ribbon.GalleryItem galleryItem14 = new DevExpress.XtraBars.Ribbon.GalleryItem(); + DevExpress.Utils.SuperToolTip superToolTip14 = new DevExpress.Utils.SuperToolTip(); + DevExpress.Utils.ToolTipItem toolTipItem14 = new DevExpress.Utils.ToolTipItem(); + DevExpress.XtraBars.Ribbon.GalleryItem galleryItem15 = new DevExpress.XtraBars.Ribbon.GalleryItem(); + DevExpress.Utils.SuperToolTip superToolTip15 = new DevExpress.Utils.SuperToolTip(); + DevExpress.Utils.ToolTipItem toolTipItem15 = new DevExpress.Utils.ToolTipItem(); + DevExpress.XtraBars.Ribbon.GalleryItem galleryItem16 = new DevExpress.XtraBars.Ribbon.GalleryItem(); + DevExpress.Utils.SuperToolTip superToolTip16 = new DevExpress.Utils.SuperToolTip(); + DevExpress.Utils.ToolTipItem toolTipItem16 = new DevExpress.Utils.ToolTipItem(); + DevExpress.XtraBars.Ribbon.GalleryItem galleryItem17 = new DevExpress.XtraBars.Ribbon.GalleryItem(); + DevExpress.Utils.SuperToolTip superToolTip17 = new DevExpress.Utils.SuperToolTip(); + DevExpress.Utils.ToolTipItem toolTipItem17 = new DevExpress.Utils.ToolTipItem(); + DevExpress.XtraBars.Ribbon.GalleryItem galleryItem18 = new DevExpress.XtraBars.Ribbon.GalleryItem(); + DevExpress.Utils.SuperToolTip superToolTip18 = new DevExpress.Utils.SuperToolTip(); + DevExpress.Utils.ToolTipItem toolTipItem18 = new DevExpress.Utils.ToolTipItem(); + DevExpress.Skins.SkinPaddingEdges skinPaddingEdges6 = new DevExpress.Skins.SkinPaddingEdges(); this.ribbonControl = new DevExpress.XtraBars.Ribbon.RibbonControl(); this.barStaticItemConn = new DevExpress.XtraBars.BarStaticItem(); this.barButtonItemQueryTestOn = new DevExpress.XtraBars.BarButtonItem(); @@ -248,7 +248,7 @@ this.repositoryItemProgressBar1}); this.ribbonControl.RibbonStyle = DevExpress.XtraBars.Ribbon.RibbonControlStyle.Office2013; this.ribbonControl.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.False; - this.ribbonControl.Size = new System.Drawing.Size(1485, 237); + this.ribbonControl.Size = new System.Drawing.Size(1485, 197); this.ribbonControl.StatusBar = this.ribbonStatusBar; this.ribbonControl.ToolbarLocation = DevExpress.XtraBars.Ribbon.RibbonQuickAccessToolbarLocation.Hidden; // @@ -282,9 +282,9 @@ this.skinRibbonGalleryBarItem.Gallery.ItemCheckMode = DevExpress.XtraBars.Ribbon.Gallery.ItemCheckMode.SingleRadio; this.skinRibbonGalleryBarItem.Gallery.ItemImageLayout = DevExpress.Utils.Drawing.ImageLayoutMode.Squeeze; this.skinRibbonGalleryBarItem.Gallery.ItemImageLocation = DevExpress.Utils.Locations.Top; - skinPaddingEdges1.Left = 8; - skinPaddingEdges1.Right = 8; - this.skinRibbonGalleryBarItem.Gallery.ItemImagePadding = skinPaddingEdges1; + skinPaddingEdges5.Left = 8; + skinPaddingEdges5.Right = 8; + this.skinRibbonGalleryBarItem.Gallery.ItemImagePadding = skinPaddingEdges5; this.skinRibbonGalleryBarItem.Id = 14; this.skinRibbonGalleryBarItem.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("skinRibbonGalleryBarItem.ImageOptions.Image"))); this.skinRibbonGalleryBarItem.ImageOptions.LargeImage = ((System.Drawing.Image)(resources.GetObject("skinRibbonGalleryBarItem.ImageOptions.LargeImage"))); @@ -326,60 +326,60 @@ // this.skinPaletteRibbonGalleryBarItem.Gallery.AllowHtmlText = true; this.skinPaletteRibbonGalleryBarItem.Gallery.ColumnCount = 4; - galleryItemGroup1.Caption = "General"; - galleryItem1.Caption = "Default"; - galleryItem1.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image"))); - toolTipItem1.Text = "Default"; - superToolTip1.Items.Add(toolTipItem1); - galleryItem1.SuperTip = superToolTip1; - galleryItem1.Tag = "DefaultSkinPalette"; - galleryItem1.Value = "DefaultSkinPalette"; - galleryItem2.Caption = "Blue Dark"; - galleryItem2.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image1"))); - toolTipItem2.Text = "Blue Dark"; - superToolTip2.Items.Add(toolTipItem2); - galleryItem2.SuperTip = superToolTip2; - galleryItem2.Tag = "Blue Dark"; - galleryItem2.Value = "Blue Dark"; - galleryItem3.Caption = "Pine Light"; - galleryItem3.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image2"))); - toolTipItem3.Text = "Pine Light"; - superToolTip3.Items.Add(toolTipItem3); - galleryItem3.SuperTip = superToolTip3; - galleryItem3.Tag = "Pine Light"; - galleryItem3.Value = "Pine Light"; - galleryItem4.Caption = "Pine Dark"; - galleryItem4.Checked = true; - galleryItem4.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image3"))); - toolTipItem4.Text = "Pine Dark"; - superToolTip4.Items.Add(toolTipItem4); - galleryItem4.SuperTip = superToolTip4; - galleryItem4.Tag = "Pine Dark"; - galleryItem4.Value = "Pine Dark"; - galleryItem5.Caption = "Violet Light"; - galleryItem5.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image4"))); - toolTipItem5.Text = "Violet Light"; - superToolTip5.Items.Add(toolTipItem5); - galleryItem5.SuperTip = superToolTip5; - galleryItem5.Tag = "Violet Light"; - galleryItem5.Value = "Violet Light"; - galleryItem6.Caption = "Violet Dark"; - galleryItem6.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image5"))); - toolTipItem6.Text = "Violet Dark"; - superToolTip6.Items.Add(toolTipItem6); - galleryItem6.SuperTip = superToolTip6; - galleryItem6.Tag = "Violet Dark"; - galleryItem6.Value = "Violet Dark"; - galleryItemGroup1.Items.AddRange(new DevExpress.XtraBars.Ribbon.GalleryItem[] { - galleryItem1, - galleryItem2, - galleryItem3, - galleryItem4, - galleryItem5, - galleryItem6}); + galleryItemGroup3.Caption = "General"; + galleryItem13.Caption = "Default"; + galleryItem13.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image"))); + toolTipItem13.Text = "Default"; + superToolTip13.Items.Add(toolTipItem13); + galleryItem13.SuperTip = superToolTip13; + galleryItem13.Tag = "DefaultSkinPalette"; + galleryItem13.Value = "DefaultSkinPalette"; + galleryItem14.Caption = "Blue Dark"; + galleryItem14.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image1"))); + toolTipItem14.Text = "Blue Dark"; + superToolTip14.Items.Add(toolTipItem14); + galleryItem14.SuperTip = superToolTip14; + galleryItem14.Tag = "Blue Dark"; + galleryItem14.Value = "Blue Dark"; + galleryItem15.Caption = "Pine Light"; + galleryItem15.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image2"))); + toolTipItem15.Text = "Pine Light"; + superToolTip15.Items.Add(toolTipItem15); + galleryItem15.SuperTip = superToolTip15; + galleryItem15.Tag = "Pine Light"; + galleryItem15.Value = "Pine Light"; + galleryItem16.Caption = "Pine Dark"; + galleryItem16.Checked = true; + galleryItem16.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image3"))); + toolTipItem16.Text = "Pine Dark"; + superToolTip16.Items.Add(toolTipItem16); + galleryItem16.SuperTip = superToolTip16; + galleryItem16.Tag = "Pine Dark"; + galleryItem16.Value = "Pine Dark"; + galleryItem17.Caption = "Violet Light"; + galleryItem17.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image4"))); + toolTipItem17.Text = "Violet Light"; + superToolTip17.Items.Add(toolTipItem17); + galleryItem17.SuperTip = superToolTip17; + galleryItem17.Tag = "Violet Light"; + galleryItem17.Value = "Violet Light"; + galleryItem18.Caption = "Violet Dark"; + galleryItem18.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("resource.Image5"))); + toolTipItem18.Text = "Violet Dark"; + superToolTip18.Items.Add(toolTipItem18); + galleryItem18.SuperTip = superToolTip18; + galleryItem18.Tag = "Violet Dark"; + galleryItem18.Value = "Violet Dark"; + galleryItemGroup3.Items.AddRange(new DevExpress.XtraBars.Ribbon.GalleryItem[] { + galleryItem13, + galleryItem14, + galleryItem15, + galleryItem16, + galleryItem17, + galleryItem18}); this.skinPaletteRibbonGalleryBarItem.Gallery.Groups.AddRange(new DevExpress.XtraBars.Ribbon.GalleryItemGroup[] { - galleryItemGroup1}); - this.skinPaletteRibbonGalleryBarItem.Gallery.ImageSize = new System.Drawing.Size(120, 84); + galleryItemGroup3}); + this.skinPaletteRibbonGalleryBarItem.Gallery.ImageSize = new System.Drawing.Size(80, 56); this.skinPaletteRibbonGalleryBarItem.Gallery.ItemCheckMode = DevExpress.XtraBars.Ribbon.Gallery.ItemCheckMode.SingleRadio; this.skinPaletteRibbonGalleryBarItem.Gallery.ItemImageLayout = DevExpress.Utils.Drawing.ImageLayoutMode.Stretch; this.skinPaletteRibbonGalleryBarItem.Gallery.MinimumColumnCount = 2; @@ -614,9 +614,9 @@ this.skinRibbonGalleryBarItemTheme.Gallery.ItemCheckMode = DevExpress.XtraBars.Ribbon.Gallery.ItemCheckMode.SingleRadio; this.skinRibbonGalleryBarItemTheme.Gallery.ItemImageLayout = DevExpress.Utils.Drawing.ImageLayoutMode.Squeeze; this.skinRibbonGalleryBarItemTheme.Gallery.ItemImageLocation = DevExpress.Utils.Locations.Top; - skinPaddingEdges2.Left = 8; - skinPaddingEdges2.Right = 8; - this.skinRibbonGalleryBarItemTheme.Gallery.ItemImagePadding = skinPaddingEdges2; + skinPaddingEdges6.Left = 8; + skinPaddingEdges6.Right = 8; + this.skinRibbonGalleryBarItemTheme.Gallery.ItemImagePadding = skinPaddingEdges6; this.skinRibbonGalleryBarItemTheme.Id = 74; this.skinRibbonGalleryBarItemTheme.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("skinRibbonGalleryBarItemTheme.ImageOptions.Image"))); this.skinRibbonGalleryBarItemTheme.ImageOptions.LargeImage = ((System.Drawing.Image)(resources.GetObject("skinRibbonGalleryBarItemTheme.ImageOptions.LargeImage"))); @@ -907,11 +907,11 @@ // ribbonStatusBar // this.ribbonStatusBar.ItemLinks.Add(this.barStaticItem1); - this.ribbonStatusBar.Location = new System.Drawing.Point(0, 747); + this.ribbonStatusBar.Location = new System.Drawing.Point(0, 753); this.ribbonStatusBar.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.ribbonStatusBar.Name = "ribbonStatusBar"; this.ribbonStatusBar.Ribbon = this.ribbonControl; - this.ribbonStatusBar.Size = new System.Drawing.Size(1485, 36); + this.ribbonStatusBar.Size = new System.Drawing.Size(1485, 30); // // dockManager // @@ -934,9 +934,9 @@ this.hideContainerLeft.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(50))))); this.hideContainerLeft.Controls.Add(this.dockPanel); this.hideContainerLeft.Dock = System.Windows.Forms.DockStyle.Left; - this.hideContainerLeft.Location = new System.Drawing.Point(0, 237); + this.hideContainerLeft.Location = new System.Drawing.Point(0, 197); this.hideContainerLeft.Name = "hideContainerLeft"; - this.hideContainerLeft.Size = new System.Drawing.Size(32, 510); + this.hideContainerLeft.Size = new System.Drawing.Size(28, 556); // // dockPanel // @@ -1022,7 +1022,7 @@ // MainForm // this.Appearance.Options.UseFont = true; - this.AutoScaleDimensions = new System.Drawing.SizeF(14F, 29F); + this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackgroundImageLayoutStore = System.Windows.Forms.ImageLayout.Zoom; this.BackgroundImageStore = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImageStore"))); diff --git a/CPXV2 TRA V2/SystemX.Product.CP.TRA/MainForm.cs b/CPXV2 TRA V2/SystemX.Product.CP.TRA/MainForm.cs index b81d1ec..d1a93b6 100644 --- a/CPXV2 TRA V2/SystemX.Product.CP.TRA/MainForm.cs +++ b/CPXV2 TRA V2/SystemX.Product.CP.TRA/MainForm.cs @@ -409,7 +409,7 @@ namespace SystemX.Product.CP.TRA { foreach (string catalog in DatabaseConnControl.LongTermCatalogName) { - DatabaseConnControl.ConnectDataDB2(strConnIPAddressDT2, nConnPortDT2, catalog); + DatabaseConnControl.ConnectDataDB2(strConnIPAddressDT1, nConnPortDT1, catalog); } DBConnShortTerm2 = DatabaseConnControl.GetShortTermConn2(); @@ -425,11 +425,10 @@ namespace SystemX.Product.CP.TRA LongTermSQLCmd1 = new Dictionary(); - SqlCommand sqlCmd; foreach (var con in DatabaseConnControl.GetLongTermConn1()) { LongTermSQLCmd1.Add($"{con.Key}", new SqlCommand()); - if (LongTermSQLCmd1.TryGetValue($"{con.Key}", out sqlCmd) == true) + if (LongTermSQLCmd1.TryGetValue($"{con.Key}", out var sqlCmd) == true) { sqlCmd.Connection = con.Value; } @@ -449,14 +448,12 @@ namespace SystemX.Product.CP.TRA ShortTermSQLCmd2.Connection = DatabaseConnControl.GetShortTermConn2(); LongTermSQLCmd2 = new Dictionary(); - SqlCommand sqlCmd2; - foreach (var con in DatabaseConnControl.GetLongTermConn2()) { LongTermSQLCmd2.Add($"{con.Key}", new SqlCommand()); - if (LongTermSQLCmd2.TryGetValue($"{con.Key}", out sqlCmd2) == true) + if (LongTermSQLCmd2.TryGetValue($"{con.Key}", out var sqlCmd) == true) { - sqlCmd2.Connection = con.Value; + sqlCmd.Connection = con.Value; } } @@ -1468,7 +1465,7 @@ namespace SystemX.Product.CP.TRA { nFirstViewCount++; - strSetViewID = eContents.TestSummary.ToString() + eDataView.C1.ToString() + $"({nFirstViewCount})"; + strSetViewID = eContents.TestSumamry.ToString() + eDataView.C1.ToString() + $"({nFirstViewCount})"; view.ViewID = strSetViewID; DicViewFirstMgr.Add(strSetViewID, view); } @@ -1476,13 +1473,13 @@ namespace SystemX.Product.CP.TRA { nSecondViewCount++; - strSetViewID = eContents.TestSummary.ToString() + eDataView.C2.ToString() + $"({nSecondViewCount})"; + strSetViewID = eContents.TestSumamry.ToString() + eDataView.C2.ToString() + $"({nSecondViewCount})"; view.ViewID = strSetViewID; DicViewSecondMgr.Add(strSetViewID, view); } tabbedView.AddDocument(view, view.ViewID); - //tabbedView.AddDocument(view, eContents.TestSummary.ToString()); + //tabbedView.AddDocument(view, eContents.TestSumamry.ToString()); CreateAccordianElement(view); SelectAccordianElement(view.ViewID); diff --git a/CPXV2 TRA V2/SystemX.Product.CP.TRA/MainForm.resx b/CPXV2 TRA V2/SystemX.Product.CP.TRA/MainForm.resx index 4cb1773..b1f821a 100644 --- a/CPXV2 TRA V2/SystemX.Product.CP.TRA/MainForm.resx +++ b/CPXV2 TRA V2/SystemX.Product.CP.TRA/MainForm.resx @@ -313,62 +313,56 @@ - iVBORw0KGgoAAAANSUhEUgAAAHgAAABUCAYAAABJCvOfAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAADhSURBVHhe7dHRFMRAFECxISvCCpShHJVYtIEYg1ePnPsR - gqzrfieugnEF4wrGFYwrGFcwrmBcwbiCcQXjCsYVjCsYVzCuYFzBuIJxBeMKxhWMW7/nP3EVjCsYVzCu - YFzBuIJxBeMKxhWMKxhXMK5gXMG4gnEF4wrGFYwrGFcwrmDc2ntPXAXjCsYVjCsYVzCuYFzBuIJxBeMK - xhWMKxhXMK5gXMG4gnEF4wrGFYwrGLfOORNXwbiCcQXjCsYVjCsYVzCuYFzBuIJxBeMKxhWMKxhXMK5g - XMG4gnEF4wqmnfkAOWuTNXE9au8AAAAASUVORK5CYII= + iVBORw0KGgoAAAANSUhEUgAAAFAAAAA4CAYAAABqtn+aAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAJlJREFUeF7t0EEBAjEQALEqQwIGTgM6MIG0iqiDxUPnm0cMZL2e73BPYCQwEhgJ + jARGAiOBkcBIYCQwEhgJjARG6/35DfcERgIjgZHASGAkMBIYCYwERgIjgZHASGC09t7DPYGRwEhgJDAS + GAmMBEYCI4GRwEhgJDASGK1zznBPYCQwEhgJjARGAiOBkcBIYCQwEhgJjAQmZ/7FSM+eKiweNQAAAABJ + RU5ErkJggg== - iVBORw0KGgoAAAANSUhEUgAAAHgAAABUCAYAAABJCvOfAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAADgSURBVHhe7dExEcQwEAAxY3Lj7iGEQDAER0g81wuPHRVC - oPW736FLcJzgOMFxguMExwmOExwnOE5wnOA4wXGC4wTHCY4THCc4TnCc4DjBcYLj1vX8hy7BcYLjBMcJ - jhMcJzhOcJzgOMFxguMExwmOExwnOE5wnOA4wXGC4wTHCY5b55yhS3Cc4DjBcYLjBMcJjhMcJzhOcJzg - OMFxguMExwmOExwnOE5wnOA4wXGC49bee+gSHCc4TnCc4DjBcYLjBMcJjhMcJzhOcJzgOMFxguMExwmO - ExwnOE5wnOC0PR8WGZ02AM12IQAAAABJRU5ErkJggg== + iVBORw0KGgoAAAANSUhEUgAAAFAAAAA4CAYAAABqtn+aAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAJlJREFUeF7t0DEBAjEUQLFq6tINCRhAAzrOBF4/HvrWDDGQ9fo8wz2BkcBIYCQw + EhgJjARGAiOBkcBIYCQwEhit9/c33BMYCYwERgIjgZHASGAkMBIYCYwERgIjgdE65wz3BEYCI4GRwEhg + JDASGAmMBEYCI4GRwEhgtPbewz2BkcBIYCQwEhgJjARGAiOBkcBIYCQwEpjs+QPLxZswtjP5RwAAAABJ + RU5ErkJggg== - iVBORw0KGgoAAAANSUhEUgAAAHgAAABUCAYAAABJCvOfAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAADgSURBVHhe7dFBFYQwEECx2kPCWkABFxSsxYqog8FH3j9E - Qdb13BNXwbiCcQXjCsYVjCsYVzCuYFzBuIJxBeMKxhWMKxhXMK5gXMG4gnEF4wrGrd//nbgKxhWMKxhX - MK5gXMG4gnEF4wrGFYwrGFcwrmBcwbiCcQXjCsYVjCsYVzBu7b0nroJxBeMKxhWMKxhXMK5gXMG4gnEF - 4wrGFYwrGFcwrmBcwbiCcQXjCsYVjFvnnImrYFzBuIJxBeMKxhWMKxhXMK5gXMG4gnEF4wrGFYwrGFcw - rmBcwbiCcQXTznwnymH8KvCrXAAAAABJRU5ErkJggg== + iVBORw0KGgoAAAANSUhEUgAAAFAAAAA4CAYAAABqtn+aAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAJlJREFUeF7t0DEBAjEUQLHaQwIWTgELCrBYEXXw8dC3ZoiBrNfnGe4JjARGAiOB + kcBIYCQwEhgJjARGAiOBkcBovX/f4Z7ASGAkMBIYCYwERgIjgZHASGAkMBIYCYzW3nu4JzASGAmMBEYC + I4GRwEhgJDASGAmMBEYCo3XOGe4JjARGAiOBkcBIYCQwEhgJjARGAiOBkcDkzB9hSCuN6ai/7AAAAABJ + RU5ErkJggg== - iVBORw0KGgoAAAANSUhEUgAAAHgAAABUCAYAAABJCvOfAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAADgSURBVHhe7dExEcQwEAAxY3JjDA8hFIIgTRA86AuPHRVC - oPV77qFLcJzgOMFxguMExwmOExwnOE5wnOA4wXGC4wTHCY4THCc4TnCc4DjBcYLj1vV/hy7BcYLjBMcJ - jhMcJzhOcJzgOMFxguMExwmOExwnOE5wnOA4wXGC4wTHCY5b55yhS3Cc4DjBcYLjBMcJjhMcJzhOcJzg - OMFxguMExwmOExwnOE5wnOA4wXGC49bee+gSHCc4TnCc4DjBcYLjBMcJjhMcJzhOcJzgOMFxguMExwmO - ExwnOE5wnOC0PR8EeGv9yHPBgQAAAABJRU5ErkJggg== + iVBORw0KGgoAAAANSUhEUgAAAFAAAAA4CAYAAABqtn+aAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAJlJREFUeF7t0DEBAjEUQLFq6lINSMACClhOAaI/HvrWDDGQ9fp+hnsCI4GRwEhg + JDASGAmMBEYCI4GRwEhgJDBa798z3BMYCYwERgIjgZHASGAkMBIYCYwERgIjgdE65wz3BEYCI4GRwEhg + JDASGAmMBEYCI4GRwEhgtPbewz2BkcBIYCQwEhgJjARGAiOBkcBIYCQwEpjs+QNnxfcQhclFDAAAAABJ + RU5ErkJggg== - iVBORw0KGgoAAAANSUhEUgAAAHgAAABUCAYAAABJCvOfAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAADgSURBVHhe7dExEcQwEAAxM0zzANKEQjg8R4MwgwsPzRZC - oPW73omrYFzBuIJxBeMKxhWMKxhXMK5gXMG4gnEF4wrGFYwrGFcwrmBcwbiCcQXj1nP/J66CcQXjCsYV - jCsYVzCuYFzBuIJxBeMKxhWMKxhXMK5gXMG4gnEF4wrGFYxbe++Jq2BcwbiCcQXjCsYVjCsYVzCuYFzB - uIJxBeMKxhWMKxhXMK5gXMG4gnEF49Y5Z+IqGFcwrmBcwbiCcQXjCsYVjCsYVzCuYFzBuIJxBeMKxhWM - KxhXMK5gXMG0Mx/PfPWmlONhxAAAAABJRU5ErkJggg== + iVBORw0KGgoAAAANSUhEUgAAAFAAAAA4CAYAAABqtn+aAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAJlJREFUeF7t0DEBAjEUQLE6ZEHALVjAAx4rog4+HvrWDDGQ9X59h3sCI4GRwEhg + JDASGAmMBEYCI4GRwEhgJDBan+c33BMYCYwERgIjgZHASGAkMBIYCYwERgIjgdHaew/3BEYCI4GRwEhg + JDASGAmMBEYCI4GRwEhgtM45wz2BkcBIYCQwEhgJjARGAiOBkcBIYCQwEpic+QOCcYmeZWOr9AAAAABJ + RU5ErkJggg== - iVBORw0KGgoAAAANSUhEUgAAAHgAAABUCAYAAABJCvOfAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAADgSURBVHhe7dExEcQwEAAxY3JjGN8EQJpQCIdHfeGxo0II - tK7fO3QJjhMcJzhOcJzgOMFxguMExwmOExwnOE5wnOA4wXGC4wTHCY4THCc4TnDceu7/0CU4TnCc4DjB - cYLjBMcJjhMcJzhOcJzgOMFxguMExwmOExwnOE5wnOA4wXHrnDN0CY4THCc4TnCc4DjBcYLjBMcJjhMc - JzhOcJzgOMFxguMExwmOExwnOE5w3Np7D12C4wTHCY4THCc4TnCc4DjBcYLjBMcJjhMcJzhOcJzgOMFx - guMExwmOE5y25wOsKv+nDIwGewAAAABJRU5ErkJggg== + iVBORw0KGgoAAAANSUhEUgAAAFAAAAA4CAYAAABqtn+aAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAJhJREFUeF7t0DEBAjEUQLFq6lIZLAhgwcJ5QPXHQ9+aIQay3q9nuCcwEhgJjARG + AiOBkcBIYCQwEhgJjARGAqP1/fyGewIjgZHASGAkMBIYCYwERgIjgZHASGAkMFrnnOGewEhgJDASGAmM + BEYCI4GRwEhgJDASGAmM1t57uCcwEhgJjARGAiOBkcBIYCQwEhgJjARGApM9f4juVTDktQ5SAAAAAElF + TkSuQmCC diff --git a/CPXV2 TRA V2/SystemX.Product.CP.TRA/SystemX.Product.CP.TRA.csproj b/CPXV2 TRA V2/SystemX.Product.CP.TRA/SystemX.Product.CP.TRA.csproj index 5c0efd3..0ea8f6e 100644 --- a/CPXV2 TRA V2/SystemX.Product.CP.TRA/SystemX.Product.CP.TRA.csproj +++ b/CPXV2 TRA V2/SystemX.Product.CP.TRA/SystemX.Product.CP.TRA.csproj @@ -84,7 +84,7 @@ - ..\..\RPDM\Output.SystemX\log4net.dll + ..\..\Output.SystemX\log4net.dll ..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.1\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll @@ -196,13 +196,13 @@ ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll - ..\..\RPDM\Output.SystemX\System.Reactive.Core.dll + ..\..\Output.SystemX\System.Reactive.Core.dll - ..\..\RPDM\Output.SystemX\System.Reactive.Interfaces.dll + ..\..\Output.SystemX\System.Reactive.Interfaces.dll - ..\..\RPDM\Output.SystemX\System.Reactive.Linq.dll + ..\..\Output.SystemX\System.Reactive.Linq.dll ..\packages\System.Runtime.CompilerServices.Unsafe.4.7.1\lib\net461\System.Runtime.CompilerServices.Unsafe.dll @@ -218,17 +218,17 @@ - - ..\..\RPDM\Output.SystemX\SystemX.Net.Platform.dll + + ..\Output.SystemX\SystemX.Net.PCAdaptor.dll - - ..\..\RPDM\Output.SystemX\SystemX.Net.XAdaptor.PC.UIM.dll + + ..\..\Output.SystemX\SystemX.Net.Platform.dll ..\SystemX.Product.CP.TRA.BaseView\bin\x64\SystemX.Product.CP.TRA.BaseView.dll - ..\..\RPDM\Output.SystemX\SystemX.XEFCore.dll + ..\..\Output.SystemX\SystemX.XEFCore.dll diff --git a/CPXV2 TRA V2/SystemX.Product.CP.TRA/UIControl/UcTRADetailTestResult.cs b/CPXV2 TRA V2/SystemX.Product.CP.TRA/UIControl/UcTRADetailTestResult.cs index 24c9d10..10879b5 100644 --- a/CPXV2 TRA V2/SystemX.Product.CP.TRA/UIControl/UcTRADetailTestResult.cs +++ b/CPXV2 TRA V2/SystemX.Product.CP.TRA/UIControl/UcTRADetailTestResult.cs @@ -1,5 +1,4 @@ -using DevExpress.Data.Helpers; -using DevExpress.Spreadsheet; +using DevExpress.Spreadsheet; using DevExpress.XtraPrinting; using DevExpress.XtraVerticalGrid; using DevExpress.XtraVerticalGrid.Rows; diff --git a/CPXV2 TRA V2/SystemX.Product.CP.TRA/UIControl/UcTRAStepTrend.Designer.cs b/CPXV2 TRA V2/SystemX.Product.CP.TRA/UIControl/UcTRAStepTrend.Designer.cs index 90908c9..b2816dd 100644 --- a/CPXV2 TRA V2/SystemX.Product.CP.TRA/UIControl/UcTRAStepTrend.Designer.cs +++ b/CPXV2 TRA V2/SystemX.Product.CP.TRA/UIControl/UcTRAStepTrend.Designer.cs @@ -88,31 +88,28 @@ this.layoutControl1.Controls.Add(this.splitContainerControl1); this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.layoutControl1.Location = new System.Drawing.Point(0, 0); - this.layoutControl1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.layoutControl1.Name = "layoutControl1"; this.layoutControl1.Root = this.Root; - this.layoutControl1.Size = new System.Drawing.Size(1684, 952); + this.layoutControl1.Size = new System.Drawing.Size(1179, 635); this.layoutControl1.TabIndex = 0; this.layoutControl1.Text = "layoutControl1"; // // labelControl1 // - this.labelControl1.Location = new System.Drawing.Point(17, 868); - this.labelControl1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.labelControl1.Location = new System.Drawing.Point(12, 578); this.labelControl1.Name = "labelControl1"; - this.labelControl1.Size = new System.Drawing.Size(110, 22); + this.labelControl1.Size = new System.Drawing.Size(77, 14); this.labelControl1.StyleController = this.layoutControl1; this.labelControl1.TabIndex = 9; this.labelControl1.Text = "Auto Range : "; // // toggleSwitchAutoRange // - this.toggleSwitchAutoRange.Location = new System.Drawing.Point(133, 868); - this.toggleSwitchAutoRange.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.toggleSwitchAutoRange.Location = new System.Drawing.Point(93, 578); this.toggleSwitchAutoRange.Name = "toggleSwitchAutoRange"; this.toggleSwitchAutoRange.Properties.OffText = "Off"; this.toggleSwitchAutoRange.Properties.OnText = "On"; - this.toggleSwitchAutoRange.Size = new System.Drawing.Size(279, 27); + this.toggleSwitchAutoRange.Size = new System.Drawing.Size(196, 19); this.toggleSwitchAutoRange.StyleController = this.layoutControl1; this.toggleSwitchAutoRange.TabIndex = 2; // @@ -120,10 +117,9 @@ // this.simpleButtonAllData.Appearance.BackColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Question; this.simpleButtonAllData.Appearance.Options.UseBackColor = true; - this.simpleButtonAllData.Location = new System.Drawing.Point(211, 901); - this.simpleButtonAllData.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.simpleButtonAllData.Location = new System.Drawing.Point(148, 601); this.simpleButtonAllData.Name = "simpleButtonAllData"; - this.simpleButtonAllData.Size = new System.Drawing.Size(201, 33); + this.simpleButtonAllData.Size = new System.Drawing.Size(141, 22); this.simpleButtonAllData.StyleController = this.layoutControl1; this.simpleButtonAllData.TabIndex = 8; this.simpleButtonAllData.Text = "All Data"; @@ -133,10 +129,9 @@ // this.simpleButtonOKDataOnly.Appearance.BackColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Primary; this.simpleButtonOKDataOnly.Appearance.Options.UseBackColor = true; - this.simpleButtonOKDataOnly.Location = new System.Drawing.Point(17, 901); - this.simpleButtonOKDataOnly.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.simpleButtonOKDataOnly.Location = new System.Drawing.Point(12, 601); this.simpleButtonOKDataOnly.Name = "simpleButtonOKDataOnly"; - this.simpleButtonOKDataOnly.Size = new System.Drawing.Size(188, 33); + this.simpleButtonOKDataOnly.Size = new System.Drawing.Size(132, 22); this.simpleButtonOKDataOnly.StyleController = this.layoutControl1; this.simpleButtonOKDataOnly.TabIndex = 6; this.simpleButtonOKDataOnly.Text = "Only OK Data"; @@ -145,57 +140,42 @@ // groupControl2 // this.groupControl2.Controls.Add(this.vGridControlStepSummary); - this.groupControl2.Location = new System.Drawing.Point(17, 471); - this.groupControl2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.groupControl2.Location = new System.Drawing.Point(12, 314); this.groupControl2.Name = "groupControl2"; - this.groupControl2.Size = new System.Drawing.Size(395, 391); + this.groupControl2.Size = new System.Drawing.Size(277, 260); this.groupControl2.TabIndex = 7; this.groupControl2.Text = "Measured Data Analysis"; // // vGridControlStepSummary // - this.vGridControlStepSummary.BandsInterval = 3; this.vGridControlStepSummary.Cursor = System.Windows.Forms.Cursors.Default; this.vGridControlStepSummary.Dock = System.Windows.Forms.DockStyle.Fill; - this.vGridControlStepSummary.Location = new System.Drawing.Point(2, 34); - this.vGridControlStepSummary.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.vGridControlStepSummary.Location = new System.Drawing.Point(2, 23); this.vGridControlStepSummary.Name = "vGridControlStepSummary"; - this.vGridControlStepSummary.OptionsView.FixedLineWidth = 3; - this.vGridControlStepSummary.OptionsView.MinRowAutoHeight = 15; - this.vGridControlStepSummary.RecordWidth = 143; - this.vGridControlStepSummary.RowHeaderWidth = 143; - this.vGridControlStepSummary.Size = new System.Drawing.Size(391, 355); + this.vGridControlStepSummary.Size = new System.Drawing.Size(273, 235); this.vGridControlStepSummary.TabIndex = 1; // // groupControl1 // this.groupControl1.Controls.Add(this.vGridControlInfo); - this.groupControl1.Location = new System.Drawing.Point(17, 18); - this.groupControl1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.groupControl1.Location = new System.Drawing.Point(12, 12); this.groupControl1.Name = "groupControl1"; - this.groupControl1.Size = new System.Drawing.Size(395, 447); + this.groupControl1.Size = new System.Drawing.Size(277, 298); this.groupControl1.TabIndex = 6; this.groupControl1.Text = "Test Step Info."; // // vGridControlInfo // - this.vGridControlInfo.BandsInterval = 3; this.vGridControlInfo.Cursor = System.Windows.Forms.Cursors.Default; this.vGridControlInfo.Dock = System.Windows.Forms.DockStyle.Fill; - this.vGridControlInfo.Location = new System.Drawing.Point(2, 34); - this.vGridControlInfo.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.vGridControlInfo.Location = new System.Drawing.Point(2, 23); this.vGridControlInfo.Name = "vGridControlInfo"; - this.vGridControlInfo.OptionsView.FixedLineWidth = 3; - this.vGridControlInfo.OptionsView.MinRowAutoHeight = 15; - this.vGridControlInfo.RecordWidth = 143; - this.vGridControlInfo.RowHeaderWidth = 143; - this.vGridControlInfo.Size = new System.Drawing.Size(391, 411); + this.vGridControlInfo.Size = new System.Drawing.Size(273, 273); this.vGridControlInfo.TabIndex = 1; // // splitContainerControl1 // - this.splitContainerControl1.Location = new System.Drawing.Point(418, 18); - this.splitContainerControl1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.splitContainerControl1.Location = new System.Drawing.Point(293, 12); this.splitContainerControl1.Name = "splitContainerControl1"; // // splitContainerControl1.Panel1 @@ -207,19 +187,17 @@ // this.splitContainerControl1.Panel2.Controls.Add(this.chartControlMain); this.splitContainerControl1.Panel2.Text = "Panel2"; - this.splitContainerControl1.Size = new System.Drawing.Size(1249, 916); - this.splitContainerControl1.SplitterPosition = 674; + this.splitContainerControl1.Size = new System.Drawing.Size(874, 611); + this.splitContainerControl1.SplitterPosition = 472; this.splitContainerControl1.TabIndex = 6; // // gridControlMain // this.gridControlMain.Dock = System.Windows.Forms.DockStyle.Fill; - this.gridControlMain.EmbeddedNavigator.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.gridControlMain.Location = new System.Drawing.Point(0, 0); this.gridControlMain.MainView = this.gridViewMain; - this.gridControlMain.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.gridControlMain.Name = "gridControlMain"; - this.gridControlMain.Size = new System.Drawing.Size(674, 916); + this.gridControlMain.Size = new System.Drawing.Size(472, 611); this.gridControlMain.TabIndex = 5; this.gridControlMain.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.gridViewMain}); @@ -228,7 +206,6 @@ // this.gridViewMain.Appearance.Row.BackColor = System.Drawing.Color.Transparent; this.gridViewMain.Appearance.Row.Options.UseBackColor = true; - this.gridViewMain.DetailHeight = 525; this.gridViewMain.GridControl = this.gridControlMain; this.gridViewMain.Name = "gridViewMain"; this.gridViewMain.OptionsBehavior.Editable = false; @@ -243,10 +220,9 @@ // this.chartControlMain.Dock = System.Windows.Forms.DockStyle.Fill; this.chartControlMain.Location = new System.Drawing.Point(0, 0); - this.chartControlMain.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.chartControlMain.Name = "chartControlMain"; this.chartControlMain.SeriesSerializable = new DevExpress.XtraCharts.Series[0]; - this.chartControlMain.Size = new System.Drawing.Size(560, 916); + this.chartControlMain.Size = new System.Drawing.Size(392, 611); this.chartControlMain.TabIndex = 0; this.chartControlMain.DoubleClick += new System.EventHandler(this.chartControlMain_DoubleClick); // @@ -263,15 +239,15 @@ this.layoutControlItem7, this.layoutControlItem6}); this.Root.Name = "Root"; - this.Root.Size = new System.Drawing.Size(1684, 952); + this.Root.Size = new System.Drawing.Size(1179, 635); this.Root.TextVisible = false; // // layoutControlItem3 // this.layoutControlItem3.Control = this.splitContainerControl1; - this.layoutControlItem3.Location = new System.Drawing.Point(401, 0); + this.layoutControlItem3.Location = new System.Drawing.Point(281, 0); this.layoutControlItem3.Name = "layoutControlItem3"; - this.layoutControlItem3.Size = new System.Drawing.Size(1255, 922); + this.layoutControlItem3.Size = new System.Drawing.Size(878, 615); this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem3.TextVisible = false; // @@ -279,10 +255,10 @@ // this.layoutControlItem1.Control = this.groupControl1; this.layoutControlItem1.Location = new System.Drawing.Point(0, 0); - this.layoutControlItem1.MaxSize = new System.Drawing.Size(401, 0); - this.layoutControlItem1.MinSize = new System.Drawing.Size(401, 7); + this.layoutControlItem1.MaxSize = new System.Drawing.Size(281, 0); + this.layoutControlItem1.MinSize = new System.Drawing.Size(281, 5); this.layoutControlItem1.Name = "layoutControlItem1"; - this.layoutControlItem1.Size = new System.Drawing.Size(401, 453); + this.layoutControlItem1.Size = new System.Drawing.Size(281, 302); this.layoutControlItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem1.TextVisible = false; @@ -290,11 +266,11 @@ // layoutControlItem4 // this.layoutControlItem4.Control = this.simpleButtonOKDataOnly; - this.layoutControlItem4.Location = new System.Drawing.Point(0, 883); - this.layoutControlItem4.MaxSize = new System.Drawing.Size(0, 39); - this.layoutControlItem4.MinSize = new System.Drawing.Size(127, 39); + this.layoutControlItem4.Location = new System.Drawing.Point(0, 589); + this.layoutControlItem4.MaxSize = new System.Drawing.Size(0, 26); + this.layoutControlItem4.MinSize = new System.Drawing.Size(89, 26); this.layoutControlItem4.Name = "layoutControlItem4"; - this.layoutControlItem4.Size = new System.Drawing.Size(194, 39); + this.layoutControlItem4.Size = new System.Drawing.Size(136, 26); this.layoutControlItem4.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; this.layoutControlItem4.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem4.TextVisible = false; @@ -302,11 +278,11 @@ // layoutControlItem5 // this.layoutControlItem5.Control = this.simpleButtonAllData; - this.layoutControlItem5.Location = new System.Drawing.Point(194, 883); - this.layoutControlItem5.MaxSize = new System.Drawing.Size(0, 39); - this.layoutControlItem5.MinSize = new System.Drawing.Size(127, 39); + this.layoutControlItem5.Location = new System.Drawing.Point(136, 589); + this.layoutControlItem5.MaxSize = new System.Drawing.Size(0, 26); + this.layoutControlItem5.MinSize = new System.Drawing.Size(89, 26); this.layoutControlItem5.Name = "layoutControlItem5"; - this.layoutControlItem5.Size = new System.Drawing.Size(207, 39); + this.layoutControlItem5.Size = new System.Drawing.Size(145, 26); this.layoutControlItem5.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; this.layoutControlItem5.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem5.TextVisible = false; @@ -314,38 +290,37 @@ // layoutControlItem2 // this.layoutControlItem2.Control = this.groupControl2; - this.layoutControlItem2.Location = new System.Drawing.Point(0, 453); + this.layoutControlItem2.Location = new System.Drawing.Point(0, 302); this.layoutControlItem2.Name = "layoutControlItem2"; - this.layoutControlItem2.Size = new System.Drawing.Size(401, 397); + this.layoutControlItem2.Size = new System.Drawing.Size(281, 264); this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem2.TextVisible = false; // // layoutControlItem7 // this.layoutControlItem7.Control = this.labelControl1; - this.layoutControlItem7.Location = new System.Drawing.Point(0, 850); + this.layoutControlItem7.Location = new System.Drawing.Point(0, 566); this.layoutControlItem7.Name = "layoutControlItem7"; - this.layoutControlItem7.Size = new System.Drawing.Size(116, 33); + this.layoutControlItem7.Size = new System.Drawing.Size(81, 23); this.layoutControlItem7.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem7.TextVisible = false; // // layoutControlItem6 // this.layoutControlItem6.Control = this.toggleSwitchAutoRange; - this.layoutControlItem6.Location = new System.Drawing.Point(116, 850); + this.layoutControlItem6.Location = new System.Drawing.Point(81, 566); this.layoutControlItem6.Name = "layoutControlItem6"; - this.layoutControlItem6.Size = new System.Drawing.Size(285, 33); + this.layoutControlItem6.Size = new System.Drawing.Size(200, 23); this.layoutControlItem6.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem6.TextVisible = false; // // UcTRAStepTrend // - this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 18F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.layoutControl1); - this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.Name = "UcTRAStepTrend"; - this.Size = new System.Drawing.Size(1684, 952); + this.Size = new System.Drawing.Size(1179, 635); this.Load += new System.EventHandler(this.UcTRADetailTestResult_Load); ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit(); this.layoutControl1.ResumeLayout(false); diff --git a/CPXV2 TRA V2/SystemX.Product.CP.TRA/UIControl/UcTRAStepTrend.cs b/CPXV2 TRA V2/SystemX.Product.CP.TRA/UIControl/UcTRAStepTrend.cs index 88460cc..43e0703 100644 --- a/CPXV2 TRA V2/SystemX.Product.CP.TRA/UIControl/UcTRAStepTrend.cs +++ b/CPXV2 TRA V2/SystemX.Product.CP.TRA/UIControl/UcTRAStepTrend.cs @@ -199,17 +199,14 @@ namespace SystemX.Product.TRA.UIControl DataRow dtRowLogFirst = vdtRowLogs[0]; DateTime dtTested = Convert.ToDateTime(dtRowLogFirst[DMTestHistory.eColList.TestDateTime.ToString()]); - ulong ulAccessNo = Convert.ToUInt64(dtRowLogFirst[DMTestHistory.eColList.No.ToString()]); - CPXV2Log.Tables.HIST_TestResult drStep = null; for (int i = 0; i < vdtRowLogs.Count; i++) { dtRowLogFirst = vdtRowLogs[i]; - dtTested = Convert.ToDateTime(dtRowLogFirst[DMTestHistory.eColList.TestDateTime.ToString()]); - ulAccessNo = Convert.ToUInt64(dtRowLogFirst[DMTestHistory.eColList.No.ToString()]); + dtTested = Convert.ToDateTime(dtRowLogFirst[DMTestHistory.eColList.TestDateTime.ToString()]); - DataTable dtFirstLog = DataManager.SearchTestResult(dtTested, ulAccessNo); + DataTable dtFirstLog = DataManager.SearchTestResult(dtTested); var logData = dtFirstLog.Rows[0]["LogData"].ToString(); var decompStr = logData.GzipDecompress(); @@ -224,24 +221,17 @@ namespace SystemX.Product.TRA.UIControl if (drStep == null) return; - - int nPoint = 0; + DataTable dtResult = GetTrendData(dtTested, vdtRowLogs); - nPoint = 1; dtResult = CombineLogForm(dtResult, dtRow); - nPoint = 2; TrendDataResult resultUnit = MakeTrendSummary(dtResult, dtRow, data); - nPoint = 3; ShowDataTable(dtResult); - - nPoint = 4; ShowTestStepSummary(resultUnit); - - nPoint = 5; ShowTrendChart(resultUnit); + } catch (Exception ex) { @@ -258,14 +248,16 @@ namespace SystemX.Product.TRA.UIControl { DataTable dtResult = DataManager.GetTestStepResults(dtTested, vnData.Select(x => Convert.ToUInt64(x[0])).ToList()); - dtResult.Columns.Add(eColDataTable.RowNo.ToString(), typeof(ulong)); + dtResult.Columns.Add(eColDataTable.RowNo.ToString(), typeof(int)); for (int i = 0; i < dtResult.Rows.Count; i++) dtResult.Rows[i][eColDataTable.RowNo.ToString()] = i + 1; + return dtResult; } + DataTable CombineLogForm(DataTable dtResult, DataRow dtRowTestlistSpec) { DataTable dtFinal = new DataTable(); @@ -283,101 +275,41 @@ namespace SystemX.Product.TRA.UIControl DataRow drTL = DTTestLogList.AsEnumerable().Where(x => x[DMTestHistory.eColList.TestID.ToString()].ToString() == drLog[DMTestHistory.eColList.TestID.ToString()].ToString()).FirstOrDefault();*/ - try - { - string logData = drLog["LogData"].ToString(); - string decompStr = logData.GzipDecompress(); - List list = JsonConvert.DeserializeObject>(decompStr); + //string strValue = drLog[DMTestHistory.eColList.No.ToString()].ToString(); - long outValue = 0; - if (Int64.TryParse(dtRowTestlistSpec[2].ToString(), out outValue)) - { - CPXV2Log.Tables.HIST_TestResult row = list.Where(x => x.StepID == outValue)?.First(); - if(row == null) - { - continue; - } + DataRow drTL = DTTestLogList.AsEnumerable() + .Where(x => Convert.ToInt64(x[DMTestHistory.eColList.No.ToString()]) == Convert.ToInt64(drLog[0].ToString())).FirstOrDefault(); - if (//!string.IsNullOrEmpty(row.MeasValStr) || - //!string.IsNullOrEmpty(row.Message) || - ((row.MeasVal == 0) || - string.Compare(row.Result, "NONE") == 0)) - continue; + DataRow drDisp = dtFinal.NewRow(); - //string strValue = drLog[DMTestHistory.eColList.No.ToString()].ToString(); - try - { - DataRow drTL = DTTestLogList.AsEnumerable() - .Where(x => Convert.ToInt64(x[DMTestHistory.eColList.No.ToString()]) == Convert.ToInt64(drLog[0].ToString())).FirstOrDefault(); + if (drTL == null) + continue; - DataRow drDisp = dtFinal.NewRow(); + var logData = drLog["LogData"].ToString(); + var decompStr = logData.GzipDecompress(); + var list = JsonConvert.DeserializeObject>(decompStr); + var row = list.Where(x => x.StepID == Convert.ToInt64(dtRowTestlistSpec[2].ToString())).First(); - if (drTL == null) - continue; + drDisp[eColDataTable.RowNo.ToString()] = (int)drLog[eColDataTable.RowNo.ToString()]; + drDisp[eColDataTable.TestTime.ToString()] = drTL[1].ToString(); + drDisp[eColDataTable.ProductID.ToString()] = drTL[5].ToString(); + drDisp[eColDataTable.Result.ToString()] = row.Result.ToString(); - drDisp[0] = drLog[0]; - drDisp[1] = drTL[1].ToString(); - drDisp[2] = drTL[5].ToString(); + bool bIsGlobal = (Convert.ToInt32(dtRowTestlistSpec[eColTestlist.IsGlobal.ToString()])) > 0 ? true : false; + + drDisp[eColDataTable.Min.ToString()] = bIsGlobal ? row.GlobalMin.ToString() : dtRowTestlistSpec[eColTestlist.SpecMin.ToString()].ToString(); + drDisp[eColDataTable.Max.ToString()] = bIsGlobal ? row.GlobalMAx.ToString() : dtRowTestlistSpec[eColTestlist.SpecMax.ToString()].ToString(); - bool bIsGlobal = (Convert.ToInt32(dtRowTestlistSpec[eColTestlist.IsGlobal.ToString()])) > 0 ? true : false; + string strMessage = row.Message.ToString(); + string strMeasValStr = row.MeasValStr.ToString(); + string strMeasVal = row.MeasVal.ToString(); - drDisp[3] = bIsGlobal ? row.GlobalMin.ToString() : dtRowTestlistSpec[eColTestlist.SpecMin.ToString()].ToString(); - drDisp[5] = bIsGlobal ? row.GlobalMAx.ToString() : dtRowTestlistSpec[eColTestlist.SpecMax.ToString()].ToString(); + drDisp[eColDataTable.Value.ToString()] = string.IsNullOrWhiteSpace(strMessage) ? (string.IsNullOrWhiteSpace(strMeasValStr) ? strMeasVal : strMeasValStr) : strMessage; + drDisp[eColDataTable.Result.ToString()] = row.Result.ToString(); - string strMessage = row.Message.ToString(); - string strMeasValStr = row.MeasValStr.ToString(); - string strMeasVal = row.MeasVal.ToString(); - - drDisp[4] = string.IsNullOrWhiteSpace(strMessage) ? (string.IsNullOrWhiteSpace(strMeasValStr) ? strMeasVal : strMeasValStr) : strMessage; - drDisp[6] = row.Result.ToString(); - - /* - public enum eColDataTable - { - RowNo, - TestTime, - ProductID, - Min, - Value, - Max, - Result, - Duration - } - drDisp[eColDataTable.RowNo.ToString()] = drLog[eColDataTable.RowNo.ToString()]; - drDisp[eColDataTable.TestTime.ToString()] = drTL[1].ToString(); - drDisp[eColDataTable.ProductID.ToString()] = drTL[5].ToString(); - drDisp[eColDataTable.Result.ToString()] = row.Result.ToString(); - - bool bIsGlobal = (Convert.ToInt32(dtRowTestlistSpec[eColTestlist.IsGlobal.ToString()])) > 0 ? true : false; - - drDisp[eColDataTable.Min.ToString()] = bIsGlobal ? row.GlobalMin.ToString() : dtRowTestlistSpec[eColTestlist.SpecMin.ToString()].ToString(); - drDisp[eColDataTable.Max.ToString()] = bIsGlobal ? row.GlobalMAx.ToString() : dtRowTestlistSpec[eColTestlist.SpecMax.ToString()].ToString(); - - string strMessage = row.Message.ToString(); - string strMeasValStr = row.MeasValStr.ToString(); - string strMeasVal = row.MeasVal.ToString(); - - drDisp[eColDataTable.Value.ToString()] = string.IsNullOrWhiteSpace(strMessage) ? (string.IsNullOrWhiteSpace(strMeasValStr) ? strMeasVal : strMeasValStr) : strMessage; - drDisp[eColDataTable.Result.ToString()] = row.Result.ToString(); - */ - - dtFinal.Rows.Add(drDisp); - } - catch (Exception e) - { - - } - } - - } - catch (Exception ex) - { - - } + dtFinal.Rows.Add(drDisp); } - - return dtFinal; } diff --git a/CPXV2 TRA V2/SystemX.Product.CP.TRA/UIControl/UcTRASummaryTestResult.cs b/CPXV2 TRA V2/SystemX.Product.CP.TRA/UIControl/UcTRASummaryTestResult.cs index e599c9b..858320d 100644 --- a/CPXV2 TRA V2/SystemX.Product.CP.TRA/UIControl/UcTRASummaryTestResult.cs +++ b/CPXV2 TRA V2/SystemX.Product.CP.TRA/UIControl/UcTRASummaryTestResult.cs @@ -72,7 +72,7 @@ namespace SystemX.Product.TRA.UIControl public UcTRASummaryTestResult() { - ContentsType = eContents.TestSummary; + ContentsType = eContents.TestSumamry; InitializeComponent(); } @@ -235,18 +235,6 @@ namespace SystemX.Product.TRA.UIControl */ //drTL = DataManager[nAccessPos].Rows.Find(drLog[eColTestLog.StepID.ToString()]); - - /* - try - { - drTL = DataManager.dtHistVersionTL.Rows.Find(drLog[eColTestLog.StepID.ToString()]); - } - catch - { - drTL = null; - } - */ - drTL = DataManager.dtHistVersionTL.Rows.Find(drLog[eColTestLog.StepID.ToString()]); if (drTL == null) @@ -263,47 +251,24 @@ namespace SystemX.Product.TRA.UIControl DataRow drDisp = dtFinal.NewRow(); drDisp[eColDataTable.StepNo.ToString()] = Convert.ToInt32(Convert.ToInt32(drLog[eColTestSummary.StepID.ToString()])); + drDisp[eColDataTable.Variant.ToString()] = drTL[eColTestlist.Variant.ToString()].ToString(); + drDisp[eColDataTable.Gate.ToString()] = drTL[eColTestlist.Gate.ToString()].ToString(); + drDisp[eColDataTable.MO.ToString()] = drTL[eColTestlist.StepDesc.ToString()].ToString(); + drDisp[eColDataTable.Function.ToString()] = drTL[eColTestlist.UseFunction.ToString()].ToString(); - if (drTL != null) - { - drDisp[eColDataTable.Variant.ToString()] = drTL[eColTestlist.Variant.ToString()].ToString(); - drDisp[eColDataTable.Gate.ToString()] = drTL[eColTestlist.Gate.ToString()].ToString(); - drDisp[eColDataTable.MO.ToString()] = drTL[eColTestlist.StepDesc.ToString()].ToString(); - drDisp[eColDataTable.Function.ToString()] = drTL[eColTestlist.UseFunction.ToString()].ToString(); + bool bIsGlobal = (Convert.ToInt32(drTL[eColTestlist.IsGlobal.ToString()])) > 0 ? true : false; - bool bIsGlobal = (Convert.ToInt32(drTL[eColTestlist.IsGlobal.ToString()])) > 0 ? true : false; + drDisp[eColDataTable.Min.ToString()] = bIsGlobal ? "Global Var" : drTL[eColTestlist.SpecMin.ToString()].ToString(); + drDisp[eColDataTable.Max.ToString()] = bIsGlobal ? "Global Var" : drTL[eColTestlist.SpecMax.ToString()].ToString(); - drDisp[eColDataTable.Min.ToString()] = bIsGlobal ? "Global Var" : drTL[eColTestlist.SpecMin.ToString()].ToString(); - drDisp[eColDataTable.Max.ToString()] = bIsGlobal ? "Global Var" : drTL[eColTestlist.SpecMax.ToString()].ToString(); - } - /* - else - { - drDisp[eColDataTable.Variant.ToString()] = drLog[eColDataTable.Variant.ToString()].ToString(); - drDisp[eColDataTable.Gate.ToString()] = drLog[eColDataTable.Gate.ToString()].ToString(); - drDisp[eColDataTable.MO.ToString()] = drLog[eColDataTable.MO.ToString()].ToString(); - drDisp[eColDataTable.Function.ToString()] = drLog[eColDataTable.Function.ToString()].ToString(); - - drDisp[eColDataTable.Min.ToString()] = drLog[eColDataTable.Min.ToString()].ToString(); - drDisp[eColDataTable.Max.ToString()] = drLog[eColDataTable.Max.ToString()].ToString(); - } - */ var strMeasVal = drLog[eColTestSummary.Average.ToString()]; int nOK = Convert.ToInt32(drLog[eColTestSummary.OK.ToString()]); int nNOK = Convert.ToInt32(drLog[eColTestSummary.NG.ToString()]); drDisp[eColDataTable.Average.ToString()] = strMeasVal == null ? string.Empty : (nOK + nNOK) == 0 ? string.Empty : strMeasVal.ToString(); - if (drTL != null) - { - drDisp[eColDataTable.Dimension.ToString()] = drTL[eColTestlist.Dim.ToString()].ToString(); - } - /* - else - { - drDisp[eColDataTable.Dimension.ToString()] = drLog[eColTestlist.Dim.ToString()].ToString(); - } - */ + drDisp[eColDataTable.Dimension.ToString()] = drTL[eColTestlist.Dim.ToString()].ToString(); + drDisp[eColDataTable.Total.ToString()] = Convert.ToInt32(drLog[eColTestSummary.Total.ToString()]); drDisp[eColDataTable.OK.ToString()] = nOK; drDisp[eColDataTable.NG.ToString()] = nNOK; diff --git a/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/Cfg/DBConnInfo.xml b/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/Cfg/DBConnInfo.xml new file mode 100644 index 0000000..eefea5c --- /dev/null +++ b/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/Cfg/DBConnInfo.xml @@ -0,0 +1,41 @@ + + + CPXV2 + + MS_SQL + 192.168.0.23 + 1433 + Alis + Kefico!@34 + CPXV2 + HIST_TesterSummary + HIST_TestListFileLatestStepVersion + VRFY_TestListFileRelease + - + True + + + MS_SQL + 192.168.0.23 + 1433 + Alis + Kefico!@34 + CPXV2ShortTermLogJson + HIST_LogSummary_2024 + HIST_TestResult_2024 + - + True + + + MS_SQL + 192.168.0.23 + 1433 + Alis + Kefico!@34 + CPXV2LongTermLogJson_2024 + HIST_LogSummary + HIST_TestResult + - + True + + \ No newline at end of file diff --git a/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/Cfg/LogInformation.xml b/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/Cfg/LogInformation.xml new file mode 100644 index 0000000..27ec632 --- /dev/null +++ b/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/Cfg/LogInformation.xml @@ -0,0 +1,17 @@ + + + + CP-Server X Log Process + D:\Middleware Data\LOG + D:\Middleware Data\MES + + False + 14.33.116.123 + 2121 + ALISFTP + Kefico!@34 + 30000 + + 15000 + + \ No newline at end of file diff --git a/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/Cfg/MapLogOption.xml b/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/Cfg/MapLogOption.xml new file mode 100644 index 0000000..20bc65d --- /dev/null +++ b/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/Cfg/MapLogOption.xml @@ -0,0 +1,16 @@ + + + + SharedCPServerX_LogMutex_CPXV2 + CpServerX_LogAccessMutex_CPXV2 + D:\CpServerXLogMappedFile_CPXV2\ + CpServerX_LogSharedMemoryMap_CPXV2 + CpServerX_LogSharedData_CPXV2 + + SharedCPServerX_InfoLogMutex_CPXV2 + CpServerX_InfoLogAccessMutex_CPXV2 + D:\CpServerXLogMappedFile_CPXV2\ + CpServerX_InfoLogSharedMemoryMap_CPXV2 + CpServerX_InfoLogSharedData_CPXV2 + + \ No newline at end of file diff --git a/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/MainForm.Designer.cs b/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/MainForm.Designer.cs index 60b1fa2..0751822 100644 --- a/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/MainForm.Designer.cs +++ b/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/MainForm.Designer.cs @@ -63,6 +63,7 @@ namespace SystemX.Net.MiddlewareUI this.labelDBMain = new System.Windows.Forms.Label(); this.progressBarProgram = new System.Windows.Forms.ProgressBar(); this.panelSubFunc = new System.Windows.Forms.Panel(); + this.buttonManualLog = new System.Windows.Forms.Button(); this.buttonDbConnect = new System.Windows.Forms.Button(); this.panel3 = new System.Windows.Forms.Panel(); this.labelFTPTime = new System.Windows.Forms.Label(); @@ -88,6 +89,7 @@ namespace SystemX.Net.MiddlewareUI this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripMenuItemExit = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripComboBox1 = new System.Windows.Forms.ToolStripComboBox(); + this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); this.fluentDesignFormContainer1.SuspendLayout(); this.panel2.SuspendLayout(); this.panelMain.SuspendLayout(); @@ -465,6 +467,7 @@ namespace SystemX.Net.MiddlewareUI // panelSubFunc // this.panelSubFunc.BackColor = System.Drawing.Color.MidnightBlue; + this.panelSubFunc.Controls.Add(this.buttonManualLog); this.panelSubFunc.Controls.Add(this.buttonDbConnect); this.panelSubFunc.Controls.Add(this.panel3); this.panelSubFunc.Controls.Add(this.buttonBulkInsertStart); @@ -475,6 +478,19 @@ namespace SystemX.Net.MiddlewareUI this.panelSubFunc.Size = new System.Drawing.Size(1979, 58); this.panelSubFunc.TabIndex = 17; // + // buttonManualLog + // + this.buttonManualLog.BackColor = System.Drawing.SystemColors.Control; + this.buttonManualLog.Dock = System.Windows.Forms.DockStyle.Right; + this.buttonManualLog.Location = new System.Drawing.Point(467, 0); + this.buttonManualLog.Name = "buttonManualLog"; + this.buttonManualLog.Size = new System.Drawing.Size(216, 58); + this.buttonManualLog.TabIndex = 3; + this.buttonManualLog.Text = "Manual Log File Select"; + this.buttonManualLog.UseVisualStyleBackColor = false; + this.buttonManualLog.Visible = false; + this.buttonManualLog.Click += new System.EventHandler(this.buttonManualLog_Click); + // // buttonDbConnect // this.buttonDbConnect.BackColor = System.Drawing.SystemColors.Control; @@ -739,6 +755,10 @@ namespace SystemX.Net.MiddlewareUI this.toolStripComboBox1.Name = "toolStripComboBox1"; this.toolStripComboBox1.Size = new System.Drawing.Size(121, 23); // + // openFileDialog + // + this.openFileDialog.FileName = "openFileDialog"; + // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 22F); @@ -752,7 +772,7 @@ namespace SystemX.Net.MiddlewareUI this.IconOptions.Image = global::SystemX.Net.MiddlewareUI.Log.Properties.Resources.AppIcon1; this.Name = "MainForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "SystemX.Net.Middleware.UI - Log CPX v240529"; + this.Text = "SystemX.Net.Middleware.UI - Log CPXV2-JSON v240912"; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MainForm_FormClosed); @@ -844,6 +864,8 @@ namespace SystemX.Net.MiddlewareUI private System.Windows.Forms.Label labelShortTermSummaryTableName; private System.Windows.Forms.Button buttonDbConnect; private System.Windows.Forms.Label labelFTPTime; + private System.Windows.Forms.Button buttonManualLog; + private System.Windows.Forms.OpenFileDialog openFileDialog; } } diff --git a/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/MainForm.cs b/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/MainForm.cs index 9195322..8f621bc 100644 --- a/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/MainForm.cs +++ b/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/MainForm.cs @@ -141,7 +141,7 @@ namespace SystemX.Net.MiddlewareUI /// /// Base Variable /// - private const int ALL_MANAGE_NUM = 110; + private const int ALL_MANAGE_NUM = 310; private const int PORT_DISTRIBUTION_NUM = 10; @@ -265,7 +265,7 @@ namespace SystemX.Net.MiddlewareUI InitializeComponent(); MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") + - @"Use CP-Server[X] Middleware [LOG] Version for [CPXV2][v240529] " + + @"Use CP-Server[X] Middleware [LOG] Version for [CPXV2][v240912] " + "[SystemX.Net.Middleware.Log : MainForm]", ConsoleColor.Green, LogMessageLevel.FATAL); // EnableMenuItem(GetSystemMenu(this.Handle, false), SC_CLOSE, MF_GRAYED); @@ -600,5 +600,56 @@ namespace SystemX.Net.MiddlewareUI { bDatabaseConnResult = MngDBLogConn.CheckDatabaseConnection(); } + + private void buttonManualLog_Click(object sender, EventArgs e) + { + switch(openFileDialog.ShowDialog()) + { + case DialogResult.OK: + { + //Scan And Send File + string strGetRoot = Path.GetPathRoot(Environment.CurrentDirectory); + + //오늘 포함 -6일전까지 검색 + string[] strScanYYYY = new string[7]; + string[] strScanMM = new string[7]; + string[] strScandd = new string[7]; + + for (int n = 6; n >= 0; n--) + { + DateTime dtSet = DateTime.Today.AddDays(-n); + strScanYYYY[n] = dtSet.ToString("yyyy"); + strScanMM[n] = dtSet.ToString("MM"); + strScandd[n] = dtSet.ToString("dd"); + } + // + // 7일치 위치 확인 + // + for (int n = 0; n < 7; n++) + { + string DirPath = strGetRoot + $@"\XProc\FTP\CpLog\{strScanYYYY[n]}\{strScanMM[n]}\{strScandd[n]}\"; + string DirMovePath = strGetRoot + $@"\XProc\FTP\CpLog\{strScanYYYY[n]}\{strScanMM[n]}\{strScandd[n]}\History\"; + + //생성 폴더가 없을경우 SKIP + if (Directory.Exists(DirPath) == false) + continue; + + if (Directory.Exists(DirMovePath) == false) + Directory.CreateDirectory(DirMovePath); + + string fileExtension = "zip"; + + string[] dirs = Directory.GetDirectories(DirPath); + string[] files = Directory.GetFiles(DirPath, $"*.{fileExtension}", SearchOption.TopDirectoryOnly); + + if (files.Length <= 0) + continue; + + ProcFTPLogFiles(files, DirPath, DirMovePath); + } + } + break; + } + } } } diff --git a/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/MainForm.resx b/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/MainForm.resx index 61edbda..6a62c5e 100644 --- a/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/MainForm.resx +++ b/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/MainForm.resx @@ -970,4 +970,7 @@ rEEAAKxBAACsQQAArEEAAKxBAACsQQAArEE= + + 571, 28 + \ No newline at end of file diff --git a/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/Program.cs b/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/Program.cs index f39e6f9..51fda80 100644 --- a/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/Program.cs +++ b/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/Program.cs @@ -21,7 +21,7 @@ namespace SystemX.Net.MiddlewareUI { bool bCreateProgram = false; - Mutex SetMutex = new Mutex(true, "SystemX.Net.Middleware.UI.Log CPXV2", out bCreateProgram); + Mutex SetMutex = new Mutex(true, "SystemX.Net.Middleware.UI.Log CPXV2-JSON", out bCreateProgram); if (bCreateProgram) { diff --git a/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/Sub/CPXV2_CpLogProcess.cs b/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/Sub/CPXV2_CpLogProcess.cs index b26ee76..2eec1ff 100644 --- a/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/Sub/CPXV2_CpLogProcess.cs +++ b/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/Sub/CPXV2_CpLogProcess.cs @@ -353,7 +353,125 @@ namespace SystemX.Net.MiddlewareUI nProcPos += 1; } - private void RegisterCpLogData(ref int nProcPos, DataTable SetCpLogTable, DataSet dsVRFYInfo, DataRow dr, DataRow[] SetMakeLogRows) + private void RegisterCpLogShortData(ref int nProcPos, DataTable SetCpLogTable, DataSet dsVRFYInfo, DataRow dr, DataRow[] SetMakeLogRows) + { + string strGetMeasure = string.Empty; + + //CpLog 한행의 정보 획득 + ShortLogParamInfo.STEP = dr["STEP"].ToString().Trim(); + ShortLogParamInfo.POSITION = dr["POSITION"].ToString().Trim(); + ShortLogParamInfo.MO = dr["MO"].ToString().Trim(); + ShortLogParamInfo.FNC_NAME = dr["FNC_NAME"].ToString().Trim(); + ShortLogParamInfo.MIN = dr["MIN"].ToString().Trim(); + ShortLogParamInfo.MEASURE = dr["MEASURE"].ToString().Trim(); + ShortLogParamInfo.MAX = dr["MAX"].ToString().Trim(); + ShortLogParamInfo.DIM = dr["DIM"].ToString().Trim(); + ShortLogParamInfo.CHECK = dr["CHECK"].ToString().Trim(); + ShortLogParamInfo.SPENT_TIME = dr["SPENT_TIME"].ToString().Trim(); + ShortLogParamInfo.INFO = dr["INFO"].ToString().Trim(); + + ShortLogParamInfo.GLOBAL_SPEC = false; + ShortLogParamInfo.VRFY_MIN = ""; + ShortLogParamInfo.VRFY_MAX = ""; + + //VRFY 키 지정 검색 > 현재의 STEP 이 VRFY 에 존재하면 해당 STEP 의 정보 VRFY 에서 가져옴 + DataRow getDr = dsVRFYInfo.Tables[0].Rows.Find(ShortLogParamInfo.STEP); + if (getDr != null) + { + ShortLogParamInfo.GLOBAL_SPEC = Convert.ToBoolean(getDr["IsGlobal"]); + + ShortLogParamInfo.VRFY_MIN = getDr["SpecMin"].ToString().Trim(); + ShortLogParamInfo.VRFY_MAX = getDr["SpecMax"].ToString().Trim(); + } + + //DataRow 를 설정된 DataTable Format으로 한행 생성 + SetMakeLogRows[nProcPos] = SetCpLogTable.NewRow(); + + //CpLog 의 정보와 VRFY 정보를 조건에 따라 생성한 DataRow에 업데이트 + SetMakeLogRows[nProcPos]["StepID"] = ShortLogParamInfo.STEP; + + SetMakeLogRows[nProcPos]["MeasVal"] = Convert.ToDecimal(0); + SetMakeLogRows[nProcPos]["MeasValStr"] = ""; + SetMakeLogRows[nProcPos]["Message"] = ""; + + if (ShortLogParamInfo.FNC_NAME.IndexOf("PRINTOUT") >= 0) + { + if (ShortLogParamInfo.MEASURE.Length > ShortLogParamInfo.MessageLength) + { + strGetMeasure = ShortLogParamInfo.MEASURE; + strGetMeasure = strGetMeasure.Substring(0, ShortLogParamInfo.MessageLength); + + SetMakeLogRows[nProcPos]["Message"] = strGetMeasure; + } + else SetMakeLogRows[nProcPos]["Message"] = ShortLogParamInfo.MEASURE; + } + else if (ShortLogParamInfo.DIM.IndexOf("STR") >= 0 || + ShortLogParamInfo.DIM.IndexOf("STRING") >= 0 || + ShortLogParamInfo.DIM.IndexOf("HEX") >= 0 || + ShortLogParamInfo.DIM.IndexOf("NONE") >= 0 || + ShortLogParamInfo.DIM.IndexOf("BIN") >= 0 || + ShortLogParamInfo.DIM == string.Empty) + { + if (ShortLogParamInfo.MEASURE.Length > ShortLogParamInfo.MessageValLength) + { + strGetMeasure = ShortLogParamInfo.MEASURE; + strGetMeasure = strGetMeasure.Substring(0, ShortLogParamInfo.MessageValLength); + + SetMakeLogRows[nProcPos]["MeasValStr"] = strGetMeasure; + } + else SetMakeLogRows[nProcPos]["MeasValStr"] = ShortLogParamInfo.MEASURE; + } + else + { + //상기 케이스에 다 해당 안될때 Decimal 삽입 아무값이 없을 때 0 삽입 + if (ShortLogParamInfo.MEASURE.Length <= 0) + SetMakeLogRows[nProcPos]["MeasVal"] = Convert.ToDecimal(0); + else + { + //Measure 존재에 대한 값변환 시도 및 실패시 String 항목으로 삽입 + decimal getMeasValue = decimal.Zero; + if (Decimal.TryParse(ShortLogParamInfo.MEASURE, out getMeasValue)) + SetMakeLogRows[nProcPos]["MeasVal"] = getMeasValue; + else + { + //0 삽입 및 Str 에 >> 표시 및 Message 에 데이터 표시 + SetMakeLogRows[nProcPos]["MeasVal"] = Convert.ToDecimal(0); + SetMakeLogRows[nProcPos]["MeasValStr"] = ">>"; + SetMakeLogRows[nProcPos]["Message"] = ShortLogParamInfo.MEASURE; + } + } + } + + //IS GLOBAL 이면 CpLog 에서 읽은 정보 삽입 아니면 VRFY 에서 읽은 정보 삽입 + if (ShortLogParamInfo.GLOBAL_SPEC) + { + SetMakeLogRows[nProcPos]["GlobalMin"] = ShortLogParamInfo.MIN; + SetMakeLogRows[nProcPos]["GlobalMax"] = ShortLogParamInfo.MAX; + } + else + { + SetMakeLogRows[nProcPos]["GlobalMin"] = ShortLogParamInfo.VRFY_MIN; + SetMakeLogRows[nProcPos]["GlobalMax"] = ShortLogParamInfo.VRFY_MAX; + + if (ShortLogParamInfo.VRFY_MIN.Length <= 0 && + ShortLogParamInfo.VRFY_MAX.Length <= 0) + { + if (ShortLogParamInfo.MIN.Length > 0 || + ShortLogParamInfo.MAX.Length > 0) + { + SetMakeLogRows[nProcPos]["GlobalMin"] = ShortLogParamInfo.MIN; + SetMakeLogRows[nProcPos]["GlobalMax"] = ShortLogParamInfo.MAX; + } + } + } + + SetMakeLogRows[nProcPos]["Result"] = ShortLogParamInfo.CHECK; + SetMakeLogRows[nProcPos]["SpentTime"] = ShortLogParamInfo.SPENT_TIME; + + nProcPos += 1; + } + + private void RegisterCpLogLongData(ref int nProcPos, DataTable SetCpLogTable, DataSet dsVRFYInfo, DataRow dr, DataRow[] SetMakeLogRows) { string strGetMeasure = string.Empty; @@ -515,7 +633,7 @@ namespace SystemX.Net.MiddlewareUI { try { - RegisterCpLogData(ref nProcPos, SetCpLogTable, dsVRFYInfo, dr, SetMakeLogRows); + RegisterCpLogShortData(ref nProcPos, SetCpLogTable, dsVRFYInfo, dr, SetMakeLogRows); } catch (Exception ex) { @@ -579,7 +697,7 @@ namespace SystemX.Net.MiddlewareUI { try { - RegisterCpLogData(ref nProcPos, SetCpLogTable, dsVRFYInfo, dr, SetMakeLogRows); + RegisterCpLogLongData(ref nProcPos, SetCpLogTable, dsVRFYInfo, dr, SetMakeLogRows); } catch (Exception ex) { @@ -871,6 +989,11 @@ namespace SystemX.Net.MiddlewareUI MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") + CPXV2_CpLogProcessInfo.strProcessDebugInfo + @" CPXV2 CpLogProcess Log make information failed. [SystemX.Net.MiddlewareUI : MainForm.CPXV2_CpLogProcess]", ConsoleColor.Yellow, LogMessageLevel.DEBUG); } + Task tskLongTerm = null; + + Stopwatch stMeasTime = new Stopwatch(); + stMeasTime.Start(); + try { //CpLog 파일 읽은 여부 확인 @@ -885,9 +1008,6 @@ namespace SystemX.Net.MiddlewareUI CommonProtocol cp = new CommonProtocol(); //Summary 테이블 다중 접근 방지(인덱스) - Stopwatch stMeasTime = new Stopwatch(); - stMeasTime.Start(); - DataSet ds = null; bool hasRows = false; @@ -1090,7 +1210,6 @@ namespace SystemX.Net.MiddlewareUI CPXV2_CpLogProcessInfo.strSection, ref summaryItem); - Task tskLongTerm = null; //if (MngDBConn.InfoConnection.UTSI_STATE == false) //tskLongTerm = Task.Run(async () => await CpLogProcessLongTerm(iPos, GetMappedInfo, getCpLogHeader, dtLogData, summaryItem[1])); @@ -1106,18 +1225,41 @@ namespace SystemX.Net.MiddlewareUI bDupLogSkipState = true; - if (tskLongTerm != null) - lstBulkLongTermLog.Add(tskLongTerm.Result); - return false; } //Summary 객체를 이용해 DB 삽입할 SqlCommand 생성 - SqlCommand cmd = cp.LogDataSummaryInsert(MngDBLogConn.GetDBConnectInfo().ConnShortTerm.SUMMARY_TABLE, summaryItem[0]); + SqlCommand cmd = null; + // + try + { + cmd = cp.LogDataSummaryInsert(MngDBLogConn.GetDBConnectInfo().ConnShortTerm.SUMMARY_TABLE, summaryItem[0]); + } + catch + { + Type type = typeof(HISTLogSummary); + FieldInfo[] f = type.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); - //Summary 삽입 > 실패시 처리 - bProcessResult = ExcuteNonQueryStreamProcess(eConnCategory.ShortTerm, cmd); + StringBuilder sb = new StringBuilder(); + foreach (FieldInfo item in f) + { + sb.AppendLine(item.Name.Substring(item.Name.IndexOf("<") + 1, item.Name.IndexOf(">") - item.Name.IndexOf("<") - 1) + + ">>>" + item.GetValue(summaryItem[0]).ToString().Trim()); + } + MessageOutput.ConsoleWrite(sb.ToString()); + throw new Exception(""); + } + // + try + { + //Summary 삽입 > 실패시 처리 + bProcessResult = ExcuteNonQueryStreamProcess(eConnCategory.ShortTerm, cmd); + } + catch + { + throw new Exception(""); + } // TODO : SHM JSON /* try @@ -1214,7 +1356,15 @@ namespace SystemX.Net.MiddlewareUI lstBulkShortTermLog.Add(SetProcLogDr); } + } + catch (Exception e) + { + bProcessResult = false; + MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") + strProcessDebugInfo + @" CPXV2 Make CpLogProcess fail.[SystemX.Net.MiddlewareUI : MainForm.CPXV2_CpLogProcess]\r\n" + e.Message, ConsoleColor.Yellow, LogMessageLevel.DEBUG); + } + finally + { if (tskLongTerm != null) lstBulkLongTermLog.Add(tskLongTerm.Result); @@ -1228,15 +1378,7 @@ namespace SystemX.Net.MiddlewareUI } LogDataProcessText.Enqueue(new StringBuilder(">>[MainTime(ShortTerm)-MakeLogData][" + CPXV2_CpLogProcessInfo.lMainMeasTime + "][Include SubTime(LongTerm)-MakeLogData][" + CPXV2_CpLogProcessInfo.lLongTermMeasTime + "]\r\n")); - } - catch (Exception e) - { - bProcessResult = false; - MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") + strProcessDebugInfo + @" CPXV2 Make CpLogProcess fail.[SystemX.Net.MiddlewareUI : MainForm.CPXV2_CpLogProcess]\r\n" + e.Message, ConsoleColor.Yellow, LogMessageLevel.DEBUG); - } - finally - { if (bDupLogSkipState == false) { if (bProcessResult) @@ -1288,23 +1430,63 @@ namespace SystemX.Net.MiddlewareUI CommonProtocol cp = new CommonProtocol(); //Summary 객체를 이용해 DB 삽입할 SqlCommand 생성 - SqlCommand cmd = cp.LogDataSummaryInsert(MngDBLogConn.GetDBConnectInfo().ConnLongTerm.SUMMARY_TABLE, summaryItem); + /* + Type type = typeof(HISTLogSummary); + FieldInfo[] f = type.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); + StringBuilder sb = new StringBuilder(); + foreach (FieldInfo item in f) + { + sb.AppendLine(item.Name.Substring(item.Name.IndexOf("<") + 1, item.Name.IndexOf(">") - item.Name.IndexOf("<") - 1) + + "-" + item.GetValue(summaryItem).ToString().Trim()); + } + MessageOutput.ConsoleWrite(sb.ToString()); + */ + + SqlCommand cmd = null; + // + try + { + cmd = cp.LogDataSummaryInsert(MngDBLogConn.GetDBConnectInfo().ConnLongTerm.SUMMARY_TABLE, summaryItem); + } + catch + { + Type type = typeof(HISTLogSummary); + FieldInfo[] f = type.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); + + StringBuilder sb = new StringBuilder(); + foreach (FieldInfo item in f) + { + sb.AppendLine(item.Name.Substring(item.Name.IndexOf("<") + 1, item.Name.IndexOf(">") - item.Name.IndexOf("<") - 1) + + ">>>" + item.GetValue(summaryItem).ToString().Trim()); + } + MessageOutput.ConsoleWrite(sb.ToString()); + + throw new Exception(""); + } + // if (chkDataTsk.Result) { MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") + CPXV2_CpLogProcessInfo.strProcessDebugInfo + - @" CPXV2 LongTerm-CpLogProcess fail. Reason : LongTerm Duplicated Before CpLog-File. [SystemX.Net.MiddlewareUI : MainForm.CpLogProcessShortTerm]\r\n", ConsoleColor.Yellow, LogMessageLevel.DEBUG); + @" CPXV2 LongTerm-CpLogProcess fail. Reason : LongTerm Duplicated Before CpLog-File. [SystemX.Net.MiddlewareUI : MainForm.CPXV2_CpLogProcessLongTerm]\r\n", ConsoleColor.Yellow, LogMessageLevel.DEBUG); return SetProcLogDr; } - - //Summary 삽입 > 실패시 처리 - bProcessResult = ExcuteNonQueryStreamProcess(eConnCategory.LongTerm, cmd); + // + try + { + //Summary 삽입 > 실패시 처리 + bProcessResult = ExcuteNonQueryStreamProcess(eConnCategory.LongTerm, cmd); + } + catch + { + throw new Exception(""); + } if (bProcessResult == false) { MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") + CPXV2_CpLogProcessInfo.strProcessDebugInfo + - @" CPXV2 CpLogProcess HIST_LogSummary insert failed. [SystemX.Net.MiddlewareUI : MainForm.CpLogProcessLongTerm]", ConsoleColor.Red, LogMessageLevel.FATAL); + @" CPXV2 CpLogProcess HIST_LogSummary insert failed. [SystemX.Net.MiddlewareUI : MainForm.CPXV2_CpLogProcessLongTerm]", ConsoleColor.Red, LogMessageLevel.FATAL); throw new Exception(); } diff --git a/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/SystemX.Net.CP.Middleware.Log.csproj b/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/SystemX.Net.CP.Middleware.Log.csproj index 32c0a9c..347ccdc 100644 --- a/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/SystemX.Net.CP.Middleware.Log.csproj +++ b/SystemX.Net.CP.Middleware.Log/SystemX.Net.Middleware.UI/SystemX.Net.CP.Middleware.Log.csproj @@ -315,6 +315,9 @@ + + + diff --git a/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Cfg/CallMadeQueryInfo.xml b/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Cfg/CallMadeQueryInfo.xml new file mode 100644 index 0000000..95784ff --- /dev/null +++ b/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Cfg/CallMadeQueryInfo.xml @@ -0,0 +1,217 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Cfg/DBConnInfo.xml b/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Cfg/DBConnInfo.xml new file mode 100644 index 0000000..21134f8 --- /dev/null +++ b/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Cfg/DBConnInfo.xml @@ -0,0 +1,33 @@ + + + + MS_SQL + 192.168.0.23 + 1433 + Alis + Kefico!@34 + CPXV2 + - + True + + + MS_SQL + 192.168.0.23 + 1433 + Alis + Kefico!@34 + CPXV2ShortTermLogJson + - + True + + + MS_SQL + 192.168.0.23 + 1433 + Alis + Kefico!@34 + CPXV2LongTermLogJson + - + True + + \ No newline at end of file diff --git a/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Cfg/LogProcessInfo.xml b/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Cfg/LogProcessInfo.xml new file mode 100644 index 0000000..e6330bf --- /dev/null +++ b/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Cfg/LogProcessInfo.xml @@ -0,0 +1,14 @@ + + + + + + + + \ No newline at end of file diff --git a/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Cfg/MapLogOption.xml b/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Cfg/MapLogOption.xml new file mode 100644 index 0000000..15fddbf --- /dev/null +++ b/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Cfg/MapLogOption.xml @@ -0,0 +1,17 @@ + + + + True + SharedCPServerX_LogMutex_CPXV2 + CpServerX_LogAccessMutex_CPXV2 + D:\CpServerXLogMappedFile_CPXV2\ + CpServerX_LogSharedMemoryMap_CPXV2 + CpServerX_LogSharedData_CPXV2 + + SharedCPServerX_InfoLogMutex_CPXV2 + CpServerX_InfoLogAccessMutex_CPXV2 + D:\CpServerXLogMappedFile_CPXV2\ + CpServerX_InfoLogSharedMemoryMap_CPXV2 + CpServerX_InfoLogSharedData_CPXV2 + + \ No newline at end of file diff --git a/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Cfg/ServerInformation.xml b/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Cfg/ServerInformation.xml new file mode 100644 index 0000000..a78f972 --- /dev/null +++ b/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Cfg/ServerInformation.xml @@ -0,0 +1,39 @@ + + + + 192.168.0.46 + - + True + CP-Server X + + + + + + + + True + STAT_Host + STAT_User + + C:\ + D:\ + + D:\Middleware Data\LOG + D:\Middleware Data\MES + + + + + + + + + + False + 10.126.20.6 + 2121 + ALISFTP + Kefico!@34 + + \ No newline at end of file diff --git a/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/MainForm Sub/Function.cs b/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/MainForm Sub/Function.cs index b9067df..caae2c9 100644 --- a/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/MainForm Sub/Function.cs +++ b/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/MainForm Sub/Function.cs @@ -734,7 +734,7 @@ namespace SystemX.Net.MiddlewareUI int nNum = 0; - Random r = new Random((int)(DateTime.Now.Ticks)); + Random r = new Random(Guid.NewGuid().GetHashCode()); if (bOnlyPortInfoSend == false) { diff --git a/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/MainForm.Designer.cs b/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/MainForm.Designer.cs index aa730cc..4996261 100644 --- a/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/MainForm.Designer.cs +++ b/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/MainForm.Designer.cs @@ -523,7 +523,7 @@ namespace SystemX.Net.MiddlewareUI this.IconOptions.Icon = ((System.Drawing.Icon)(resources.GetObject("MainForm.IconOptions.Icon"))); this.Name = "MainForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "SystemX.Net.Middleware.UI - CPXV2 v240529"; + this.Text = "SystemX.Net.Middleware.UI - CPXV2-JSON v240829"; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MainForm_FormClosed); diff --git a/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/MainForm.cs b/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/MainForm.cs index 564e199..2350a6b 100644 --- a/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/MainForm.cs +++ b/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/MainForm.cs @@ -70,7 +70,7 @@ namespace SystemX.Net.MiddlewareUI /// /// Base Variable /// - private const int ALL_MANAGE_NUM = 110; + private const int ALL_MANAGE_NUM = 310; private const int PORT_DISTRIBUTION_NUM = 10; @@ -119,6 +119,9 @@ namespace SystemX.Net.MiddlewareUI { bool bFindResult = false; + //Stopwatch stTimeCheck = new Stopwatch(); + //stTimeCheck.Start(); + foreach (ConnectInfoStore cis in thisConnInfo) { if (cis.bHostLoginState == false) @@ -145,6 +148,8 @@ namespace SystemX.Net.MiddlewareUI } } + //long lTimeCheck = stTimeCheck.ElapsedMilliseconds; + return bFindResult; } @@ -282,7 +287,7 @@ namespace SystemX.Net.MiddlewareUI InitializeComponent(); MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") + - @"Use CP-Server[X] Middleware Version for [CPXV2][v240529] " + + @"Use CP-Server[X] Middleware Version for [CPXV2][v240829] " + "[SystemX.Net.MiddlewareUI : MainForm]", ConsoleColor.Green, LogMessageLevel.FATAL); EnableMenuItem(GetSystemMenu(this.Handle, false), SC_CLOSE, MF_GRAYED); @@ -648,10 +653,7 @@ namespace SystemX.Net.MiddlewareUI try { - thisConnInfo[e.CALL_NUMBER].strCommandEndPointInfo = strGetLocalEndPoint; - // - thisConnInfo[e.CALL_NUMBER].stStreamCheckTime.Restart(); - thisConnInfo[e.CALL_NUMBER].ConnectStreamCheck = true; + thisTLLoadInfo[e.CALL_NUMBER].Initialize(); // stWatchInitialTime[e.CALL_NUMBER].Restart(); m_bInitialCallState[e.CALL_NUMBER] = true; @@ -660,7 +662,12 @@ namespace SystemX.Net.MiddlewareUI ConnPool[e.CALL_NUMBER].ConnWaitTimerReset(); thisConnInfo[e.CALL_NUMBER].Initialize(); + thisConnInfo[e.CALL_NUMBER].ConnInfoClear(); + // + thisConnInfo[e.CALL_NUMBER].strCommandEndPointInfo = strGetLocalEndPoint; + thisConnInfo[e.CALL_NUMBER].stStreamCheckTime.Restart(); + thisConnInfo[e.CALL_NUMBER].ConnectStreamCheck = true; thisConnInfo[e.CALL_NUMBER].ClientConnectState = true; } catch (Exception ex) @@ -685,10 +692,8 @@ namespace SystemX.Net.MiddlewareUI thisTLLoadInfo[e.CALL_NUMBER].Initialize(); - thisConnInfo[e.CALL_NUMBER].strConnectHostID = ""; - thisConnInfo[e.CALL_NUMBER].strConnectSection = ""; - - thisConnInfo[e.CALL_NUMBER].strCommandEndPointInfo = ""; + thisConnInfo[e.CALL_NUMBER].Initialize(); + thisConnInfo[e.CALL_NUMBER].ConnInfoClear(); thisConnInfo[e.CALL_NUMBER].stStreamCheckTime.Restart(); thisConnInfo[e.CALL_NUMBER].ConnectStreamCheck = false; @@ -967,6 +972,14 @@ namespace SystemX.Net.MiddlewareUI dsLongTermLatestVRFYRel = null; } + public void ConnInfoClear() + { + strConnectHostID = ""; + strConnectSection = ""; + + strCommandEndPointInfo = ""; + } + public ConnectInfoStore() { //ClientConnectSocket = new Socket(SocketType.Stream, ProtocolType.Tcp); diff --git a/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Program.cs b/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Program.cs index f9a4c51..5865d65 100644 --- a/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Program.cs +++ b/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Program.cs @@ -17,7 +17,7 @@ namespace SystemX.Net.MiddlewareUI { bool bCreateProgram = false; - Mutex SetMutex = new Mutex(true, "SystemX.Net.Middleware.UI CPXV2", out bCreateProgram); + Mutex SetMutex = new Mutex(true, "SystemX.Net.Middleware.UI CPXV2-JSON", out bCreateProgram); if (bCreateProgram) { diff --git a/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Protocol Method/Command Protocol/HOST_INFO_CHECK.cs b/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Protocol Method/Command Protocol/HOST_INFO_CHECK.cs index a65a38e..654ee2b 100644 --- a/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Protocol Method/Command Protocol/HOST_INFO_CHECK.cs +++ b/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Protocol Method/Command Protocol/HOST_INFO_CHECK.cs @@ -63,6 +63,7 @@ namespace SystemX.Net.MiddlewareUI.UIM.Protocol_Method thisConnInfo.bHostLoginState = false; bool bUseExist = true; + bool bExistInformation = true; if (bGetUseUIM && bGetUseSimpleLookupOption) bForcePass = true; @@ -78,10 +79,16 @@ namespace SystemX.Net.MiddlewareUI.UIM.Protocol_Method drFindInfo = dtHostTable.Select($"HostID='{strGetHostID}' AND Section='{strGetSection}'"); bUseExist = Parent_.GetConnectInfoFindHost(strGetHostID, strGetSection, bGetUseUIM); + + bExistInformation = (drFindInfo != null ? drFindInfo.Count() > 0 : false); + + if(drFindInfo == null) + { + ;// + } } - if (((drFindInfo != null ? drFindInfo.Count() > 0 : false) && - bUseExist == false) || + if (bExistInformation || bForcePass) { string strRegIP = string.Empty; @@ -97,11 +104,9 @@ namespace SystemX.Net.MiddlewareUI.UIM.Protocol_Method strConnectIP = thisConnInfo.strCommandEndPointInfo; //TODO : For Test Server Code - if (true || strConnectIP.IndexOf(strRegIP) >= 0 || bGetUseUIM) + if (/* true || */ strConnectIP.IndexOf(strRegIP) >= 0 || bGetUseUIM) { ;//IP Address Compare Result PASS - // - // } else { @@ -155,7 +160,7 @@ namespace SystemX.Net.MiddlewareUI.UIM.Protocol_Method } else { - if(bUseExist) + if(bUseExist && bExistInformation) MakeLoginPacket.objMessage[0].Data = $"HostID={strGetHostID} Section={strGetSection} [FAIL] HOST ID already in use."; else MakeLoginPacket.objMessage[0].Data = $"HostID={strGetHostID} Section={strGetSection} [FAIL] That information does not exist."; diff --git a/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Protocol Method/Command Protocol/PROCESS_QUERY.cs b/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Protocol Method/Command Protocol/PROCESS_QUERY.cs index 971f84a..3a37627 100644 --- a/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Protocol Method/Command Protocol/PROCESS_QUERY.cs +++ b/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/Protocol Method/Command Protocol/PROCESS_QUERY.cs @@ -103,7 +103,7 @@ namespace SystemX.Net.MiddlewareUI.UIM.Protocol_Method if (string.IsNullOrEmpty(GetTestListCntID) == false) { - getStreamList = Parent_.QueryStreamProcess(strGetQuery, out ucQueryByteArray, out ds, thisConnInfo.strResultTestListCntID); + getStreamList = Parent_.QueryStreamProcess(strGetQuery, out ucQueryByteArray, out ds, thisConnInfo.strResultTestListCntID, "DOWNLOAD_TL"); break; } @@ -123,7 +123,7 @@ namespace SystemX.Net.MiddlewareUI.UIM.Protocol_Method string strGetQuery = cp.QueryFindTestList(ppPacket, true); - getStreamList = Parent_.QueryStreamProcess(strGetQuery, out ucQueryByteArray, out ds); + getStreamList = Parent_.QueryStreamProcess(strGetQuery, out ucQueryByteArray, out ds, "", "CHECK_TL"); nByteListSize = getStreamList.Count; } diff --git a/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/SystemX.Net.CP.Middleware.PD.csproj b/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/SystemX.Net.CP.Middleware.PD.csproj index 2c9b797..715c3f3 100644 --- a/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/SystemX.Net.CP.Middleware.PD.csproj +++ b/SystemX.Net.CP.Middleware.PD/SystemX.Net.Middleware.UI/SystemX.Net.CP.Middleware.PD.csproj @@ -196,6 +196,11 @@ + + + + + diff --git a/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/SystemX.Net.CP.XAdaptor.UIM.csproj b/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/SystemX.Net.CP.XAdaptor.UIM.csproj index 271d3d4..2230dee 100644 --- a/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/SystemX.Net.CP.XAdaptor.UIM.csproj +++ b/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/SystemX.Net.CP.XAdaptor.UIM.csproj @@ -17,7 +17,7 @@ true full false - bin\Debug\ + ..\..\Output.SystemX\ DEBUG;TRACE prompt 4 @@ -25,6 +25,8 @@ Auto + + pdbonly @@ -90,6 +92,7 @@ - xcopy /y $(ProjectDir)$(OutputPath)$(TargetName).dll $(SolutionDir)..\Output.SystemX\ + + \ No newline at end of file diff --git a/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XAdaptorManager.cs b/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XAdaptorManager.cs index 5c63256..7a583db 100644 --- a/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XAdaptorManager.cs +++ b/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XAdaptorManager.cs @@ -30,7 +30,7 @@ namespace SystemX.Net.XAdaptor.Manager public XAdaptorManager(string strConfigFilePos = "") { MessageOutput.ConsoleWrite(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss>>") + - @"Use CP-Server[X] Adaptor Version for [CPXV2][v240529] " + + @"Use CP-Server[X] Adaptor Version for [CPXV2][v240829] " + "[SystemX.Net.XAdaptor.Manager : XAdaptorManager]", ConsoleColor.Green, LogMessageLevel.FATAL); strCreateConfigFilePos = string.Empty; @@ -144,6 +144,8 @@ namespace SystemX.Net.XAdaptor.Manager public IControlTestListDataSet GetTestListContainer() { + //string v = (xAdaptor.CurrentTestList() as TProdTestListInfo).GetTestListCntID(); + return xAdaptor.CurrentTestList(); } diff --git a/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XList/lstList.cs b/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XList/lstList.cs index 098125e..479457c 100644 --- a/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XList/lstList.cs +++ b/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XList/lstList.cs @@ -116,15 +116,23 @@ namespace SystemX.Net.XAdaptor strGetTestListCntID = strSetValue; } - public void SetTestListDataSet(DataSet ds) + public void SetTestListDataSetCopy(DataSet ds) { dsQueryTestLists = new DataSet(); dsQueryTestLists = ds.Copy(); + } + public void SetTestListDataSet() + { if (dsQueryTestLists.Tables[0].Rows.Count == 1) { - ucGetTestListData = dsQueryTestLists.Tables[0].Rows[0]["TestListData"] as byte[]; - ucGetTestListData = XDataArchive.DecompressGZipByteToByte(ucGetTestListData); + if (dsQueryTestLists.Tables[0].Columns.Contains("TestListData")) + { + ucGetTestListData = dsQueryTestLists.Tables[0].Rows[0]["TestListData"] as byte[]; + ucGetTestListData = XDataArchive.DecompressGZipByteToByte(ucGetTestListData); + } + else + ucGetTestListData = new byte[1]; strGetFileName = dsQueryTestLists.Tables[0].Rows[0]["FileName"].ToString(); strGetVersion = dsQueryTestLists.Tables[0].Rows[0]["Version"].ToString(); @@ -170,8 +178,6 @@ namespace SystemX.Net.XAdaptor strGetVersion = ""; strGetProdCode = ""; strGetExtension = ""; - - strGetTestListCntID = ""; } public QueryGetInfo ReadInfo() diff --git a/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XPCAdaptor/IXPCAdaptor.cs b/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XPCAdaptor/IXPCAdaptor.cs index d75ff1f..55e17b8 100644 --- a/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XPCAdaptor/IXPCAdaptor.cs +++ b/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XPCAdaptor/IXPCAdaptor.cs @@ -46,19 +46,20 @@ namespace SystemX.Net.XAdaptor.PC string strTestListVersion, string strProductionCode); + /* bool QueryTestList(uint nStationID, string strProdNo_C, string strTestType, string strTestCode, string strTestListVersion, string strProductionCode); - /* bool WaitQueryTestList(uint nStationID, string strProdNo_C, string strTestType, string strTestCode, string strTestListVersion, string strProductionCode); */ + Task> GetTestListQueryWithFilePath(string strFilePath, uint nStationID, string strProdNo_C, string strTestType, string strTestCode, @@ -86,7 +87,7 @@ namespace SystemX.Net.XAdaptor.PC string targetVersion, string targetProdCode); - eFileSendRecvResult SendCustomFile(string strFilePos, bool bRecvResultWait = false, ushort usPalletIndex = 0); + //eFileSendRecvResult SendCustomFile(string strFilePos, bool bRecvResultWait = false, ushort usPalletIndex = 0); eSetConfigFileResult SetConfigureFile(string strFilePos); } diff --git a/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XPCAdaptor/XPCAdaptor.cs b/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XPCAdaptor/XPCAdaptor.cs index 170782d..22320ab 100644 --- a/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XPCAdaptor/XPCAdaptor.cs +++ b/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XPCAdaptor/XPCAdaptor.cs @@ -84,6 +84,12 @@ namespace SystemX.Net.XAdaptor.PC private CancellationTokenSource SubCTS; private CancellationToken SubCT; // + private Task taskConnectWorkProcess; + private bool m_bTaskConnectWorkBlock; + // + CancellationTokenSource ConnWorkCTS; + CancellationToken ConnWorkCT; + // private bool bConnectCommandSocketFlag; private bool bConnectStreamSocketFlag; // @@ -170,12 +176,12 @@ namespace SystemX.Net.XAdaptor.PC return null; } - private enum TIMER_LOCK + private enum TASK_RUN_SYNC_LOCK { - RECONNECT_TIMER = 0 + CONN_WORKER = 0 } - private bool[] m_bTimerLock; + private bool[] TaskRunSyncLock; private void InitMember() { @@ -260,10 +266,24 @@ namespace SystemX.Net.XAdaptor.PC { RecvWaitEvent -= RecvWaitEventCall; + ClearCommandWatchTask(); + ClearStreamWatchTask(); + + if (taskConnectWorkProcess != null) + { + ConnWorkCTS.Cancel(); + + m_bTaskConnectWorkBlock = true; + + taskConnectWorkProcess.ConfigureAwait(false); + //taskConnectWorkProcess.Wait(); + + taskConnectWorkProcess = null; + } + if (bDisposing) { - ClearCommandWatchTask(); - ClearStreamWatchTask(); + ;// } ClearCommandClientInstance(); @@ -275,16 +295,6 @@ namespace SystemX.Net.XAdaptor.PC // suppress calling of Finalizer GC.SuppressFinalize(this); } - - private void SetRetryTimer() - { - reConnectTimer = new WTimer(); - reConnectTimer.Enabled = false; - reConnectTimer.Interval = 1500; - reConnectTimer.Tick += ReConnectTimer_Tick; - reConnectTimer.Start(); - reConnectTimer.Enabled = true; - } private bool CheckConfigFileBuildEndPoint() { @@ -411,13 +421,15 @@ namespace SystemX.Net.XAdaptor.PC ClearStreamClientInstance(); } - private async void ReConnectTimer_Tick(object sender, EventArgs e) + private async void ConnWorker() { - if (m_bTimerLock[(int)TIMER_LOCK.RECONNECT_TIMER] == false) - { - m_bTimerLock[(int)TIMER_LOCK.RECONNECT_TIMER] = true; + while(ConnWorkCT.IsCancellationRequested == false && + m_bTaskConnectWorkBlock == false && + TaskRunSyncLock[(int)TASK_RUN_SYNC_LOCK.CONN_WORKER] == false) + { + await Task.Delay(250); - if(SubscribeConnectInfo.bSetChangeConnect) + if (SubscribeConnectInfo.bSetChangeConnect) { if (SubscribeConnectInfo.bReqConnectAbort == false) SubscribeConnectInfo.bReqConnectAbort = true; @@ -512,8 +524,6 @@ namespace SystemX.Net.XAdaptor.PC ROUTINE_OUT: */ - - m_bTimerLock[(int)TIMER_LOCK.RECONNECT_TIMER] = false; } } @@ -559,8 +569,8 @@ namespace SystemX.Net.XAdaptor.PC thisConnInfo = new ClientInfoStore(); // - m_bTimerLock = new bool[10]; - Array.Clear(m_bTimerLock, 0, 10); + TaskRunSyncLock = new bool[10]; + Array.Clear(TaskRunSyncLock, 0, 10); // if (ClientReadyEndPoint == false) CheckConfigFileBuildEndPoint(); @@ -578,8 +588,13 @@ namespace SystemX.Net.XAdaptor.PC thisConnInfo.OnStreamTime(); thisConnInfo.OnStreamCheckTime(); // - //if (CLIENT_AUTO_CONNECT) - SetRetryTimer(); + ConnWorkCTS = new CancellationTokenSource(); + ConnWorkCT = ConnWorkCTS.Token; + + m_bTaskConnectWorkBlock = false; + taskConnectWorkProcess = new Task(new Action(ConnWorker), ConnWorkCT); + taskConnectWorkProcess.Start(); + // } // TODO : FTP ALIS diff --git a/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XPCAdaptor/XPCAdaptorSub/Interface Implement/XAdaptor.PC.Interface.Implement.cs b/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XPCAdaptor/XPCAdaptorSub/Interface Implement/XAdaptor.PC.Interface.Implement.cs index 1e715c9..56101f3 100644 --- a/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XPCAdaptor/XPCAdaptorSub/Interface Implement/XAdaptor.PC.Interface.Implement.cs +++ b/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XPCAdaptor/XPCAdaptorSub/Interface Implement/XAdaptor.PC.Interface.Implement.cs @@ -353,7 +353,7 @@ namespace SystemX.Net.XAdaptor.PC return bResult; } - public bool QueryTestList(uint nStationID, string strProdNo_C, + private bool QueryTestList(uint nStationID, string strProdNo_C, string strTestType, string strTestCode, string strTestListVersion, @@ -685,8 +685,14 @@ QUERY_TESTLIST: // eFileSendRecvResult sendrecvResult = eFileSendRecvResult.None; + string strSetBackupFilePos = strFilePos; + string strSetBackupFileName = Path.GetFileName(strFilePos); + + byte[] ucSetBackupFileData = null; + //TestListCntID - string strGetCurrentTestListID = (mgrPRODTestList as TProdTestListInfo).GetTestListCntID(); + //(mgrPRODTestList as TProdTestListInfo).GetTestListCntID(); + string strGetCurrentTestListID = CurrentTestList().GetTestListCntID(); string strSetBackupInfo = targetStationName + ";" + targetTestListNo + ";" + @@ -698,11 +704,6 @@ QUERY_TESTLIST: targetProdCode + ";" + strGetCurrentTestListID; - string strSetBackupFilePos = strFilePos; - string strSetBackupFileName = Path.GetFileName(strFilePos); - - byte[] ucSetBackupFileData = null; - //File Access Check Stopwatch stWaitSendTime = new Stopwatch(); stWaitSendTime.Start(); @@ -809,6 +810,20 @@ QUERY_TESTLIST: } } + //TestListCntID + //(mgrPRODTestList as TProdTestListInfo).GetTestListCntID(); + strGetCurrentTestListID = CurrentTestList().GetTestListCntID(); + + strSetBackupInfo = targetStationName + ";" + + targetTestListNo + ";" + + targetProcNo_P + ";" + + targetProcNo_C + ";" + + targetTestType + ";" + + targetTestCode + ";" + + targetVersion + ";" + + targetProdCode + ";" + + strGetCurrentTestListID; + thisConnInfo.OnStreamTime(); if (sendrecvResult == eFileSendRecvResult.None) @@ -1102,7 +1117,7 @@ QUERY_TESTLIST: return sendrecvResult; } - public eFileSendRecvResult SendCustomFile(string strFilePos, bool bResultWait = false, ushort usPalletIndex = 0) + private eFileSendRecvResult SendCustomFile(string strFilePos, bool bResultWait = false, ushort usPalletIndex = 0) { if (thisConnInfo.ConnectStreamState == false) return eFileSendRecvResult.StreamSocketNoConnect; diff --git a/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XPCAdaptor/XPCAdaptorSub/TaskStream.cs b/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XPCAdaptor/XPCAdaptorSub/TaskStream.cs index d26aa8c..df138ae 100644 --- a/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XPCAdaptor/XPCAdaptorSub/TaskStream.cs +++ b/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XPCAdaptor/XPCAdaptorSub/TaskStream.cs @@ -250,6 +250,12 @@ namespace SystemX.Net.XAdaptor.PC case BASE_PROTOCOL.PROTOCOL_CODE.FILE_TRANSFER: { byte[] ucFileData = objData as byte[]; + + /* + string strGetTestListCntID = getHeader.objVarParam1[0].Data; + + QueryTestListProcess(ucFileData, strGetTestListCntID); + */ } break; case BASE_PROTOCOL.PROTOCOL_CODE.TRANSFER_RESULT: @@ -317,9 +323,15 @@ namespace SystemX.Net.XAdaptor.PC if (getHeader.usPalletIndex == ushort.MaxValue) { string strGetTestListCntID = getHeader.objVarParam1[0].Data; + string strGetCallType = getHeader.objVarParam2[0].Data; - QueryTestListProcess(ucGetDatas, strGetTestListCntID); - + if(strGetCallType.Contains("DOWNLOAD_TL")) + QueryTestListProcess(ucGetDatas, strGetTestListCntID); + else if (strGetCallType.Contains("CHECK_TL")) + QueryTestListCheckProcess(ucGetDatas); + else + QueryTestListProcess(ucGetDatas, strGetTestListCntID); + // //Task tkProcTestlist = new Task(new Func(() => QueryTestListProcess(ucGetDatas).Result)); //tkProcTestlist.Start(); diff --git a/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XPCAdaptor/XPCAdaptorSub/Tasks.cs b/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XPCAdaptor/XPCAdaptorSub/Tasks.cs index 064c6b5..6cffaa0 100644 --- a/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XPCAdaptor/XPCAdaptorSub/Tasks.cs +++ b/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptor/XPCAdaptor/XPCAdaptorSub/Tasks.cs @@ -26,6 +26,30 @@ namespace SystemX.Net.XAdaptor.PC { public partial class XAdaptorPC { + private bool QueryTestListCheckProcess(byte[] ucGetDatas) + { + bool bSetResult = false; + + try + { + DataSet QueryTestList = null; + QueryTestList = XDataArchive.DecompressByteToDataset(ucGetDatas); + + (mgrPRODTestList as TProdTestListInfo).SetTestListDataSetCopy(QueryTestList); + } + catch + { + bSetResult = false; + } + + finally + { + ;// + } + + return bSetResult; + } + private bool QueryTestListProcess(byte[] ucGetDatas, string strGetTestListCntID) { bool bSetResult = false; @@ -35,8 +59,8 @@ namespace SystemX.Net.XAdaptor.PC DataSet QueryTestList = null; QueryTestList = XDataArchive.DecompressByteToDataset(ucGetDatas); - (mgrPRODTestList as TProdTestListInfo).SetTestListDataSet(QueryTestList); - (mgrPRODTestList as TProdTestListInfo).SetTestListCntID(strGetTestListCntID); + (mgrPRODTestList as TProdTestListInfo).SetTestListDataSetCopy(QueryTestList); + (mgrPRODTestList as TProdTestListInfo).SetTestListDataSet(); if (XCommons.isHasRow(mgrPRODTestList.getTestListDataSet())) { @@ -50,6 +74,9 @@ namespace SystemX.Net.XAdaptor.PC int iCol2 = mgrPRODTestList.getTestListDataSet().Tables[0].Columns.IndexOf("FileName"); } + if(string.IsNullOrEmpty(strGetTestListCntID) == false) + (mgrPRODTestList as TProdTestListInfo).SetTestListCntID(strGetTestListCntID); + bSetResult = true; } @@ -184,7 +211,7 @@ namespace SystemX.Net.XAdaptor.PC if (bUseRandDistribution) { - Random r = new Random((int)(DateTime.Now.Ticks)); + Random r = new Random(Guid.NewGuid().GetHashCode()); nPortNumber = GetDistributionPort(r, nPortNumber); } @@ -246,7 +273,7 @@ namespace SystemX.Net.XAdaptor.PC if (bUseRandDistribution) { - Random r = new Random((int)(DateTime.Now.Ticks)); + Random r = new Random(Guid.NewGuid().GetHashCode()); nPortNumber = GetDistributionPort(r, nPortNumber); } diff --git a/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptorUI/MainForm.cs b/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptorUI/MainForm.cs index 61e135e..a73be7f 100644 --- a/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptorUI/MainForm.cs +++ b/SystemX.Net.CP.PCAdaptor.UIM/SystemX.Net.PCAdaptorUI/MainForm.cs @@ -635,6 +635,8 @@ namespace SystemX.Net.XAdaptor.PC.UI QT_TestListVersion_Info.Text, QT_ProductionCode_Info.Text, false); + string strGetTestListID = ManagerAdaptor.GetTestListContainer().GetTestListCntID(); + if (c2.Item2 != int.MinValue) { dataGridView1.DataSource = ManagerAdaptor.GetTestListDataSet().Tables[0]; @@ -673,6 +675,10 @@ namespace SystemX.Net.XAdaptor.PC.UI QT_TestCode_Info.Text, QT_TestListVersion_Info.Text, QT_ProductionCode_Info.Text); + + string strGetTestListID = ManagerAdaptor.GetTestListContainer().GetTestListCntID(); + + label22.Text = ManagerAdaptor.GetTestListContainer().GetTestListCntID(); } @@ -854,7 +860,7 @@ namespace SystemX.Net.XAdaptor.PC.UI { if (openFileDialog.ShowDialog() == DialogResult.OK) { - ManagerAdaptor.MgrConn.SendCustomFile(@openFileDialog.FileName); + //ManagerAdaptor.MgrConn.SendCustomFile(@openFileDialog.FileName); } } diff --git a/SystemX.Net.CP.Platform/SystemX.Net.Platform/SystemX.Net.CP.Platform.csproj b/SystemX.Net.CP.Platform/SystemX.Net.Platform/SystemX.Net.CP.Platform.csproj index 6914496..fbfcce5 100644 --- a/SystemX.Net.CP.Platform/SystemX.Net.Platform/SystemX.Net.CP.Platform.csproj +++ b/SystemX.Net.CP.Platform/SystemX.Net.Platform/SystemX.Net.CP.Platform.csproj @@ -18,7 +18,7 @@ true full false - bin\Debug\ + ..\..\Output.SystemX\ DEBUG;TRACE prompt 4 @@ -171,6 +171,7 @@ - xcopy /y $(ProjectDir)$(OutputPath)$(TargetName).dll $(SolutionDir)..\Output.SystemX\ + + \ No newline at end of file diff --git a/SystemX.Net.CP.Platform/SystemX.Net.Platform/SystemX.Net.DB/DBType/DBTMSSQL.cs b/SystemX.Net.CP.Platform/SystemX.Net.Platform/SystemX.Net.DB/DBType/DBTMSSQL.cs index 8928b19..1aa3d1b 100644 --- a/SystemX.Net.CP.Platform/SystemX.Net.Platform/SystemX.Net.DB/DBType/DBTMSSQL.cs +++ b/SystemX.Net.CP.Platform/SystemX.Net.Platform/SystemX.Net.DB/DBType/DBTMSSQL.cs @@ -45,7 +45,7 @@ namespace SystemX.Net.DB.DBType public DataTable GetHostList(bool bDBQueryCheck = false) { - if(bDBQueryCheck == false) + if (bDBQueryCheck == false) return HostList; else { @@ -72,7 +72,10 @@ namespace SystemX.Net.DB.DBType public XDBTMSSQL() { HostList = null; + + UserList = null; } + ~XDBTMSSQL() { Dispose(false); diff --git a/SystemX.Net.CP.Platform/SystemX.PLC/SystemX.PLC.csproj b/SystemX.Net.CP.Platform/SystemX.PLC/SystemX.PLC.csproj index 6c2a364..967d183 100644 --- a/SystemX.Net.CP.Platform/SystemX.PLC/SystemX.PLC.csproj +++ b/SystemX.Net.CP.Platform/SystemX.PLC/SystemX.PLC.csproj @@ -18,7 +18,7 @@ true full false - bin\Debug\ + ..\..\Output.SystemX\ DEBUG;TRACE prompt 4 @@ -169,7 +169,8 @@ - xcopy /y $(ProjectDir)$(OutputPath)$(TargetName).dll $(SolutionDir)..\Output.SystemX\ + +