Browse Source

1.修复分布图颗粒显示不准的问题
2.修复报告程序主界面打开报告按钮失灵问题

CXS 4 years ago
parent
commit
b72e18517f

+ 14 - 5
OTSCPP/OTSClassifyEngine/InclutionClassifyEngine.cpp

@@ -36,12 +36,21 @@ bool InclutionClassifyEngine::Classify(COTSParticlePtr particle, int SteelTech,
 		particle->SetType(OTS_PARTICLE_TYPE::NOT_IDENTIFIED);
 		particle->SetType(OTS_PARTICLE_TYPE::NOT_IDENTIFIED);
 		particle->TypeName("Not Identified");
 		particle->TypeName("Not Identified");
 	}	
 	}	
-	else if (stditm != nullptr)
+	else 
 	{
 	{
-		particle->SetType(OTS_PARTICLE_TYPE::IDENTIFIED);
-		particle->SetClassifyId(Id);
-		particle->TypeColor(stditm->GetColor().GetBuffer());
-		particle->TypeName(stditm->GetName().GetBuffer());
+		if (stditm != nullptr)
+		{
+			particle->SetType(OTS_PARTICLE_TYPE::IDENTIFIED);
+			particle->SetClassifyId(Id);
+			particle->TypeColor(stditm->GetColor().GetBuffer());
+			particle->TypeName(stditm->GetName().GetBuffer());
+		}
+		else
+		{
+			particle->SetType(OTS_PARTICLE_TYPE::NOT_IDENTIFIED);
+			particle->TypeName("Not Identified");
+		}
+		
 	}
 	}
 
 
 	return result;
 	return result;

+ 10 - 2
OTSCPP/OTSClassifyEngine/InclutionEngine/OTSClassifyEng.cpp

