소스 검색

报告程序使用标准库名称显示 and 清洁度VDA19导出BUG修复

zhangjiaxin 5 달 전
부모
커밋
c20d84e206

+ 18 - 1
OTSCommon/DBOperate/SqLiteHelper.cs

@@ -110,7 +110,24 @@ namespace OTSCommon.DBOperate
             return dt;
         }
 
-        public int ExecuteQueryResult(string queryString)
+
+        public bool SearchTable(string queryString)
+        {
+            try
+            {
+				dataAdapter = new SQLiteDataAdapter(queryString, dbConnection);
+				DataSet ds = new DataSet();
+				dataAdapter.Fill(ds);
+                return true;
+			}
+            catch 
+            {
+                return false;
+            }
+        }
+
+
+		public int ExecuteQueryResult(string queryString)
         {
             int result = -1;
             try

+ 122 - 21
OTSIncAReportApp/1-UI/Control_Grids/ResultGrid.cs

@@ -9,6 +9,9 @@ using System.Collections.Generic;
 using System.Data;
 using System.Windows.Forms;
 using OTSIncAReportApp.OTSRstMgrFunction;
+using static DevExpress.Utils.MVVM.Internal.ILReader;
+using System.Text.RegularExpressions;
+using DevExpress.XtraReports.UI;
 
 namespace OTSIncAReportGrids
 {
@@ -164,18 +167,68 @@ namespace OTSIncAReportGrids
             keyValues.Add(table["col4"].ToString(), Math.Round(timeSpan.TotalMinutes, 2).ToString() + "mins");
             keyValues.Add(table["col5"].ToString(), filedCount.ToString());
             keyValues.Add(table["col12"].ToString(), Math.Round(Magnification, 2).ToString());
-            string LibraryName = "";
-            string rstSTD = resfile.GetSTDName();
-            if ("NoSTDDB"== rstSTD ||
-                "NoSTDDB.db" == rstSTD)
+			string LibraryName = "";
+
+			string strSTDType = resfile.GetSTDEngineType();
+			string rstSTD = resfile.GetSTDName();
+			string[] result = Regex.Split(strSTDType, ":");
+
+            if (result[0] == "-1")
+            {
+				if ("NoSTDDB" == rstSTD ||
+		  "NoSTDDB.db" == rstSTD)
+				{
+					LibraryName = "OTSIncASysSTD";
+				}
+				else
+				{
+					LibraryName = rstSTD;
+				}
+			}
+			else
+            if (result[0] == "0")
             {
                 LibraryName = "OTSIncASysSTD";
             }
-            else
+            else if (result[0] == "1")
             {
-                LibraryName = rstSTD;
-            }
-            keyValues.Add(table["col6"].ToString(), LibraryName);
+
+                if ("NoSTDDB" == rstSTD ||
+                "NoSTDDB.db" == rstSTD)
+                {
+                    LibraryName = "OTSIncASysSTD";
+                }
+                else
+                {
+					LibraryName = rstSTD;
+				}
+			}
+            else if (result[0] == "2")
+            {
+				if ("NoSTDDB" == rstSTD ||
+				"NoSTDDB.db" == rstSTD)
+				{
+					LibraryName = "OTSIncASysSTD";
+				}
+				else
+				{
+					LibraryName = "OTSIncASysSTD+" + rstSTD;
+				}
+			}
+            else if (result[0] == "3")
+            {
+				if ("NoSTDDB" == rstSTD ||
+				"NoSTDDB.db" == rstSTD)
+				{
+					LibraryName = "OTSIncASysSTD";
+				}
+				else
+				{
+					LibraryName = rstSTD;
+				}
+			}
+
+			keyValues.Add(table["col6"].ToString(), LibraryName);
             keyValues.Add(table["col7"].ToString(), fielddata.GetparticleCount().ToString());
             keyValues.Add(table["col8"].ToString() + "\x00B2)",Math.Round(filedsArea,2).ToString());
             keyValues.Add(table["col9"].ToString()+ "\x00B2)", String.Format("{0:f2}", particleArea));
@@ -252,19 +305,67 @@ namespace OTSIncAReportGrids
             keyValues.Add(table["col5"].ToString(), filedCount.ToString());
 
 
-            string LibraryName = "";
-            string rstSTD = resfile.GetSTDName();
-            if ("NoSTDDB" == rstSTD||
-                "NoSTDDB.db" == rstSTD)
-            {
-                LibraryName = "OTSIncASysSTD";
-            }
-            else
-            {
-                LibraryName = rstSTD;
-            }
-
-            keyValues.Add(table["col6"].ToString(), LibraryName);
+			string LibraryName = "";
+
+			string strSTDType = resfile.GetSTDEngineType();
+			string rstSTD = resfile.GetSTDName();
+			string[] result = Regex.Split(strSTDType, ":");
+			if (result[0] == "-1")
+			{
+				if ("NoSTDDB" == rstSTD ||
+		  "NoSTDDB.db" == rstSTD)
+				{
+					LibraryName = "OTSIncASysSTD";
+				}
+				else
+				{
+					LibraryName = rstSTD;
+				}
+			}
+			else
+			if (result[0] == "0")
+			{
+				LibraryName = "OTSIncASysSTD";
+			}
+			else if (result[0] == "1")
+			{
+
+				if ("NoSTDDB" == rstSTD ||
+				"NoSTDDB.db" == rstSTD)
+				{
+					LibraryName = "OTSIncASysSTD";
+				}
+				else
+				{
+					LibraryName = rstSTD;
+				}
+			}
+			else if (result[0] == "2")
+			{
+				if ("NoSTDDB" == rstSTD ||
+				"NoSTDDB.db" == rstSTD)
+				{
+					LibraryName = "OTSIncASysSTD";
+				}
+				else
+				{
+					LibraryName = "OTSIncASysSTD+" + rstSTD;
+				}
+			}
+			else if (result[0] == "3")
+			{
+				if ("NoSTDDB" == rstSTD ||
+				"NoSTDDB.db" == rstSTD)
+				{
+					LibraryName = "OTSIncASysSTD";
+				}
+				else
+				{
+					LibraryName = rstSTD;
+				}
+			}
+
+			keyValues.Add(table["col6"].ToString(), LibraryName);
             keyValues.Add(table["col7"].ToString(), fielddata.GetparticleCount().ToString());
             keyValues.Add(table["col8"].ToString(), Math.Round(filedsArea, 2).ToString());
             keyValues.Add(table["col9"].ToString(), particleArea.ToString());

+ 7 - 13
OTSIncAReportApp/1-UI/FormStandardLibraryInformation.cs

@@ -75,19 +75,7 @@ namespace OTSIncAReportApp._1_UI
                 ReadClassification();
             }
             catch (Exception ex) { return; }
