Quellcode durchsuchen

Merge branch 'OTSRelease3_2' of http://36.129.169.60:30080/gogsadmin/OTS into OTSRelease3_2

cxs vor 1 Monat
Ursprung
Commit
d857807f24

+ 84 - 33
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ListOfSimilarParticles.cs

@@ -16,6 +16,7 @@ using System.Linq;
 using System.Reflection;
 using System.Threading;
 using System.Windows.Forms;
+using static OTSDataType.otsdataconst;
 using Color = System.Drawing.Color;
 
 namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
@@ -34,8 +35,10 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
         private bool m_mythread_state = false;
         //底层操作类
         OTSReportGridsFun m_OTSIncAReportGridsFun = null;
+        frmReportApp m_ReportApp;
 
-        public ListOfSimilarParticles(OTSIncAReportGrids.ParticlesGridDevidePage particlesGridDevidePage, uint[] SelXray, int classifyid, List<string> RenameInfo)
+
+		public ListOfSimilarParticles(OTSIncAReportGrids.ParticlesGridDevidePage particlesGridDevidePage, uint[] SelXray, int classifyid, List<string> RenameInfo,frmReportApp ReportApp)
         {
             InitializeComponent();
             _particlesGridDevidePage = particlesGridDevidePage;
@@ -43,8 +46,8 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             table = particlesGridDevidePage.table;
             _classifyid = classifyid;
             _RenameInfo = RenameInfo;
-
-            m_mythread = new Thread(new ParameterizedThreadStart(Thread_GO));
+            m_ReportApp = ReportApp;
+			m_mythread = new Thread(new ParameterizedThreadStart(Thread_GO));
 
 
             //设置窗体的双缓冲,以保证大数据时拖动不卡
@@ -609,46 +612,94 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
 			DataTable dt_STDGroups = new DataTable();
 			DataTable dt_ClassifySTD = new DataTable();
 			DataTable dt_IncAData = new DataTable();
-			SqLiteHelper sh_STDGroups = new SqLiteHelper("data source='" + a_address + "\\" + STDName + ".db" + "'");
-			dt_STDGroups = sh_STDGroups.ExecuteQuery("select * from STDGroups");
 
-			SqLiteHelper sh_ClassifySTD = new SqLiteHelper("data source='" + a_address + "\\" + STDName + ".db" + "'");
-			dt_ClassifySTD = sh_ClassifySTD.ExecuteQuery("select * from ClassifySTD");
 
-			dt_ClassifySTD.Columns.Add("GroupName");
-			dt_ClassifySTD.Columns.Add("GroupColor");
 
+			var systype = m_ReportApp.m_RptConfigFile.Systype;
+            if (systype == OTS_SysType_ID.IncA)
+            {
+                dt_ClassifySTD.Columns.Add("STDId");
+                dt_ClassifySTD.Columns.Add("StrName");
+                dt_ClassifySTD.Columns.Add("Color");
+                dt_ClassifySTD.Columns.Add("KeyElementList");
+                dt_ClassifySTD.Columns.Add("SubElementList");
+                dt_ClassifySTD.Columns.Add("UsingImgPropertyList");
+                dt_ClassifySTD.Columns.Add("UsingOtherPropertyList");
+                dt_ClassifySTD.Columns.Add("Expression");
+                dt_ClassifySTD.Columns.Add("Hardness");
+                dt_ClassifySTD.Columns.Add("Density");
+                dt_ClassifySTD.Columns.Add("Electrical_conductivity");
+                dt_ClassifySTD.Columns.Add("BSE");
+                dt_ClassifySTD.Columns.Add("Formula");
+                dt_ClassifySTD.Columns.Add("Element");
+                dt_ClassifySTD.Columns.Add("IfElementAnalysis");
+                dt_ClassifySTD.Columns.Add("ListNum");
+                dt_ClassifySTD.Columns.Add("GroupId");
+                dt_ClassifySTD.Columns.Add("GroupName");
+                dt_ClassifySTD.Columns.Add("GroupColor");
+
+                DataTable da = _particlesGridDevidePage.Particledata.GetParticleListForParticlSizeID("area", "");
+                for (int i = 0; i < da.Rows.Count; i++)
+                {
+                    if (Convert.ToInt64(da.Rows[i]["TypeId"]) > 9)
+                    {
+                        DataRow newRow = dt_ClassifySTD.NewRow();
+                        newRow["STDId"] = da.Rows[i]["TypeId"];
+                        newRow["StrName"] = da.Rows[i]["TypeName"];
+                        newRow["Color"] = da.Rows[i]["TypeColor"];
+                        newRow["GroupId"] = da.Rows[i]["GroupId"];
+                        newRow["GroupName"] = da.Rows[i]["GroupName"];
+                        newRow["GroupColor"] = da.Rows[i]["GroupColor"];
+                        dt_ClassifySTD.Rows.Add(newRow);
+                    }
+                }
+            }
+            else
+            {
+				SqLiteHelper sh_STDGroups = new SqLiteHelper("data source='" + a_address + "\\" + STDName + ".db" + "'");
+				dt_STDGroups = sh_STDGroups.ExecuteQuery("select * from STDGroups");
 
-			for (int i = 0; i < dt_ClassifySTD.Rows.Count; i++)
-			{
-				for (int a = 0; a < dt_STDGroups.Rows.Count; a++)
+				SqLiteHelper sh_ClassifySTD = new SqLiteHelper("data source='" + a_address + "\\" + STDName + ".db" + "'");
+				dt_ClassifySTD = sh_ClassifySTD.ExecuteQuery("select * from ClassifySTD");
+
+				dt_ClassifySTD.Columns.Add("GroupName");
+				dt_ClassifySTD.Columns.Add("GroupColor");
+
+
+				for (int i = 0; i < dt_ClassifySTD.Rows.Count; i++)
 				{
-					if (dt_ClassifySTD.Rows[i]["GroupId"].ToString() == dt_STDGroups.Rows[a]["id"].ToString())
+					for (int a = 0; a < dt_STDGroups.Rows.Count; a++)
 					{
-						dt_ClassifySTD.Rows[i]["GroupName"] = dt_STDGroups.Rows[a]["name"].ToString();
-						dt_ClassifySTD.Rows[i]["GroupColor"] = dt_STDGroups.Rows[a]["color"].ToString();
-						continue;
+						if (dt_ClassifySTD.Rows[i]["GroupId"].ToString() == dt_STDGroups.Rows[a]["id"].ToString())
+						{
+							dt_ClassifySTD.Rows[i]["GroupName"] = dt_STDGroups.Rows[a]["name"].ToString();
+							dt_ClassifySTD.Rows[i]["GroupColor"] = dt_STDGroups.Rows[a]["color"].ToString();
+							continue;
+						}
 					}
 				}
-			}
 
-			SqLiteHelper sh_Inclusion = new SqLiteHelper("data source='" + a_address + "\\FIELD_FILES\\Inclusion.db" + "'");
-			dt_IncAData = sh_Inclusion.ExecuteQuery("select * from IncAData");
-			for (int i = 0; i < dt_IncAData.Rows.Count; i++)
-			{
-				if (Convert.ToInt64(dt_IncAData.Rows[i]["TypeId"]) > 50000)
+				SqLiteHelper sh_Inclusion = new SqLiteHelper("data source='" + a_address + "\\FIELD_FILES\\Inclusion.db" + "'");
+				dt_IncAData = sh_Inclusion.ExecuteQuery("select * from IncAData");
+				for (int i = 0; i < dt_IncAData.Rows.Count; i++)
 				{
-					DataRow newRow = dt_ClassifySTD.NewRow();
-					newRow["STDId"] = dt_IncAData.Rows[i]["TypeId"];
-					newRow["StrName"] = dt_IncAData.Rows[i]["TypeName"];
-					newRow["Color"] = dt_IncAData.Rows[i]["TypeColor"];
-					newRow["GroupId"] = dt_IncAData.Rows[i]["GroupId"];
-					newRow["GroupName"] = dt_IncAData.Rows[i]["GroupName"];
-					newRow["GroupColor"] = dt_IncAData.Rows[i]["GroupColor"];
-					dt_ClassifySTD.Rows.Add(newRow);
+					if (Convert.ToInt64(dt_IncAData.Rows[i]["TypeId"]) > 50000)
+					{
+						DataRow newRow = dt_ClassifySTD.NewRow();
+						newRow["STDId"] = dt_IncAData.Rows[i]["TypeId"];
+						newRow["StrName"] = dt_IncAData.Rows[i]["TypeName"];
+						newRow["Color"] = dt_IncAData.Rows[i]["TypeColor"];
+						newRow["GroupId"] = dt_IncAData.Rows[i]["GroupId"];
+						newRow["GroupName"] = dt_IncAData.Rows[i]["GroupName"];
+						newRow["GroupColor"] = dt_IncAData.Rows[i]["GroupColor"];
+						dt_ClassifySTD.Rows.Add(newRow);
+					}
 				}
 			}
 
+
+      
+
 			return dt_ClassifySTD;
 		}
 
@@ -901,15 +952,15 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
                 }
             }
         }
