Explorar o código

fix bugs when reclassification.

gsp %!s(int64=3) %!d(string=hai) anos
pai
achega
1572e09a44

+ 10 - 1
OTSCPP/OTSClrInterface/CommonClr/OTSParticleClr.cpp

@@ -239,7 +239,16 @@ namespace OTSCLRINTERFACE {
 
 	CPosXrayClr^ COTSParticleClr::GetXray()
 	{
-		return gcnew CPosXrayClr(m_Particle->get()->GetXrayInfo());
+		auto xray = m_Particle->get()->GetXrayInfo();
+		if (xray != nullptr)
+		{
+			return gcnew CPosXrayClr(m_Particle->get()->GetXrayInfo());
+		}
+		else
+		{
+			return gcnew CPosXrayClr();
+		}
+		
 	}
 
 	int COTSParticleClr::GetTagId()

+ 2 - 0
OTSIncAMeasureApp/0-OTSModel/OTSDataType/CSampleParam.cs

@@ -108,6 +108,8 @@ namespace OTSDataType
                 m_strName = xstrName.value();
                 m_strSTDName = xstrSTDName.value();
                 m_SteelTech = (STEEL_TECHNOLOGY)xSteelTech.value();
+                var syst = xSystype.toString();
+                m_nPackId = (OTS_SysType_ID)Convert.ToInt32(syst.Split(':')[0]);
             }
         }
 

+ 1 - 13
OTSIncAMeasureApp/OTSIncAMeasureAppForm.cs

@@ -565,19 +565,7 @@ namespace OTSMeasureApp
 
             //打开已保存的样品后,将所有样品发送给样品台
             string sWSampleName = m_ProjParam.GetWorkSampleName();
-            if (SMInfo.sSampleSoluName != "")
-            {
-                string str = table[this.Name.ToLower()].ToString();
-                //this.Text = str + "-" + SMInfo.sSampleSoluName;
-                if (m_ProjParam.m_ResultData.m_nPackId.ToString() == "IncA")
-                {
-                    this.Text = str + "(Inclusion)";
-                }
-                else if (m_ProjParam.m_ResultData.m_nPackId.ToString() == "CleannessA")
-                {
-                    this.Text = str + "(Cleanness)";
-                }
-            }
+           
             if ("" == sWSampleName)
             {
                 log.Error("(OTSIncAMeasureAppForm.OpenExistSampleFile)  m_DataMgrFun.GetWorkSampleName() = null Failed !");

+ 3 - 3
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.cs

@@ -1341,8 +1341,8 @@ namespace OTSIncAReportGraph.Controls
 
             //获取使用标准库的名称
           
-            string str_IncALibName = "";
-            str_IncALibName = m_mouseOver_dparticle.TypeName;
+            string str_IncAName = "";
+            str_IncAName = m_mouseOver_dparticle.TypeName;
 
 
             //获取数据后,需要对xraytable设置
@@ -1350,7 +1350,7 @@ namespace OTSIncAReportGraph.Controls
             control_XRayTable1.SetXRayShowLineValue(Search_xray, Analysis_xray, list_showelementinfo);
             //颗粒国标信息
             control_XRayTable1.GBInfoStr = "";
-            control_XRayTable1.MaterialName = str_IncALibName;//杂夹物
+            control_XRayTable1.MaterialName = str_IncAName;//杂夹物
          
             control_XRayTable1.List_ShowElementInfo = list_showelementinfo;
             control_XRayTable1.Visible = true;

+ 27 - 2
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_XRayTable.cs

@@ -6,6 +6,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Drawing;
 using System.Linq;
+using System.Text;
 using System.Windows.Forms;
 
 namespace OTSIncAReportGraph.Controls
@@ -619,15 +620,38 @@ namespace OTSIncAReportGraph.Controls
             g.DrawString(m_goodname, m_thisfont_bold, m_this_sb, new PointF(m_i_rightdrawlabellocation_x + 50, m_i_rightdrawlabellocation_y + 40));
 
             //show element list information,using the elementlist number to make sure width,number take width 25 growth
+
             if (m_list_showelementinfo != null)
             {
+                //make it 100%
+                double sumpercentage = 0;
+                for (int i = 0; i < m_list_showelementinfo.Count; i++)
+                {
+                    sumpercentage += m_list_showelementinfo[i].Percentage;
+                
+                }
+                for (int i = 0; i < m_list_showelementinfo.Count; i++)
+                {
+                    m_list_showelementinfo[i].percentageIn100 = m_list_showelementinfo[i].Percentage / sumpercentage * 100;
+
+                }
+
+
+
                 PointF ls_pt = new PointF(m_i_rightdrawlabellocation_x - (m_list_showelementinfo.Count * 25 - 60), m_i_rightdrawlabellocation_y + 60);
                 for (int i = 0; i < m_list_showelementinfo.Count; i++)
                 {
-                    string str_element = "" + m_list_showelementinfo[i].ElementName + "(" + m_list_showelementinfo[i].Percentage.ToString("0.00") + ")";
+                    StringBuilder sb = new StringBuilder();
+
+                    sb.Append(m_list_showelementinfo[i].ElementName);
+                    sb.Append("(");
+                    sb.Append(m_list_showelementinfo[i].Percentage.ToString("0.00/"));
+                    sb.Append(m_list_showelementinfo[i].percentageIn100.ToString("0.00)"));
+                    string str_element = sb.ToString();
+                    //string str_element = m_list_showelementinfo[i].ElementName + "(" + m_list_showelementinfo[i].Percentage.ToString("0.00:") + m_list_showelementinfo[i].percentageIn100.ToString("0.00") +")";
                     SizeF out_testsizef = g.MeasureString(str_element, m_thisfont);
                     g.DrawString(str_element, m_thisfont, new SolidBrush(DrawFunction.GetColorByNumber(i + 1)), ls_pt);
-                    ls_pt.X = ls_pt.X + out_testsizef.Width + 2;
+                    ls_pt.X = ls_pt.X + out_testsizef.Width -4;
                 }
             }
             //标准库显示
@@ -698,6 +722,7 @@ namespace OTSIncAReportGraph.Controls
         public string ElementName;
         public double Percentage;//实际能谱返回的质量百分比
         public double dKF;//K峰,元素周期表中固定值
+        public double percentageIn100;//归一化后的百分比
     }
     #endregion