-            
-            //listView1.Columns.Clear();
-            //// 设置ListView为详细视图
-            //listView1.View = View.Details;
-            //listView1.FullRowSelect = true; // 可选,设置是否选择整行
-            //listView1.GridLines = true; // 可选,设置是否显示网格线
-
 
-            // 添加列
-            //listView1.Columns.Add("名称", 160, HorizontalAlignment.Left); 
-            //listView1.Columns.Add("颜色", 100, HorizontalAlignment.Left); 
-                                                                        
-            
 
             for (int i=0;i< LibraryName.Count;i++)
             {
@@ -98,7 +86,13 @@ namespace OTSIncAReportApp._1_UI
                     listView1.Items.Clear();
                     DataTable dt_stl = new DataTable();
                     SqLiteHelper sh = new SqLiteHelper("data source='" + LibraryName[i][1] + "'");
-                    dt_stl = sh.ExecuteQuery("select * from ClassifySTD");
+				     
+                    if (!sh.SearchTable("SELECT COUNT(*) FROM ClassifySTD"))
+                    {
+                        return;
+					}
+
+					dt_stl = sh.ExecuteQuery("select * from ClassifySTD");
                     m_data= dt_stl.Copy();
                     for (int a=0;a<dt_stl.Rows.Count;a++)
                     {

+ 23 - 6
OTSIncAReportApp/1-UI/OTSReportExport/Category.cs

@@ -1,4 +1,5 @@
-using SourceGrid;
+using NPOI.Util;
+using SourceGrid;
 using System;
 using System.Collections;
 using System.Collections.Generic;
@@ -28,9 +29,9 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
         public Category(List<string> a_ElementList,DataTable AllList,bool a_Remove)
         {
             InitializeComponent();
-            ElementList = AllList;
-            CheckTheOptions = a_ElementList;
-            OutElementList = a_ElementList;
+            ElementList = AllList.Copy();
+            CheckTheOptions = a_ElementList.Copy();
+            OutElementList = a_ElementList.Copy();
             isRemove = a_Remove;
             #region 国际化语言
             OTSCommon.Language lan = new OTSCommon.Language(this);
@@ -184,7 +185,23 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
         /// <param name="e"></param>
         private void button4_Click(object sender, EventArgs e)
         {
-            this.Close();
-        }
+            vs.Clear();
+			vs= CheckTheOptions.Copy();
+
+			OutElementList.Clear();
+
+            for (int i = 0; i < ElementList.Rows.Count; i++)
+            {
+                for (int a = 0; a < CheckTheOptions.Count; a++)
+                {
+					if (CheckTheOptions[a] == ElementList.Rows[i]["STDId"].ToString())
+					{
+						OutElementList.Add(ElementList.Rows[i]["StrName"].ToString());
+					}
+				}
+			}
+
+			this.Close();
+		}
     }
 }

