lizhongsys vor 3 Jahren
Ursprung
Commit
5eab2237dd

+ 6 - 6
Bin/x64/Debug/Config/ProData/ReportTemplateConfig.xml

@@ -1,7 +1,7 @@
 <XmlConfig>
   <M_SY>
     <str_tb_ZBT>Inclusion Analysis </str_tb_ZBT>
-    <str_tb_FBT>XXX实验室</str_tb_FBT>
+    <str_tb_FBT>立中合金实验室</str_tb_FBT>
     <str_tb_YPBH>0001</str_tb_YPBH>
     <str_tb_CKBZ>GB/T30834-2014</str_tb_CKBZ>
     <b_ck_ypsm>True</b_ck_ypsm>
@@ -19,7 +19,7 @@
     <index_cb_klcc_ljb>0</index_cb_klcc_ljb>
     <index_cb_klcc_klfw>0</index_cb_klcc_klfw>
     <b_cb_jzwfl_xsmk>True</b_cb_jzwfl_xsmk>
-    <index_cb_jzwfl_xstx>4</index_cb_jzwfl_xstx>
+    <index_cb_jzwfl_xstx>0</index_cb_jzwfl_xstx>
     <index_cb_jzwfl_jsfs>0</index_cb_jzwfl_jsfs>
     <index_cb_jzwfl_ljb>0</index_cb_jzwfl_ljb>
     <index_cb_jzwfl_klfw>0</index_cb_jzwfl_klfw>
@@ -41,7 +41,7 @@
       <YS8>N</YS8>
     </list_str_tb_ysfx_xsys>
     <b_ck_yscf_xsmk>True</b_ck_yscf_xsmk>
-    <index_cb_yscf_xstx>2</index_cb_yscf_xstx>
+    <index_cb_yscf_xstx>0</index_cb_yscf_xstx>
     <index_cb_yscf_jsfs>0</index_cb_yscf_jsfs>
     <index_cb_yscf_klfw>0</index_cb_yscf_klfw>
     <str_tb_yscf_ysxx>H</str_tb_yscf_ysxx>
@@ -50,7 +50,7 @@
     </list_str_tb_yscf_ysxx>
   </M_YSFXJG>
   <M_SYXT>
-    <b_ck_syxt_xsmk>True</b_ck_syxt_xsmk>
+    <b_ck_syxt_xsmk>False</b_ck_syxt_xsmk>
     <index_cb_syxt_jsfs>0</index_cb_syxt_jsfs>
     <index_cb_syxt_klfw>0</index_cb_syxt_klfw>
     <str_cb_syxt_mhxssl>2</str_cb_syxt_mhxssl>
@@ -72,10 +72,10 @@
     </list_lbv_syxt_mblb_index>
   </M_SYXT>
   <M_KLLBXX>
-    <b_ck_kllb_xsmk>True</b_ck_kllb_xsmk>
+    <b_ck_kllb_xsmk>False</b_ck_kllb_xsmk>
     <index_cb_kllb_jsfs>0</index_cb_kllb_jsfs>
     <index_cb_kllb_klfw>0</index_cb_kllb_klfw>
-    <int_tb_kllb_ylsx>100</int_tb_kllb_ylsx>
+    <int_tb_kllb_ylsx>1</int_tb_kllb_ylsx>
     <str_tb_kllb_sxys>O,Al,Mg,Ca,Ti,Si,S,Mn</str_tb_kllb_sxys>
     <list_str_tb_lllb_sxys>
       <YS0>O</YS0>

BIN
Bin/x64/Debug/Resources/ReportTemplate/groupCancelGrain.rmf


+ 129 - 8
OTSIncAReportApp/1-UI/OTSTemplateDesigner/Export_ReportTemplate.cs

@@ -197,6 +197,120 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
 
             #endregion
 