@@ -37,7 +37,7 @@ namespace OTSClassifyEngine
 		if (!IsAnIncXRay(a_listElementChemistries, listElChemsInc, listElChemsIncNoFe, dMolarSum, dMolarSumNoFe, a_nIncId))
 		if (!IsAnIncXRay(a_listElementChemistries, listElChemsInc, listElChemsIncNoFe, dMolarSum, dMolarSumNoFe, a_nIncId))
 		{
 		{
 			// this is not an inclusion, mark it as not identified
 			// this is not an inclusion, mark it as not identified
-			if(a_nIncId < 7)
+			if(a_nIncId < (int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED)
 				a_nIncId = (int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED;
 				a_nIncId = (int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED;
 			return TRUE;
 			return TRUE;
 		}
 		}
@@ -50,10 +50,11 @@ namespace OTSClassifyEngine
 		}
 		}
 
 
 		// system STD classification
 		// system STD classification
-		int nIncId = (int)OTS_PARTICLE_TYPE::INVALID;
+		int nIncId = (int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED;
 		if (!SystemClassify(a_pPartSTDData, steelTech, listElChemsIncNoFe, dMolarSumNoFe, nIncId))
 		if (!SystemClassify(a_pPartSTDData, steelTech, listElChemsIncNoFe, dMolarSumNoFe, nIncId))
 		{
 		{
 			LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::ClassifyXray: failed to call SystemClassify method."));
 			LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::ClassifyXray: failed to call SystemClassify method."));
+			a_nIncId = (int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED;
 			return FALSE;
 			return FALSE;
 		}
 		}
 
 
@@ -68,6 +69,7 @@ namespace OTSClassifyEngine
 		if (!UserClassify(a_pPartSTDData, listElChemsInc, dMolarSum, nIncId))
 		if (!UserClassify(a_pPartSTDData, listElChemsInc, dMolarSum, nIncId))
 		{
 		{
 			LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::ClassifyXray: failed to call UserClassify method."));
 			LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::ClassifyXray: failed to call UserClassify method."));
+			a_nIncId = (int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED;
 			return FALSE;
 			return FALSE;
 		}
 		}
 
 
@@ -202,12 +204,14 @@ namespace OTSClassifyEngine
 		{
 		{
 			// something wrong
 			// something wrong
 			LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::SulClassify: invalid CPartSTDDataPtr."));
 			LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::SulClassify: invalid CPartSTDDataPtr."));
+			a_nIncId = (int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED;
 			return FALSE;
 			return FALSE;
 		}
 		}
 		if (a_dMolarSumNoFe < MIN_ELEMENT_SUM)
 		if (a_dMolarSumNoFe < MIN_ELEMENT_SUM)
 		{
 		{
 			// something wrong			
 			// something wrong			
 			LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::SulClassify: invalid molar sum value."));
 			LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::SulClassify: invalid molar sum value."));
+			a_nIncId = (int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED;
 			return FALSE;
 			return FALSE;
 		}
 		}
 
 
@@ -217,6 +221,7 @@ namespace OTSClassifyEngine
 		{
 		{
 			// something wrong
 			// something wrong
 			LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::ClassifyXray: failed to call SulClassify method."));
 			LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::ClassifyXray: failed to call SulClassify method."));
+			a_nIncId = (int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED;
 			return FALSE;
 			return FALSE;
 		}
 		}
 
 
@@ -233,6 +238,7 @@ namespace OTSClassifyEngine
 		{
 		{
 			// something wrong
 			// something wrong
 			LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::ClassifyXray: failed to call NitrideClassify method."));
 			LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::ClassifyXray: failed to call NitrideClassify method."));
+			a_nIncId = (int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED;
 			return FALSE;
 			return FALSE;
 		}
 		}
 		// inclusion identified?
 		// inclusion identified?
@@ -248,6 +254,7 @@ namespace OTSClassifyEngine
 		{
 		{
 			// something wrong
 			// something wrong
 			LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::ClassifyXray: failed to call OxideClassify method."));
 			LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::ClassifyXray: failed to call OxideClassify method."));
+			a_nIncId = (int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED;
 			return FALSE;
 			return FALSE;
 		}
 		}
 		// inclusion identified?
 		// inclusion identified?
@@ -263,6 +270,7 @@ namespace OTSClassifyEngine
 		{
 		{
 			// something wrong
 			// something wrong
 			LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::ClassifyXray: failed to call CarbonClassify method."));
 			LogErrorTrace(__FILE__, __LINE__, _T("COTSClassifyEng::ClassifyXray: failed to call CarbonClassify method."));
+			a_nIncId = (int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED;
 			return FALSE;
 			return FALSE;
 		}
 		}
 
 

+ 1 - 1
OTSCPP/OTSData/OTSParticle.cpp

@@ -487,7 +487,7 @@ namespace OTSDATA {
 		m_nAnalysisId = -1;
 		m_nAnalysisId = -1;
 		m_nFieldId = -1;
 		m_nFieldId = -1;
 		// type
 		// type
-		m_nTypeId = (int)OTS_PARTICLE_TYPE::INVALID;
+		m_nTypeId = (int)OTS_PARTICLE_TYPE::NOT_IDENTIFIED;
 		// area
 		// area
 		m_dArea = 0;
 		m_dArea = 0;
 		// gray
 		// gray

+ 1 - 1
OTSIncAMeasureApp/1-OTSMeasure/OTSMeasureResultWindow.cs

@@ -313,7 +313,7 @@ namespace OTSMeasureApp
                         }
                         }
                         //添加统计行信息
                         //添加统计行信息
                         DataRow dr = dt.NewRow();
                         DataRow dr = dt.NewRow();
-                        dr["TypeId"] = "";
+                        dr["TypeId"] = ""; 
                         dr["STDName"] = "";
                         dr["STDName"] = "";
                         string str = table["str6"].ToString();
                         string str = table["str6"].ToString();
                         dr["Number"] = str + IParticleAmount;
                         dr["Number"] = str + IParticleAmount;

+ 3 - 2
OTSIncAReportApp/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.cs

@@ -1180,8 +1180,9 @@ namespace OTSIncAReportGraph.Controls
             //获取使用标准库的名称
             //获取使用标准库的名称
             string str_stdname = "";
             string str_stdname = "";
             string str_IncALibName = "";
             string str_IncALibName = "";
-            List<int> FLID = new List<int>() { 0, 1, 2, 4, 6, 7, 8, 9 };
-            List<string> NameList = new List<string>() { "过小颗粒", "过大颗粒", "亮度不在分析范围内的颗粒", "低计数率颗粒", "不含分析元素的颗粒", "非夹杂物颗粒SiC", "非夹杂物颗粒FeO", "未识别颗粒" };
+            List<int> FLID = new List<int>() { 0, 1, 2, 3, 4, 5, 6, 9 };
+            //List<string> NameList = new List<string>() { "过小颗粒", "过大颗粒", "亮度不在分析范围内的颗粒", "低计数率颗粒", "不含分析元素的颗粒", "非夹杂物颗粒SiC", "非夹杂物颗粒FeO", "未识别颗粒" };
+            List<string> NameList = new List<string>() { "过小颗粒", "过大颗粒", "亮度不在分析范围内的颗粒", "低计数率颗粒", "不含分析元素的颗粒", "未识别颗粒" };
 
 
             if (in_dparticle.TypeId < 1000)
             if (in_dparticle.TypeId < 1000)
             {
             {

+ 4 - 2
OTSIncAReportApp/Control_Graph/OTSIncAReportGraphFuncation/OTSIncAReportFun.cs

@@ -1362,7 +1362,8 @@ namespace OTSIncAReportGraph.OTSIncAReportGraphFuncation
         public void GetDistrbutionSortimage_ByQuery(OTSIncAReportApp.OTSSampleReportInfo.OTSSampleMeaInfo sourceGridData)
         public void GetDistrbutionSortimage_ByQuery(OTSIncAReportApp.OTSSampleReportInfo.OTSSampleMeaInfo sourceGridData)
         {
         {
             List<string> FLNameList = new List<string>();
             List<string> FLNameList = new List<string>();
-            List<int> FLID = new List<int>() { -1,0, 1, 2, 4, 6, 7, 8, 9 };
+            //List<int> FLID = new List<int>() { -1,0, 1, 2, 4, 6, 7, 8, 9 };
+            List<int> FLID = new List<int>() { 0, 1, 2, 4, 6, 9, 10};
             List<string> NameList = new List<string>();
             List<string> NameList = new List<string>();
             int fltype = 0;
             int fltype = 0;
             //先清除list
             //先清除list
@@ -1454,7 +1455,8 @@ namespace OTSIncAReportGraph.OTSIncAReportGraphFuncation
             }
             }
             if (fltype == 0)
             if (fltype == 0)
             {
             {
-                NameList = new List<string>() { table["partcletype0"].ToString(), table["partcletype1"].ToString(), table["partcletype2"].ToString(), table["partcletype4"].ToString(), table["partcletype6"].ToString(), table["partcletype7"].ToString(), table["partcletype8"].ToString(), table["partcletype9"].ToString(), table["partcletype10"].ToString() };
+                //NameList = new List<string>() { table["partcletype0"].ToString(), table["partcletype1"].ToString(), table["partcletype2"].ToString(), table["partcletype4"].ToString(), table["partcletype6"].ToString(), table["partcletype7"].ToString(), table["partcletype8"].ToString(), table["partcletype9"].ToString(), table["partcletype10"].ToString() };
+                NameList = new List<string>() { table["partcletype0"].ToString(), table["partcletype1"].ToString(), table["partcletype2"].ToString(), table["partcletype4"].ToString(), table["partcletype6"].ToString(), table["partcletype9"].ToString(), table["partcletype10"].ToString() };
             }
             }
             if (fltype == 1)
             if (fltype == 1)
             {
             {

+ 5 - 4
OTSIncAReportApp/frmReportApp.Designer.cs

@@ -197,7 +197,7 @@
             this.ribbon1.OrbDropDown.Name = "";
             this.ribbon1.OrbDropDown.Name = "";
             this.ribbon1.OrbDropDown.OptionItems.Add(this.ribbonOrbOptionButton1);
             this.ribbon1.OrbDropDown.OptionItems.Add(this.ribbonOrbOptionButton1);
             this.ribbon1.OrbDropDown.RecentItems.Add(this.ribbonOrbRecentItem1);
             this.ribbon1.OrbDropDown.RecentItems.Add(this.ribbonOrbRecentItem1);
-            this.ribbon1.OrbDropDown.Size = new System.Drawing.Size(527, 336);
+            this.ribbon1.OrbDropDown.Size = new System.Drawing.Size(527, 248);
             this.ribbon1.OrbDropDown.TabIndex = 0;
             this.ribbon1.OrbDropDown.TabIndex = 0;
             this.ribbon1.OrbImage = global::OTSIncAReportApp.Properties.Resources.logo_40;
             this.ribbon1.OrbImage = global::OTSIncAReportApp.Properties.Resources.logo_40;
             // 
             // 
@@ -210,7 +210,7 @@
             this.ribbon1.QuickAcessToolbar.ToolTip = null;
             this.ribbon1.QuickAcessToolbar.ToolTip = null;
             this.ribbon1.QuickAcessToolbar.ToolTipImage = null;
             this.ribbon1.QuickAcessToolbar.ToolTipImage = null;
             this.ribbon1.QuickAcessToolbar.ToolTipTitle = null;
             this.ribbon1.QuickAcessToolbar.ToolTipTitle = null;
-            this.ribbon1.Size = new System.Drawing.Size(1914, 130);
+            this.ribbon1.Size = new System.Drawing.Size(1914, 195);
             this.ribbon1.TabIndex = 0;
             this.ribbon1.TabIndex = 0;
             this.ribbon1.Tabs.Add(this.ribbonTab1);
             this.ribbon1.Tabs.Add(this.ribbonTab1);
             this.ribbon1.Tabs.Add(this.rbMenu);
             this.ribbon1.Tabs.Add(this.rbMenu);
@@ -230,6 +230,7 @@
             this.dpbOpen.ToolTip = null;
             this.dpbOpen.ToolTip = null;
             this.dpbOpen.ToolTipImage = null;
             this.dpbOpen.ToolTipImage = null;
             this.dpbOpen.ToolTipTitle = null;
             this.dpbOpen.ToolTipTitle = null;
+            this.dpbOpen.Click += new System.EventHandler(this.dpbOpen_Click);
             // 
             // 
             // dpbExport
             // dpbExport
             // 
             // 
@@ -553,9 +554,9 @@
             this.DockWindowPanel.ActiveAutoHideContent = null;
             this.DockWindowPanel.ActiveAutoHideContent = null;
             this.DockWindowPanel.Dock = System.Windows.Forms.DockStyle.Fill;
             this.DockWindowPanel.Dock = System.Windows.Forms.DockStyle.Fill;
             this.DockWindowPanel.DockBackColor = System.Drawing.SystemColors.Control;
             this.DockWindowPanel.DockBackColor = System.Drawing.SystemColors.Control;
-            this.DockWindowPanel.Location = new System.Drawing.Point(0, 130);
+            this.DockWindowPanel.Location = new System.Drawing.Point(0, 195);
             this.DockWindowPanel.Name = "DockWindowPanel";
             this.DockWindowPanel.Name = "DockWindowPanel";
-            this.DockWindowPanel.Size = new System.Drawing.Size(1914, 873);
+            this.DockWindowPanel.Size = new System.Drawing.Size(1914, 808);
             dockPanelGradient1.EndColor = System.Drawing.SystemColors.ControlLight;
             dockPanelGradient1.EndColor = System.Drawing.SystemColors.ControlLight;
             dockPanelGradient1.StartColor = System.Drawing.SystemColors.ControlLight;
             dockPanelGradient1.StartColor = System.Drawing.SystemColors.ControlLight;
             autoHideStripSkin1.DockStripGradient = dockPanelGradient1;
             autoHideStripSkin1.DockStripGradient = dockPanelGradient1;

+ 36 - 1
OTSIncAReportApp/frmReportApp.cs

@@ -1195,9 +1195,44 @@ namespace OTSIncAReportApp
             }));
             }));
         }
         }
 
 
+
         #endregion
         #endregion
 
 
-        
+        private void dpbOpen_Click(object sender, EventArgs e)
+        {
+            OpenProFile();
+        }
+
+        /// <summary>
+        /// 打开报告项目工程文件,封装方法
+        /// </summary>
+        /// <returns></returns>
+        private bool OpenProFile()
+        {
+            OpenFileDialog openFileDialog = new OpenFileDialog();
+            openFileDialog.Filter = "Measure Project Files((*.prj)|*.prj";
+            openFileDialog.ValidateNames = true;
+            openFileDialog.CheckPathExists = true;
+            openFileDialog.CheckFileExists = true;
+            openFileDialog.Multiselect = false;
+            if (openFileDialog.ShowDialog() == DialogResult.OK)
+            {
+                string strFilePath = System.IO.Path.GetDirectoryName(openFileDialog.FileName);
+
+                System.IO.DirectoryInfo folder = new System.IO.DirectoryInfo(strFilePath);
+
+                foreach (System.IO.DirectoryInfo directory in folder.GetDirectories())
+                {
+                    foreach (System.IO.FileInfo file in directory.GetFiles("*.rst"))
+                    {
+                        this.m_RstWindow.AddSampleClick(file.FullName);
+                    }
+                }
+                return true;
+            }
+
+            else return false;
+        }
     }
     }
 }
 }