+ 1 - 1
OTSIncAReportApp/1-UI/OTSReportExport/DataIntegration/BasicData.cs

@@ -54,7 +54,7 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration
                     double d1 = Convert.ToDouble(SizeChart.Split(',')[i]);
                     double d2 = Convert.ToDouble(SizeChart.Split(',')[i + 1]);
                     colid_Below7.Add(d1.ToString() + "~" + d2.ToString());
-                }
+                } 
             }
             double d = Convert.ToDouble(SizeChart.Split(',')[SizeChart.Split(',').Length - 1]);
             colid_Below7.Add(d.ToString() + "~MAX");

+ 1 - 1
OTSIncAReportApp/1-UI/OTSReportExport/OTSReport_Template_CleannessA.cs

@@ -795,7 +795,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
 
 
             //Category category = new Category(vs, ReadClassification(comboBox1.SelectedIndex));
-            Category category = new Category(m_OTSReport_Export.m_mbszclass.list_str_MainPriority_Serial, ReadClassification(comboBox1.SelectedIndex),false);
+            Category category = new Category(m_OTSReport_Export.m_mbszclass.list_str_MainPriority_Serial.Copy(), ReadClassification(comboBox1.SelectedIndex),false);
             category.ShowDialog();
             List<string> ls = category.OutElementList;
             TCCleannessAList = category.vs;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 617 - 625
OTSIncAReportApp/1-UI/OTSReportExport/Template/DataTemplate.Designer.cs


+ 61 - 13
OTSIncAReportApp/1-UI/OTSReportExport/Template/DataTemplate.cs