+            //for (int i= 0;i < dt_ParticlesGridDevidePage.Rows.Count;i++)
+            //{
+            //    //获取颗粒的fieldid,和particleid
+            //    string str_fieldid = dt_ParticlesGridDevidePage.Rows[i]["fieldid"].ToString();
+            //    string str_particleid = dt_ParticlesGridDevidePage.Rows[i]["particleid"].ToString();
+            //    string str_subparticles = dt_ParticlesGridDevidePage.Rows[i]["SubParticles"].ToString();
+            //    string str_typeid = dt_ParticlesGridDevidePage.Rows[i]["TypeId"].ToString();
+            //    string str_typename = dt_ParticlesGridDevidePage.Rows[i]["TypeName"].ToString();
+            //    string str_element = dt_ParticlesGridDevidePage.Rows[i]["Element"].ToString();
+
+
+
+            //    //获取原始颗粒图像
+            //    Bitmap bp_particle = new Bitmap(1, 1);
+            //    string str_path = str_resultPath + "\\FIELD_FILES\\";
+            //    string str_imagePath = str_path + "Field" + str_fieldid.ToString() + ".bmp";
+
+            //    if (str_subparticles != null && str_subparticles != "")
+            //    {
+
+            //    }
+            //    else
+            //    {
+            //        //正常颗粒
+            //        Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i]["RectLeft"]), Y = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i]["RectTop"]), Width = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i]["RectWidth"]), Height = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i]["RectHeight"]) };
+            //        Bitmap bp_field = fielddata.ReadImageFile(str_imagePath);
+            //        bp_particle = fielddata.GetBitmapByParticle(bp_field, rectangle);
+            //        bp_particle.Tag = new List<string>() { dt_ParticlesGridDevidePage.Rows[i]["FieldId"].ToString(), dt_ParticlesGridDevidePage.Rows[i]["ParticleId"].ToString(), dt_ParticlesGridDevidePage.Rows[i]["TypeId"].ToString() };
+
+
+            //        if (fielddata.GetParticleByFidAndPid(str_fieldid, str_particleid).XRayData != null)
+            //        {
+
+            //            //获取该颗粒的xray能谱图像
+            //            System.Drawing.Bitmap bp_xraybp = ExportXRayBitmap(str_fieldid,
+            //                str_particleid, Convert.ToInt32(str_typeid), str_typename, fielddata);
+            //            Bitmap ls_xraybpnew = new Bitmap(1, 1);
+            //            ls_xraybpnew = OTSIncAReportGraph.Class.DrawFunction.KiResizeImage(bp_xraybp, 700, 115);//能谱图处理
+
+            //            //获取该颗粒的二次放大处理图像
+            //            Bitmap ls_processbitmap = new Bitmap(1, 1);
+            //            ls_processbitmap = OTSIncAReportGraph.Class.DrawFunction.GetReZoomBitmap(bp_particle);// (Bitmap)bp_particle.Clone();//待完善
+
+            //            //再将图像转成二进制流-------------------------------------------------------------------
+            //            //原图
+            //            MemoryStream newms_p1 = new MemoryStream();
+            //            bp_particle.Save(newms_p1, System.Drawing.Imaging.ImageFormat.Bmp);
+            //            newms_p1.Seek(0, SeekOrigin.Begin);
+            //            byte[] newarr_p1 = new byte[newms_p1.Length];
+            //            newms_p1.Read(newarr_p1, 0, newarr_p1.Length);
+
+            //            //二次放大图
+            //            MemoryStream newms_p2 = new MemoryStream();
+            //            ls_processbitmap.Save(newms_p2, System.Drawing.Imaging.ImageFormat.Bmp);
+            //            newms_p2.Seek(0, SeekOrigin.Begin);
+            //            byte[] newarr_p2 = new byte[newms_p2.Length];
+            //            newms_p2.Read(newarr_p2, 0, newarr_p2.Length);
+
+            //            //能谱图
+            //            MemoryStream newms_p3 = new MemoryStream();
+            //            ls_xraybpnew.Save(newms_p3, System.Drawing.Imaging.ImageFormat.Bmp);
+            //            newms_p3.Seek(0, SeekOrigin.Begin);
+            //            byte[] newarr_p3 = new byte[newms_p3.Length];
+            //            newms_p3.Read(newarr_p3, 0, newarr_p3.Length);
+            //            //---------------------------------------------------------------------------------------                  
+            //            DataRow dr = DT_Largest20.NewRow();
+
+            //            dr["p1"] = newarr_p1;
+            //            dr["p2"] = newarr_p2;
+            //            dr["p3"] = newarr_p3;
+            //            newms_p1.Dispose();
+            //            newms_p2.Dispose();
+            //            newms_p3.Dispose();
+
+            //            dr["pid"] = str_fieldid + dt_ParticlesGridDevidePage.Rows[i]["particleid"].ToString();
+            //            dr["Size"] = Convert.ToDouble(dt_ParticlesGridDevidePage.Rows[i]["area"]).ToString("#0.00"); //可以需要选择切换,计算方式
+            //            dr["Width"] = dt_ParticlesGridDevidePage.Rows[i]["rectwidth"].ToString();
+            //            dr["Class"] = dt_ParticlesGridDevidePage.Rows[i]["typename"].ToString();
+
+
+            //            List<string> list_max_elementname = new List<string>();
+            //            List<double> list_max_elementvale = new List<double>();
+            //            GetMaxElementFromDataTable(dt_ParticlesGridDevidePage, i, out list_max_elementname, out list_max_elementvale);
+            //            //元素1
+            //            dr["ColName1"] = list_max_elementname[0];
+            //            dr["ColVal1"] = list_max_elementvale[0].ToString();
+            //            //元素2
+            //            dr["ColName2"] = list_max_elementname[1];
+            //            dr["ColVal2"] = list_max_elementvale[1].ToString();
+            //            //元素3
+            //            dr["ColName3"] = list_max_elementname[2];
+            //            dr["ColVal3"] = list_max_elementvale[2].ToString();
+            //            //元素4
+            //            dr["ColName4"] = list_max_elementname[3];
+            //            dr["ColVal4"] = list_max_elementvale[3].ToString();
+            //            //元素5
+            //            dr["ColName5"] = list_max_elementname[4];
+            //            dr["ColVal5"] = list_max_elementvale[4].ToString();
+            //            //元素6
+            //            dr["ColName6"] = list_max_elementname[5];
+            //            dr["ColVal6"] = list_max_elementvale[5].ToString();
+
+
+            //            DT_Largest20.Rows.Add(dr);
+
+            //        }
+            //    }
+
+
+
+
+            //}
+
+
             #region 插入-前20颗粒部份
             for (int i_row = 0; i_row < 20; i_row++)
             {
@@ -231,13 +345,16 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                     {
                         //正常颗粒
                         Rectangle rectangle = new Rectangle() { X = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectLeft"]), Y = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectTop"]), Width = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectWidth"]), Height = Convert.ToInt32(dt_ParticlesGridDevidePage.Rows[i_row]["RectHeight"]) };
-                        Bitmap bp_field = fielddata.ReadImageFile(str_imagePath);
-                        bp_particle = fielddata.GetBitmapByParticle(bp_field, rectangle);
-                        bp_particle.Tag = new List<string>() { dt_ParticlesGridDevidePage.Rows[i_row]["FieldId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["ParticleId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["TypeId"].ToString() };
-                    }
+                    Bitmap bp_field = fielddata.ReadImageFile(str_imagePath);
+                    bp_particle = fielddata.GetBitmapByParticle(bp_field, rectangle);
+                    bp_particle.Tag = new List<string>() { dt_ParticlesGridDevidePage.Rows[i_row]["FieldId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["ParticleId"].ToString(), dt_ParticlesGridDevidePage.Rows[i_row]["TypeId"].ToString() };
+                }
 
-                    //获取该颗粒的xray能谱图像
-                    System.Drawing.Bitmap bp_xraybp = ExportXRayBitmap(str_fieldid,
+                //fielddata.GetParticleByFidAndPid(str_fieldid, str_particleid);
+
+
+                //获取该颗粒的xray能谱图像
+                System.Drawing.Bitmap bp_xraybp = ExportXRayBitmap(str_fieldid,
                         str_particleid, Convert.ToInt32(str_typeid), str_typename, fielddata);
                     Bitmap ls_xraybpnew = new Bitmap(1, 1);
                     ls_xraybpnew = OTSIncAReportGraph.Class.DrawFunction.KiResizeImage(bp_xraybp, 700, 115);//能谱图处理
@@ -305,7 +422,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                     dr["ColName6"] = list_max_elementname[5];
                     dr["ColVal6"] = list_max_elementvale[5].ToString();
 
-                   
+
                     DT_Largest20.Rows.Add(dr);
                 }
             }
@@ -1047,7 +1164,11 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             {
                 for (int i = 0; i < 2000; i++)
                 {
-                    Analysis_xray[i] = BitConverter.ToUInt32(particle.XRayData, i * 4);
+                    if (particle.XRayData!=null)
+                    {
+                        Analysis_xray[i] = BitConverter.ToUInt32(particle.XRayData, i * 4);
+                    }
+                    
                 }
 
                 Search_xray = Analysis_xray;

+ 1 - 1
OTSIncAReportApp/2-CommonFunction/CommonClass/DisplayParticle.cs

@@ -55,7 +55,7 @@ namespace OTSIncAReportGraph
     /// </summary>
     public class DisplayParticle : BaseObject, ICloneable, IComparable<DisplayParticle>
     {
-        private const float m_zoom_displaymultiplier = 0.1f;
+        private const float m_zoom_displaymultiplier = 0.5f;
         public Particle objParticleData;
         private Guid m_id;
         private RectangleF m_rect;