-        public ListOfSimilarParticles(OTSIncAReportGrids.ParticlesGridDevidePage particlesGridDevidePage, uint[] SelXray, int classifyid)
+        public ListOfSimilarParticles(OTSIncAReportGrids.ParticlesGridDevidePage particlesGridDevidePage, uint[] SelXray, int classifyid, frmReportApp ReportApp)
         {
             InitializeComponent();
             _particlesGridDevidePage = particlesGridDevidePage;
             SelXrayclr.SetXrayData(SelXray);
             table = particlesGridDevidePage.table;
             _classifyid = classifyid;
-
-            m_mythread = new Thread(new ParameterizedThreadStart(Thread_GO));
+			m_ReportApp = ReportApp;
+			m_mythread = new Thread(new ParameterizedThreadStart(Thread_GO));
 
 
             //设置窗体的双缓冲,以保证大数据时拖动不卡

+ 83 - 35
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ParticlesGridDevidePage.cs

@@ -1622,45 +1622,93 @@ namespace OTSIncAReportGrids
             DataTable dt_STDGroups = new DataTable();
 			DataTable dt_ClassifySTD = new DataTable();
 			DataTable dt_IncAData = new DataTable();
-			SqLiteHelper sh_STDGroups = new SqLiteHelper("data source='" + a_address + "\\" + STDName + ".db" + "'");
-			dt_STDGroups = sh_STDGroups.ExecuteQuery("select * from STDGroups");
 
-            SqLiteHelper sh_ClassifySTD = new SqLiteHelper("data source='" + a_address + "\\" + STDName + ".db" + "'");
-			dt_ClassifySTD = sh_ClassifySTD.ExecuteQuery("select * from ClassifySTD");
-
-            dt_ClassifySTD.Columns.Add("GroupName");
-            dt_ClassifySTD.Columns.Add("GroupColor");
-
-
-			for (int i = 0; i < dt_ClassifySTD.Rows.Count; i++)
-            {
-                for (int a = 0; a < dt_STDGroups.Rows.Count; a++)
-                {
-                    if (dt_ClassifySTD.Rows[i]["GroupId"].ToString() == dt_STDGroups.Rows[a]["id"].ToString())
+			
+			var systype = m_ReportApp.m_RptConfigFile.Systype;
+            if (systype == OTS_SysType_ID.IncA)
+            {
+				dt_ClassifySTD.Columns.Add("STDId");
+				dt_ClassifySTD.Columns.Add("StrName");
+				dt_ClassifySTD.Columns.Add("Color");
+				dt_ClassifySTD.Columns.Add("KeyElementList");
+				dt_ClassifySTD.Columns.Add("SubElementList");
+				dt_ClassifySTD.Columns.Add("UsingImgPropertyList");
+				dt_ClassifySTD.Columns.Add("UsingOtherPropertyList");
+				dt_ClassifySTD.Columns.Add("Expression");
+				dt_ClassifySTD.Columns.Add("Hardness");
+				dt_ClassifySTD.Columns.Add("Density");
+				dt_ClassifySTD.Columns.Add("Electrical_conductivity");
+				dt_ClassifySTD.Columns.Add("BSE");
+				dt_ClassifySTD.Columns.Add("Formula");
+				dt_ClassifySTD.Columns.Add("Element");
+				dt_ClassifySTD.Columns.Add("IfElementAnalysis");
+				dt_ClassifySTD.Columns.Add("ListNum");
+				dt_ClassifySTD.Columns.Add("GroupId");
+				dt_ClassifySTD.Columns.Add("GroupName");
+				dt_ClassifySTD.Columns.Add("GroupColor");
+
+				DataTable da = Particledata.GetParticleListForParticlSizeID("area", "");
+                for (int i = 0; i < da.Rows.Count; i++)
+                {
+                    if (Convert.ToInt64(da.Rows[i]["TypeId"]) > 9)
                     {
-                        dt_ClassifySTD.Rows[i]["GroupName"] = dt_STDGroups.Rows[a]["name"].ToString();
-						dt_ClassifySTD.Rows[i]["GroupColor"] = dt_STDGroups.Rows[a]["color"].ToString();
-						continue;
-					}
+                        DataRow newRow = dt_ClassifySTD.NewRow();
+                        newRow["STDId"] = da.Rows[i]["TypeId"];
+                        newRow["StrName"] = da.Rows[i]["TypeName"];
+                        newRow["Color"] = da.Rows[i]["TypeColor"];
+                        newRow["GroupId"] = da.Rows[i]["GroupId"];
+                        newRow["GroupName"] = da.Rows[i]["GroupName"];
+                        newRow["GroupColor"] = da.Rows[i]["GroupColor"];
+                        dt_ClassifySTD.Rows.Add(newRow);
+                    }
                 }
             }
-
-			SqLiteHelper sh_Inclusion = new SqLiteHelper("data source='" + a_address + "\\FIELD_FILES\\Inclusion.db" + "'");
-			dt_IncAData = sh_Inclusion.ExecuteQuery("select * from IncAData");
-            for (int i = 0; i < dt_IncAData.Rows.Count; i++)
+            else
             {
-                if (Convert.ToInt64(dt_IncAData.Rows[i]["TypeId"]) > 50000)
-                {
-					DataRow newRow = dt_ClassifySTD.NewRow();
-                    newRow["STDId"] = dt_IncAData.Rows[i]["TypeId"];
-					newRow["StrName"] = dt_IncAData.Rows[i]["TypeName"];
-					newRow["Color"] = dt_IncAData.Rows[i]["TypeColor"];
-                    newRow["GroupId"] = dt_IncAData.Rows[i]["GroupId"];
-                    newRow["GroupName"] = dt_IncAData.Rows[i]["GroupName"];
-					newRow["GroupColor"] = dt_IncAData.Rows[i]["GroupColor"];
-					dt_ClassifySTD.Rows.Add(newRow);
+				
+					SqLiteHelper sh_STDGroups = new SqLiteHelper("data source='" + a_address + "\\" + STDName + ".db" + "'");
+					dt_STDGroups = sh_STDGroups.ExecuteQuery("select * from STDGroups");
+
+					SqLiteHelper sh_ClassifySTD = new SqLiteHelper("data source='" + a_address + "\\" + STDName + ".db" + "'");
+					dt_ClassifySTD = sh_ClassifySTD.ExecuteQuery("select * from ClassifySTD");
+
+					dt_ClassifySTD.Columns.Add("GroupName");
+					dt_ClassifySTD.Columns.Add("GroupColor");
+
+
+					for (int i = 0; i < dt_ClassifySTD.Rows.Count; i++)
+					{
+						for (int a = 0; a < dt_STDGroups.Rows.Count; a++)
+						{
+							if (dt_ClassifySTD.Rows[i]["GroupId"].ToString() == dt_STDGroups.Rows[a]["id"].ToString())
+							{
+								dt_ClassifySTD.Rows[i]["GroupName"] = dt_STDGroups.Rows[a]["name"].ToString();
+								dt_ClassifySTD.Rows[i]["GroupColor"] = dt_STDGroups.Rows[a]["color"].ToString();
+								continue;
+							}
+						}
+					}
+			
+
+
+				SqLiteHelper sh_Inclusion = new SqLiteHelper("data source='" + a_address + "\\FIELD_FILES\\Inclusion.db" + "'");
+				dt_IncAData = sh_Inclusion.ExecuteQuery("select * from IncAData");
+				for (int i = 0; i < dt_IncAData.Rows.Count; i++)
+				{
+					if (Convert.ToInt64(dt_IncAData.Rows[i]["TypeId"]) > 50000)
+					{
+						DataRow newRow = dt_ClassifySTD.NewRow();
+						newRow["STDId"] = dt_IncAData.Rows[i]["TypeId"];
+						newRow["StrName"] = dt_IncAData.Rows[i]["TypeName"];
+						newRow["Color"] = dt_IncAData.Rows[i]["TypeColor"];
+						newRow["GroupId"] = dt_IncAData.Rows[i]["GroupId"];
+						newRow["GroupName"] = dt_IncAData.Rows[i]["GroupName"];
+						newRow["GroupColor"] = dt_IncAData.Rows[i]["GroupColor"];
+						dt_ClassifySTD.Rows.Add(newRow);
+					}
 				}
-            }
+			}
+        
 
 			return dt_ClassifySTD;
         }
@@ -1731,7 +1779,7 @@ namespace OTSIncAReportGrids
                             ReportFun.GetXrayByParticleTagIDAndFieldID_ForDrawDistrbutionImageAndBSE(Convert.ToInt32(dgvr.Cells["particleId"].Value), Convert.ToInt32(dgvr.Cells["fieldid"].Value), out Search_xray, out Analysis_xray, out i_xray_id, out list_celementchemistryclr);
                         }
                     }