@@ -961,15 +961,29 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             for (int i = 0; i < vs.Count; i++)
             {
                 string text = vs[i];
-                char[] delimiters = new char[] { '~' };
-                string[] fruits = text.Split(delimiters, StringSplitOptions.None);
+                char[] delimiters;
+                string fruit = "";
+				if (vs.Count>7)
+                {
+					delimiters = new char[] { '≥' };
+					string[] fruits = text.Split(delimiters, StringSplitOptions.None);
+					fruit = fruits[1];
+				}
+				else
+                {
+					delimiters = new char[] { '~' };
+					string[] fruits = text.Split(delimiters, StringSplitOptions.None);
+                    fruit = fruits[0];
+				}
+                     
+                
              
 
-                if(metal1== int.MaxValue && Convert.ToDouble(fruits[0])>= 400.0)
+                if(metal1== int.MaxValue && Convert.ToDouble(fruit) >= 400.0)
                 {
                     metal1 = i;
                 }
-                if (metal2 == int.MaxValue && Convert.ToDouble(fruits[0]) >= 600.0)
+                if (metal2 == int.MaxValue && Convert.ToDouble(fruit) >= 600.0)
                 {
                     metal2 = i;
                 }
@@ -1072,15 +1086,49 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
             for (int i=0;i< vs.Count;i++)
             {
                 string text = vs[i];
-                char[] delimiters = new char[] { '~' };
-                string[] fruits = text.Split(delimiters, StringSplitOptions.None);
-                listMin.Add(Convert.ToDouble(fruits[0]) );
-                if (i != vs.Count - 1)
-                    listMax.Add(Convert.ToDouble(fruits[1]));
-                else
-                {
-                    listMax.Add(int.MaxValue);
-                }
+                //char[] delimiters = new char[] { '~' };
+                //string[] fruits = text.Split(delimiters, StringSplitOptions.None);
+                char[] delimiters;
+				string fruit = "";
+				if (vs.Count > 7)
+				{
+					delimiters = new char[] { '≥' };
+					string[] fruits = text.Split(delimiters, StringSplitOptions.None);
+					fruit = fruits[1];
+                    listMin.Add(Convert.ToDouble(fruit));
+                    if (i != vs.Count - 1)
+                    {
+                        listMax.Add(Convert.ToDouble(fruits[1]));
+                    }
+                    else
+                    {
+						listMax.Add(int.MaxValue);
+					}
+
+				}
+				else
+				{
+					delimiters = new char[] { '~' };
+					string[] fruits = text.Split(delimiters, StringSplitOptions.None);
+					fruit = fruits[0];
+
+					listMin.Add(Convert.ToDouble(fruits[0]));
+					if (i != vs.Count - 1)
+						listMax.Add(Convert.ToDouble(fruits[1]));
+					else
+					{
+						listMax.Add(int.MaxValue);
+					}
+				}
+
+
+				//listMin.Add(Convert.ToDouble(fruits[0]) );
+    //            if (i != vs.Count - 1)
+    //                listMax.Add(Convert.ToDouble(fruits[1]));
+    //            else
+    //            {
+    //                listMax.Add(int.MaxValue);
+    //            }
             }
             int pos = 3;
             for (int i=0; i< listMin.Count; i++)

+ 20 - 1
OTSIncAReportApp/2-CommonFunction/OTSRstMgrFunction/ResultFile.cs

@@ -191,7 +191,26 @@ namespace OTSIncAReportApp.OTSRstMgrFunction
             return STDName;
 
         }
-        public bool GetUseSysSTD()
+
+        public string GetSTDEngineType()
+        {
+            try
+            {
+				Dictionary<string, object> sampleMembers = ((Dictionary<string, object>)((Dictionary<string, object>)ResultInfo["Sample"])["Members"]);
+				string STDEngineType = ((Dictionary<string, object>)sampleMembers["MsrParams"])["EngineType"].ToString();
+				return STDEngineType;
+			}
+            catch 
+            {
+                return "-1";
+
+			}
+
+			
+		}
+
+
+		public bool GetUseSysSTD()
         {
             Dictionary<string, object> sampleMembers = ((Dictionary<string, object>)((Dictionary<string, object>)ResultInfo["Sample"])["Members"]);
             string UseSysSTD = ((Dictionary<string, object>)sampleMembers["MsrParams"])["UseSysSTD"].ToString();

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.