Quellcode durchsuchen

1.修改颗粒列表拼接颗粒能谱计数报错问题
2.修复打开就测量结果放大倍数空缺问题
3.优化分布图排列图打开大放大倍数标尺过大问题

cxs vor 11 Monaten
Ursprung
Commit
1f7b5d758c

+ 9 - 1
OTSCommon/ReportModel/ResultFile.cs

@@ -56,7 +56,15 @@ public    enum OTS_Y_AXIS_DIRECTION
             Dictionary<string, object> sampleMembers = ((Dictionary<string, object>)((Dictionary<string, object>)ResultInfo["Sample"])["Members"]);
             Dictionary<string, object> SEMDataMsr = (Dictionary<string, object>)sampleMembers["SEMDataMsr"];
             //Dictionary<string, object> SEMStageData = (Dictionary<string, object>)ResultInfo["SEMStageData"];
-            float ScanMagnification = float.Parse(SEMDataMsr["Magnification"].ToString());
+            float ScanMagnification = 0;
+            try
+            {
+                ScanMagnification = float.Parse(SEMDataMsr["Magnification"].ToString());
+            }
+            catch
+            {
+                ScanMagnification = GetScanFieldSizeX100() * 100 / GetScanFieldSizeX();
+            }
             return ScanMagnification;
         }
         public float GetScanFieldSizeY()

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

@@ -353,8 +353,29 @@ namespace OTSIncAReportGraph.Controls
                 //将标尺定位到合理的位置上
                 this.control_Ruler1.Location = new Point(10, MyPrimaryScreen.WorkingArea.Height - 300);
                 this.control_Ruler1.Visible = true;
-                this.control_Ruler1.SetValue(m_f_ruler_size);
-                this.control_Ruler1.ShowString = Convert.ToInt32(100).ToString() + "μm";
+                if (d_onefixel_width > MyPrimaryScreen.WorkingArea.Width /2)
+                {
+                    if (d_onefixel_width / 10 > MyPrimaryScreen.WorkingArea.Width/2)
+                    {
+                        this.control_Ruler1.SetValue(d_onefixel_width / 100);
+                        m_f_ruler_size = d_onefixel_width / 100;
+                        m_f_old_ruler_size = d_onefixel_width / 100;
+                        this.control_Ruler1.ShowString = Convert.ToInt32(1).ToString() + "μm";
+                    }
+                    else
+                    {
+                        this.control_Ruler1.SetValue(d_onefixel_width / 10);
+                        m_f_ruler_size = d_onefixel_width / 10;
+                        m_f_old_ruler_size = d_onefixel_width / 10;
+                        this.control_Ruler1.ShowString = Convert.ToInt32(10).ToString() + "μm";
+                    }
+                }
+                else
+                {
+                    this.control_Ruler1.SetValue(m_f_ruler_size);
+                    this.control_Ruler1.ShowString = Convert.ToInt32(100).ToString() + "μm";
+                }
+                this.control_Ruler1.Visible = true;
             }
             ProgressBarUpdate(100, table["str2"].ToString());
             m_frm_userprogress.Visible = false;
@@ -555,7 +576,6 @@ namespace OTSIncAReportGraph.Controls
 
 
             }
-
             //display GB field
             if (m_CurGBFields.Count > 0)
             {

+ 20 - 2
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionSortImage.cs

@@ -222,8 +222,26 @@ namespace OTSIncAReportGraph.Controls
                 //将标尺定位到合理的位置上
                 this.control_Ruler1.Location = new Point(10, MyPrimaryScreen.WorkingArea.Height - 300);
                 this.control_Ruler1.Visible = true;
-                this.control_Ruler1.SetValue(m_f_ruler_size);
-                this.control_Ruler1.ShowString = Convert.ToInt32(100).ToString() + "μm";
+                if (m_f_ruler_size > MyPrimaryScreen.WorkingArea.Width / 2)
+                {
+                    if (m_f_ruler_size / 10 > MyPrimaryScreen.WorkingArea.Width / 2)
+                    {
+                        this.control_Ruler1.SetValue(m_f_ruler_size / 100);
+                        m_f_ruler_size = m_f_ruler_size / 100;
+                        this.control_Ruler1.ShowString = Convert.ToInt32(1).ToString() + "μm";
+                    }
+                    else
+                    {
+                        this.control_Ruler1.SetValue(m_f_ruler_size / 10);
+                        m_f_ruler_size = m_f_ruler_size / 10;
+                        this.control_Ruler1.ShowString = Convert.ToInt32(10).ToString() + "μm";
+                    }
+                }
+                else
+                {
+                    this.control_Ruler1.SetValue(m_f_ruler_size);
+                    this.control_Ruler1.ShowString = Convert.ToInt32(100).ToString() + "μm";
+                }
             }
 
  

+ 21 - 17
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ParticlesGridDevidePage.cs

@@ -352,29 +352,33 @@ namespace OTSIncAReportGrids
                 }
                 particlesAll.Rows[i]["Element"] = ConcatenatedString;
             }
-            DataTable XRayData = Particledata.GetXRayData();
-            particlesAll.Columns.Add("XRayDataCount");
-            for (int i = 0; i < particlesAll.Rows.Count; i++)
+            if (sel!=(int)SelItem.MergeParticles)
             {
-                if (int.Parse(particlesAll.Rows[i]["particleId"].ToString()) > -1)
+
+                DataTable XRayData = Particledata.GetXRayData();
+                particlesAll.Columns.Add("XRayDataCount");
+                for (int i = 0; i < particlesAll.Rows.Count; i++)
                 {
-                    string str = " XrayIndex= " + particlesAll.Rows[i]["particleId"].ToString() + " and fieldid = " + particlesAll.Rows[i]["fieldid"].ToString();
-                    DataRow[] drs = XRayData.Select(str);
-                    uint xraycount = 0;
-                    if (drs != null)
+                    if (int.Parse(particlesAll.Rows[i]["particleId"].ToString()) > -1)
                     {
-                        uint[] Analysis_xray = new uint[2000];
-                        for (int j = 0; j < 2000; j++)
+                        string str = " XrayIndex= " + particlesAll.Rows[i]["particleId"].ToString() + " and fieldid = " + particlesAll.Rows[i]["fieldid"].ToString();
+                        DataRow[] drs = XRayData.Select(str);
+                        uint xraycount = 0;
+                        if (drs != null)
                         {
-                            Analysis_xray[j] = BitConverter.ToUInt32((byte[])drs[0][2], j * 4);
-                        }
-                        for (int j = 0; j < 2000; j++)
-                        {
-                            xraycount += Analysis_xray[j];
+                            uint[] Analysis_xray = new uint[2000];
+                            for (int j = 0; j < 2000; j++)
+                            {
+                                Analysis_xray[j] = BitConverter.ToUInt32((byte[])drs[0][2], j * 4);
+                            }
+                            for (int j = 0; j < 2000; j++)
+                            {
+                                xraycount += Analysis_xray[j];
+                            }
+                            particlesAll.Rows[i]["XRayDataCount"] = xraycount;
                         }
-                        particlesAll.Rows[i]["XRayDataCount"] = xraycount;
-                    }
 
+                    }
                 }
             }
             return true;