-                    ListOfSimilarParticles Form_listOfSimilarParticles = new ListOfSimilarParticles(this, Search_xray, classifyid,strings);
+                    ListOfSimilarParticles Form_listOfSimilarParticles = new ListOfSimilarParticles(this, Search_xray, classifyid,strings, m_ReportApp);
                     DialogResult result3=Form_listOfSimilarParticles.ShowDialog();
                     if(result3== DialogResult.OK)
                     {
@@ -2588,7 +2636,7 @@ namespace OTSIncAReportGrids
                     ReportFun.GetXrayByParticleTagIDAndFieldID_ForDrawDistrbutionImageAndBSE(Convert.ToInt32(dgvr.Cells["particleId"].Value), Convert.ToInt32(dgvr.Cells["fieldid"].Value), out Search_xray, out Analysis_xray, out i_xray_id, out list_celementchemistryclr);
                 }
             }
-            ListOfSimilarParticles Form_listOfSimilarParticles = new ListOfSimilarParticles(this, Search_xray, classifyid);
+            ListOfSimilarParticles Form_listOfSimilarParticles = new ListOfSimilarParticles(this, Search_xray, classifyid, m_ReportApp);
             DialogResult result3 = Form_listOfSimilarParticles.ShowDialog();
             if (result3 == DialogResult.OK)
             {

+ 1 - 1
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/ParticleData.cs

@@ -160,7 +160,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
 
 			string sqlp = @"select TypeId,TypeName,TypeColor,count(1) as con,avg(" + con
 				+ ") as av,max(" + con
-				+ ") as max ,GroupName ,GroupId";
+				+ ") as max ,GroupName ,GroupId,GroupColor";
 			sqlp = sqlp + " from IncAData where typeid !=-1 and typeid !=4";
 			if (fieldAndPartic != "")
 			{

+ 1 - 0
OTSIncAReportApp/OTSIncAReportApp.csproj

@@ -1672,6 +1672,7 @@
     <EmbeddedResource Include="Help.resx">
       <DependentUpon>Help.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="Properties\licenses.licx" />
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>PublicResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>