Browse Source

Merge branch 'Release2.3' of http://36.129.163.148:10080/gaoshipeng/OTS2_0 into Release2.3

gsp 3 years ago
parent
commit
11dca98692

+ 1 - 1
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>东北大学</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>

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


+ 4 - 1
OTSIncAMeasureApp/1-OTSMeasure/OTSMeasureDisplayResult.cs

@@ -532,7 +532,8 @@ namespace OTSMeasureApp
                                 {
                                     string inprocessEndTime = SMsrData.STMThreadStu.csMsrEndTime;
                                     SetMeasureResultInfo(SMsrData);
-                                    MeasureResultMsrData = SMsrData;
+
+
                                     m_bgWorker.ReportProgress((int)ProgressState.MeasureCheckReport, SMsrData);
                                     //激活跳转至报告程序按钮
                                     m_MeasureApp.rbPReport.Enabled = true;
@@ -729,11 +730,13 @@ namespace OTSMeasureApp
             double m_SEMDMagni = OTSSamplespaceWindow.m_SEMDMagni;
             double m_PropIWDistance = OTSSamplespaceWindow.m_PropIWDistance;
             double m_PropDMagni = OTSSamplespaceWindow.m_PropDMagni;
+            //m_MeasureApp.m_ProjParam.
             if (m_PropIWDistance != 0 && m_PropDMagni != 0)
             {
                 m_MeasureApp.m_ProjParam.SetWorkingSampleSEMData(m_PropIWDistance, m_PropDMagni);
             }
             m_MeasureApp.m_SamplepaceWindow.SetSEMDATAMParameter(m_SEMDMagni,m_SEMIWDistance);
+            m_MeasureApp.m_ProjParam.SetFliedsCount(OTSSamplespaceWindow.m_TotalFieldsCount);
         }
         #endregion
 

+ 11 - 2
OTSIncAMeasureApp/2-OTSMeasureParamManage/COTSMeasureParam.cs

@@ -1199,7 +1199,10 @@ namespace OTSMeasureApp
             {
             }
         }
-
+        public void SetFliedsCount(int FliedsCount)
+        {
+            m_ResultData.GetWorkingSample().GetSEMDataMsr().SetTotalFields(FliedsCount);
+        }
         //获取电镜参数
         //int iScanFieldSize: Field扫描参数
         //int iWDistance: 电镜工作距离
@@ -1210,6 +1213,12 @@ namespace OTSMeasureApp
             dMagni = m_ResultData.GetWorkingSample().GetSEMDataMsr().GetMagnification();
         }
 
+        public int GetTotalFieldsCount()
+        {
+            int icount = m_ResultData.GetWorkingSample().GetSEMDataMsr().GetTotalFields();
+            return icount;
+        }
+
         //获取工作样品的测量区域
         //int iShape :测量区域形状
         //Rectangle Srect: 测量区域大小
@@ -1402,7 +1411,7 @@ namespace OTSMeasureApp
                 smlgrp.sTitle = sTitle;
                 for (int j = 0; j < SDataArr.Count; j++)
                 {
-                    var SDataObj = SDataArr[j];
+                      var SDataObj = SDataArr[j];
                     SamplePropertyData SData = new SamplePropertyData();
                     int smplid = (int)SDataObj.GetSmplItemId();
                     SData.iSampleId = (OTS_SAMPLE_PROP_GRID_ITEMS)smplid;

+ 46 - 45
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/OTSSamplespaceWindow.cs

@@ -102,7 +102,8 @@ namespace OTSMeasureApp
         public static double m_SEMDMagni = 0;
         public static double m_PropIWDistance = 0;
         public static double m_PropDMagni = 0;
-
+        
+        public static int m_TotalFieldsCount = 0;
         #region 鼠标滚动所需参数
         public static float m_ScaleNum = 1;
         public static float m_GlobalZoomNum = 1;//记录每次比例缩放后的总体比例系数。
@@ -163,15 +164,7 @@ namespace OTSMeasureApp
         #endregion
 
         #region 标尺变量
-        //缩放的增大缩小的增量
-        private float f_zoom_increment = 0.1f;
-
-        //缩放的基数,临时变量
-        private float f_widthandheight_js = 0;
-
-        //与原先缩放的记录数
-        private float f_zoom_record = 1;
-
+        
         //最小缩放倍数
         private float f_zoom_mix = 0.5f;
 
@@ -654,7 +647,7 @@ namespace OTSMeasureApp
             //绘制样品台信息
             DrawSampleStage(m_OTSSampleStageData);
             //标尺初始化
-            RulerInit();
+            RulerInit(m_OTSSampleStageData);
             //重新绘制
             Invalidate();
             //1.将测量结果窗体中已存在的内容清空
@@ -2727,45 +2720,38 @@ namespace OTSMeasureApp
 
             if (e.Delta > 0)
             {
-               
-                #region //图形缩放计算部份-------放大------------//是放大
-                f_widthandheight_js = f_zoom_increment;
-                f_zoom_record = f_zoom_record + f_zoom_increment;
-                f_zoom_record = float.Parse(f_zoom_record.ToString("#0.0")); //四舍五入,保留一位小数,如果不这样,float会不附合规则
-                #endregion
-
                 #region 计算标尺尺寸部份-----放大------
                 //计算标尺实际占用像素的宽度
-                f_ruler_size = f_ruler_size + Convert.ToInt32(f_old_ruler_size * f_zoom_increment);
+                f_ruler_size = f_old_ruler_size * m_GlobalZoomNum;
                 control_Ruler2.RulerWidth = Convert.ToInt32(f_ruler_size);
+                control_Ruler2.Value = 1;
                 //显示该像素宽度代表的实际宽度
-                control_Ruler2.SetValueInspector(f_ruler_size, ((Convert.ToDouble(m_OTSSampleStageData.StageDomain.Width) / 54f) / 10));
+                //control_Ruler2.SetValue(control_Ruler2.RulerWidth);
                 //放大过长时,这里将宽度与代表的实际宽度进行折半显示
-                if (control_Ruler2.RulerWidth > 200)
+                while (control_Ruler2.Width > 300)
                 {
-                    control_Ruler2.RulerWidth = Convert.ToInt32(f_ruler_size) / 2;
+                    control_Ruler2.RulerWidth = Convert.ToInt32(control_Ruler2.RulerWidth) / 2;
+                    control_Ruler2.Value = control_Ruler2.Value * 2;
                 }
+                control_Ruler2.SetValue(control_Ruler2.RulerWidth, control_Ruler2.Value.ToString());
                 #endregion
                 
             }
             else
             {
-                if (f_zoom_record >= f_zoom_mix)
+                if (m_GlobalZoomNum >= f_zoom_mix)
                 {
-                    #region //图形缩放计算部份------缩小--------------------
-                    f_widthandheight_js = -f_zoom_increment;
-                    f_zoom_record = f_zoom_record - f_zoom_increment;
-                    f_zoom_record = float.Parse(f_zoom_record.ToString("#0.0")); //四舍五入,保留一位小数,如果不这样,float会不附合规则
-                    #endregion
-
-                    #region 计算标尺尺寸部份-----缩小------f_onepixel_size,是不是该乘以rulerwidth是实际的长度
-                    f_ruler_size = f_ruler_size + Convert.ToInt32(f_old_ruler_size * -f_zoom_increment);
+                    #region 计算标尺尺寸部份-----缩小
+                    f_ruler_size =f_old_ruler_size * m_GlobalZoomNum;
                     control_Ruler2.RulerWidth = Convert.ToInt32(f_ruler_size);
-                    control_Ruler2.SetValueInspector(f_ruler_size, ((Convert.ToDouble(m_OTSSampleStageData.StageDomain.Width) / Convert.ToDouble(54)) / 10));
-                    if (control_Ruler2.RulerWidth > 200)
+                    control_Ruler2.Value = 1;
+                    //control_Ruler2.SetValue(control_Ruler2.RulerWidth);
+                    while (control_Ruler2.Width > 300)
                     {
-                        control_Ruler2.RulerWidth = Convert.ToInt32(f_ruler_size) / 2;
+                        control_Ruler2.RulerWidth = Convert.ToInt32(control_Ruler2.RulerWidth) / 2;
+                        control_Ruler2.Value = control_Ruler2.Value * 2;
                     }
+                        control_Ruler2.SetValue(control_Ruler2.RulerWidth, control_Ruler2.Value.ToString());
                     #endregion
                 }
             }
@@ -2810,8 +2796,8 @@ namespace OTSMeasureApp
                         f_ruler_size = f_old_ruler_size;
 
                         control_Ruler2.RulerWidth = Convert.ToInt32(f_ruler_size);
-                        control_Ruler2.ShowString = "1000um";
-                        control_Ruler2.SetValueInspector(110, ((Convert.ToDouble(m_OTSSampleStageData.StageDomain.Width) / Convert.ToDouble(54)) / 10));
+                        control_Ruler2.ShowString = "1mm";
+                        control_Ruler2.SetValue(control_Ruler2.RulerWidth);
                     }
 
                     //重新绘制
@@ -3216,6 +3202,7 @@ namespace OTSMeasureApp
                     //记录当前放大倍数 在停止拍摄图片后设置回原放大倍数
                     m_MeasureAppForm.m_ProjParam.GetWorkingSampleSEMData(ref m_PropIWDistance, ref m_PropDMagni);
                     GetSEMDATAMParameter(ref m_SEMDMagni, ref m_SEMIWDistance);
+                    m_TotalFieldsCount = m_MeasureAppForm.m_ProjParam.GetTotalFieldsCount();
                     GetBSEPictures();
                     break;
                 case "DeleteBSEPicture":
@@ -4044,8 +4031,6 @@ namespace OTSMeasureApp
          
                 mFlag = m_SEMDATAFieldManage.SetSEMMagnificationParameter(magnification);
                 wFlag = m_SEMDATAFieldManage.SetSEMWorkingDistanceParameter(semWorkingDistance);
-          
-               
                 if (mFlag || wFlag)
                 {
                     return true;
@@ -4072,7 +4057,6 @@ namespace OTSMeasureApp
                 //放大倍数
                 magnification = semParameters[0];
                 WorkingDistance = semParameters[1];
-
                 //m_SEMDATAFieldManage.CloseSEM();
                 return true;
             }
@@ -4319,17 +4303,34 @@ namespace OTSMeasureApp
             {
                 //显示
                 control_Ruler2.Visible = true;
-                control_Ruler2.ShowString = "1000um";
+                //control_Ruler2.ShowString = control_Ruler2.Value+"um";
 
-                f_ruler_size = f_ruler_size + Convert.ToInt32(f_old_ruler_size * f_zoom_increment);
+                f_ruler_size = Convert.ToInt32(f_old_ruler_size * m_GlobalZoomNum);
                 control_Ruler2.RulerWidth = Convert.ToInt32(f_ruler_size);
-                control_Ruler2.SetValueInspector(f_ruler_size, ((Convert.ToDouble(m_OTSSampleStageData.StageDomain.Width) / Convert.ToDouble(54)) / 10));
+                control_Ruler2.Value = 1;
+                //显示该像素宽度代表的实际宽度
+                //control_Ruler2.SetValue(control_Ruler2.RulerWidth);
+                //放大过长时,这里将宽度与代表的实际宽度进行折半显示
+                while (control_Ruler2.Width > 300)
+                {
+                    control_Ruler2.RulerWidth = Convert.ToInt32(control_Ruler2.RulerWidth) / 2;
+                    control_Ruler2.Value = control_Ruler2.Value * 2;
+                }
+                control_Ruler2.SetValue(control_Ruler2.RulerWidth, control_Ruler2.Value.ToString());
             }
         }
-        public void RulerInit()
+        public void RulerInit(StageDrawingData SData)
         {
-            control_Ruler2.ShowString = "100um";
-            control_Ruler2.Width = 130;
+            control_Ruler2.ShowString = "1mm";
+            Point xDomain = new Point(SData.StageDomain.Left, SData.StageDomain.Top);
+            Point yDomain = new Point(SData.StageDomain.Right, SData.StageDomain.Bottom);
+
+            //OTS宽度高度差值
+            float widthDomain = Math.Abs(yDomain.X - xDomain.X);
+            int length = this.Height > this.Width ? this.Width : this.Height;
+            control_Ruler2.RulerWidth = (int)(length / widthDomain * 1000);
+            f_ruler_size = f_old_ruler_size = control_Ruler2.RulerWidth;
+            control_Ruler2.Value = 1000;
         }
         #endregion
 

+ 12 - 60
OTSIncAMeasureApp/5-OTSMeasureStatuImageFun/Control_Ruler.cs

@@ -10,9 +10,9 @@ namespace MyControls
     public partial class Control_Ruler : UserControl
     {
         #region 变量定义
-        private string m_showstring = "100um";
-        private double m_f_value = 0;  //实际表示的长度值
-        private float m_bs = 0;//倍数,计算使用
+        private string m_showstring = "1mm";
+        private double m_f_value = 1;  //实际表示的长度值
+        //private float m_bs = 0;//倍数,计算使用
 
         /// <summary>
         /// 显示在标尺上的文字
@@ -93,69 +93,21 @@ namespace MyControls
         #endregion
 
         /// <summary>
-        /// 设置当前标尺显示的值,自动计算其显示的文字及宽
+        /// 设置当前标尺
         /// </summary>
-        public void SetValue(double in_value)
+        public void SetValue(int in_value)
         {
-            this.m_f_value = in_value;
-            this.RulerWidth = Convert.ToInt32(in_value);
-
-            //写死缩放逻辑
-            if (this.Width > 100)
-            {
-                m_bs = (float)in_value / 100;
-                for (int i = 0; i < 100; i++)
-                {
-                    if (m_bs > i && m_bs <= (i + 1))
-                    {
-                        m_bs = i + 1;
-                    }
-                }
-
-                this.Width = Convert.ToInt32(in_value / m_bs) + 20; //有20的宽度是边,所以补上
-
-                //修改显示文字
-                m_showstring = Convert.ToInt32(100 / m_bs).ToString() + "μm";
-            }
+            this.Width = in_value + 20; //有20的宽度是边,所以补上
         }
-
-
         /// <summary>
-        /// 传入标尺要显示的宽度,及该宽度代表的1像素um单位级实际宽度
+        /// 
         /// </summary>
-        /// <param name="in_width"></param>
-        /// <param name="in_onepixel_size"></param>
-        public void SetValue(double in_width, double in_onepixel_size)
+        /// <param name="in_value"></param>
+        /// <param name="showstring"></param>
+        public void SetValue(int in_value,string showstring)
         {
-            this.m_f_value = in_width;
-            this.RulerWidth = Convert.ToInt32(in_width);
-            //显示信息
-            m_showstring = Convert.ToInt32(in_width* in_onepixel_size).ToString() + "μm";
-     
-
+            this.Width = in_value + 20; //有20的宽度是边,所以补上
+            m_showstring = showstring + "mm";
         }
-        /// <summary>
-        /// 设置当前标尺显示的值,自动计算其显示的文字及宽度
-        /// </summary>
-        public void SetValueInspector(double in_value, double in_xs)
-        {
-            double rulerWidth = 100;
-            double bs = rulerWidth / in_value;
-            if (bs > 1)
-            {
-                m_bs = (float)Math.Round(bs);
-            }
-            else if (bs < 1)
-            {
-                m_bs = (float)Math.Round(bs, 1);
-            }
-            this.Width = (int)(m_bs * in_value);
-            //修改显示文字
-            m_showstring = Convert.ToInt32(100 * m_bs * in_xs).ToString() + "um";
-
-            Invalidate();
-        }
-
-
     }
 }

+ 1 - 1
OTSIncAMeasureApp/About.cs

@@ -20,7 +20,7 @@ namespace OTSMeasureApp
         private void About_Load(object sender, EventArgs e)
         {
 
-            richTextBox1.Text = "Version : 2.1";
+            richTextBox1.Text = "Version : 2.3";
             richTextBox1.Select(0, richTextBox1.Text.Length);
             //richTextBox1.SelectionColor = Color.DarkBlue;
             richTextBox1.SelectionAlignment = HorizontalAlignment.Center;

+ 2 - 2
OTSIncAReportApp/1-UI/Control_Graph/OTSIncAReportGraphFuncation/OTSImageDisHelp.cs

@@ -219,9 +219,9 @@ namespace OTSIncAReportGraph.OTSIncAReportGraphFuncation
 
             //需要针对第二大的值,获取时进行判断,感觉这里应该如果并未找到第二大的值的情况下,赋于0值,便于以后进行计算
             if (width_max2 == -10000000)
-                width_max2 = 0;
+                width_max2 = width_max;
             if (height_max2 == -10000000)
-                height_max2 = 0;
+                height_max2 = height_max;
 
             RectangleF ret_rect = new RectangleF(0, 0, width_max - width_max2, height_max - height_max2);
 

+ 8 - 1
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage.cs

@@ -1449,6 +1449,7 @@ namespace OTSIncAReportGrids
         {
             string str_path_FIELD_FILES = result.FilePath + "\\FIELD_FILES\\";
             string str_path_FIELD_FILES_MARK = result.FilePath + "\\FIELD_FILES_MARK\\";
+            int intQuantity = 0;
 
             ////判断是否已经有导出过的标记帧图文件夹,如果已经存在,则直接返回不输出,先不加
             DirectoryInfo theFolder_FieldMark = new DirectoryInfo(str_path_FIELD_FILES_MARK);
@@ -1459,6 +1460,10 @@ namespace OTSIncAReportGrids
             }
             else
             {
+                theFolder_FieldMark.Delete(true);
+
+                //创建
+                theFolder_FieldMark.Create();
                 //已经存在的话,直接返回
                 //return;
             }
@@ -1480,7 +1485,7 @@ namespace OTSIncAReportGrids
                         string str_fieldid = Path.GetFileNameWithoutExtension(nextifile.Name);
                         str_fieldid = str_fieldid.Substring(5, str_fieldid.Length - 5);//减去field字符长度
 
-                        if (Convert.ToInt32(str_fieldid.ToString()) > 10)
+                        if (intQuantity > 10)
                             continue;
 
                         if (dataTable.Select(" fieldid = " + str_fieldid).Count() > 0)
@@ -1500,6 +1505,8 @@ namespace OTSIncAReportGrids
 
                             //循环将颗粒,进行标记到bitmap图上
                             DataRow[] drlist = dt_AllParticle.Select("  fieldid = " + str_fieldid);
+                            if (drlist.Count() > 0)
+                                intQuantity = intQuantity + 1;
                             for (int i_row = 0; i_row < drlist.Count(); i_row++)
                             {
                                 //string str_fieldid = drlist[i_row]["fieldid"].ToString();

+ 191 - 23
OTSIncAReportApp/1-UI/OTSTemplateDesigner/Export_ReportTemplate.cs

@@ -147,6 +147,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             DT_field_dt.Columns.Add(colpict2);
 
             //表名Largest_frame表:(子表)       显示20条颗粒除外的部份颗粒信息
+            DataTable DT_field_dt_copy = new DataTable();
             DataTable DT_Largest_frame = new DataTable();
             DT_Largest_frame.TableName = "Largest_frame";
             DT_Largest_frame.Columns.Add("pid");
@@ -338,36 +339,67 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             DirectoryInfo theFolder = new DirectoryInfo(str_path_FIELD_FILES_MARK);
             if (theFolder.Exists)
             {
-                for (int i = 0; i <= theFolder.GetFiles().Count(); i++)
+                //for (int i = 0; i <= theFolder.GetFiles().Count(); i++)
+                //{
+                //    //判断i.bmp图片是否存在,如果不存在跳出当前循环
+                //    if (!DetermineWhetherTheFileExists(theFolder, i))
+                //        continue;
+                //    //在数据表中有颗粒在该帧图中的话,则对该帧图标记图像进行读取存入数据库
+                //    DataRow[] datarowlist = dt_ParticlesGridDevidePage.Select(" fieldid = " + i);
+
+                //    if (datarowlist.Count() > 0)
+                //    {
+                //        Bitmap ls_bp_fieldmark = new Bitmap(theFolder.GetFiles()[i].FullName);
+
+                //        DataRow dr = DT_field_dt.NewRow();
+                //        MemoryStream newms_bp_fieldmark = new MemoryStream();
+                //        ls_bp_fieldmark.Save(newms_bp_fieldmark, System.Drawing.Imaging.ImageFormat.Bmp);
+                //        newms_bp_fieldmark.Seek(0, SeekOrigin.Begin);
+                //        byte[] newarr_fieldmark = new byte[newms_bp_fieldmark.Length];
+                //        newms_bp_fieldmark.Read(newarr_fieldmark, 0, newarr_fieldmark.Length);
+                //        dr["FieldImg"] = newarr_fieldmark;
+                //        dr["FieldId"] = i;
+
+                //        ls_bp_fieldmark.Dispose();
+                //        DT_field_dt.Rows.Add(dr);
+
+                //    }
+                //}
+                foreach (FileInfo nextifile in theFolder.GetFiles())
                 {
-                    //判断i.bmp图片是否存在,如果不存在跳出当前循环
-                    if (!DetermineWhetherTheFileExists(theFolder, i))
-                        continue;
-                    //在数据表中有颗粒在该帧图中的话,则对该帧图标记图像进行读取存入数据库
-                    DataRow[] datarowlist = dt_ParticlesGridDevidePage.Select(" fieldid = " + i);
-                    if (datarowlist.Count() > 0)
+                    if (nextifile.Name.Contains(".bmp") == true || nextifile.Name.Contains(".BMP") == true)
                     {
-                        Bitmap ls_bp_fieldmark = new Bitmap(theFolder.GetFiles()[i].FullName);
+                        //确认对应的帧图名
+                        string str_fieldid = Path.GetFileNameWithoutExtension(nextifile.Name);
+
+                        //在数据表中有颗粒在该帧图中的话,则对该帧图标记图像进行读取存入数据库
+                        DataRow[] datarowlist = dt_ParticlesGridDevidePage.Select(" fieldid = " + str_fieldid);
+                        if (datarowlist.Count() > 0)
+                        {
+                            Bitmap ls_bp_fieldmark = new Bitmap(nextifile.FullName);
 
-                        DataRow dr = DT_field_dt.NewRow();
-                        MemoryStream newms_bp_fieldmark = new MemoryStream();
-                        ls_bp_fieldmark.Save(newms_bp_fieldmark, System.Drawing.Imaging.ImageFormat.Bmp);
-                        newms_bp_fieldmark.Seek(0, SeekOrigin.Begin);
-                        byte[] newarr_fieldmark = new byte[newms_bp_fieldmark.Length];
-                        newms_bp_fieldmark.Read(newarr_fieldmark, 0, newarr_fieldmark.Length);
-                        dr["FieldImg"] = newarr_fieldmark;
-                        dr["FieldId"] = i;
+                            DataRow dr = DT_field_dt.NewRow();
+                            MemoryStream newms_bp_fieldmark = new MemoryStream();
+                            ls_bp_fieldmark.Save(newms_bp_fieldmark, System.Drawing.Imaging.ImageFormat.Bmp);
+                            newms_bp_fieldmark.Seek(0, SeekOrigin.Begin);
+                            byte[] newarr_fieldmark = new byte[newms_bp_fieldmark.Length];
+                            newms_bp_fieldmark.Read(newarr_fieldmark, 0, newarr_fieldmark.Length);
+                            dr["FieldImg"] = newarr_fieldmark;
+                            dr["FieldId"] = str_fieldid;
 
-                        ls_bp_fieldmark.Dispose();
-                        DT_field_dt.Rows.Add(dr);
+                            ls_bp_fieldmark.Dispose();
+                            DT_field_dt.Rows.Add(dr);
+
+                        }
 
                     }
                 }
-
-               
+                
+                DataView vw = DT_field_dt.DefaultView;
+                vw.Sort = "FieldId ASC";
+                DT_field_dt_copy = vw.ToTable();
             }
 
-
             #endregion
 
             #region 插入-前20颗粒外的颗粒
@@ -464,14 +496,150 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 
             }
             #endregion
+            FrameGraphParticleTable(dt_ParticlesGridDevidePage, str_resultPath, fielddata, DT_field_dt);
 
-
-            m_list_dt.Add(DT_field_dt);
+            m_list_dt.Add(DT_field_dt_copy);
             m_list_dt.Add(DT_Largest_frame);
             m_list_dt.Add(DT_Largest20);
 
             return true;
         }
+        private bool JudgeWhetherItExists(int id, DataTable dt,string column)
+        {
+            for (int i=0;i<dt.Rows.Count;i++)
+            {
+                if (id == Convert.ToInt32(dt.Rows[i][column].ToString()))
+                    return true;
+            }
+            return false;
+        }
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="dt_ParticlesGridDevidePage">数据源</param>
+        /// <param name="str_resultPath">地址</param>
+        /// <param name="fielddata"></param>
+        /// <param name="DT_field_dt">主表</param>
+        private void FrameGraphParticleTable(DataTable dt_ParticlesGridDevidePage,string str_resultPath, ParticleData fielddata,DataTable DT_field_dt)
+        {
+
+            //表名Largest_frame表:(子表)       显示20条颗粒除外的部份颗粒信息
+            DataTable FrameGraphSubTable = new DataTable();
+            FrameGraphSubTable.TableName = "FrameGraphSubTable";
+            FrameGraphSubTable.Columns.Add("pid");
+            FrameGraphSubTable.Columns.Add("Size");
+            FrameGraphSubTable.Columns.Add("Width");
+            FrameGraphSubTable.Columns.Add("Class");
+            FrameGraphSubTable.Columns.Add("ColName1");
+            FrameGraphSubTable.Columns.Add("ColName2");
+            FrameGraphSubTable.Columns.Add("ColName3");
+            FrameGraphSubTable.Columns.Add("ColName4");
+            FrameGraphSubTable.Columns.Add("ColName5");
+            FrameGraphSubTable.Columns.Add("ColName6");
+            FrameGraphSubTable.Columns.Add("ColVal1");
+            FrameGraphSubTable.Columns.Add("ColVal2");
+            FrameGraphSubTable.Columns.Add("ColVal3");
+            FrameGraphSubTable.Columns.Add("ColVal4");
+            FrameGraphSubTable.Columns.Add("ColVal5");
+            FrameGraphSubTable.Columns.Add("ColVal6");
+            DataColumn colpictid = new DataColumn("FieldId");
+            colpictid.DataType = typeof(int);
+            FrameGraphSubTable.Columns.Add(colpictid);
+            //图像列
+            DataColumn colpict = new DataColumn("p1");
+            colpict.DataType = System.Type.GetType("System.Byte[]");
+            FrameGraphSubTable.Columns.Add(colpict);
+
+            for (int i_row = 0; i_row < dt_ParticlesGridDevidePage.Rows.Count; i_row++)
+            {
+                if (dt_ParticlesGridDevidePage.Rows[i_row]["element"].ToString() == "")
+                    continue;
+                //获取颗粒的fieldid,和particleid
+                string str_fieldid = dt_ParticlesGridDevidePage.Rows[i_row]["fieldid"].ToString();
+
+                //if (Convert.ToInt32(str_fieldid) < 20)
+                if (JudgeWhetherItExists(Convert.ToInt32(str_fieldid), DT_field_dt, "FieldId"))
+                {
+
+                    string str_particleid = dt_ParticlesGridDevidePage.Rows[i_row]["particleid"].ToString();
+                    string str_subparticles = dt_ParticlesGridDevidePage.Rows[i_row]["SubParticles"].ToString();
+                    string str_typeid = dt_ParticlesGridDevidePage.Rows[i_row]["TypeId"].ToString();
+                    string str_typename = dt_ParticlesGridDevidePage.Rows[i_row]["TypeName"].ToString();
+                    string str_element = dt_ParticlesGridDevidePage.Rows[i_row]["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 != "")
+                    {
+                        
+                        continue;
+                    }
+                    else
+                    {
+                        //正常颗粒
+                        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() };
+                    }
+
+                    //获取该颗粒的xray能谱图像
+                    System.Drawing.Bitmap bp_xraybp = ExportXRayBitmap(str_fieldid,
+                        str_particleid, Convert.ToInt32(str_typeid), str_typename, fielddata);
+
+                    //获取该颗粒的二次放大处理图像
+                    Bitmap ls_processbitmap = new Bitmap(1, 1);
+                    ls_processbitmap = (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);
+                    //---------------------------------------------------------------------------------------                  
+                    DataRow dr = FrameGraphSubTable.NewRow();
+                    dr["p1"] = newarr_p1;
+                    newms_p1.Dispose();
+
+                    dr["pid"] = str_fieldid + dt_ParticlesGridDevidePage.Rows[i_row]["particleid"].ToString();
+                    dr["Size"] = Convert.ToDouble(dt_ParticlesGridDevidePage.Rows[i_row]["area"]).ToString("#0.00");  //可以需要选择切换,计算方式
+                    dr["Width"] = dt_ParticlesGridDevidePage.Rows[i_row]["rectwidth"].ToString();
+                    dr["Class"] = dt_ParticlesGridDevidePage.Rows[i_row]["typename"].ToString();
+
+                    dr["fieldid"] = str_fieldid;
+
+                    List<string> list_max_elementname = new List<string>();
+                    List<double> list_max_elementvale = new List<double>();
+                    GetMaxElementFromDataTable(dt_ParticlesGridDevidePage, i_row, 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();
+
+                    FrameGraphSubTable.Rows.Add(dr);
+                }
+
+            }
+            m_list_dt.Add(FrameGraphSubTable);
+        }
 
         private bool DetermineWhetherTheFileExists(DirectoryInfo theFolder ,int id)
         {

+ 16 - 16
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_Export.Designer.cs

@@ -52,7 +52,7 @@
             // richTextBox1
             // 
             this.richTextBox1.Location = new System.Drawing.Point(13, 53);
-            this.richTextBox1.Margin = new System.Windows.Forms.Padding(2);
+            this.richTextBox1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.richTextBox1.Name = "richTextBox1";
             this.richTextBox1.Size = new System.Drawing.Size(455, 231);
             this.richTextBox1.TabIndex = 60;
@@ -61,7 +61,7 @@
             // progressBar1
             // 
             this.progressBar1.Location = new System.Drawing.Point(93, 293);
-            this.progressBar1.Margin = new System.Windows.Forms.Padding(2);
+            this.progressBar1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.progressBar1.Name = "progressBar1";
             this.progressBar1.Size = new System.Drawing.Size(374, 15);
             this.progressBar1.TabIndex = 70;
@@ -89,7 +89,7 @@
             // btn_exit
             // 
             this.btn_exit.Location = new System.Drawing.Point(389, 319);
-            this.btn_exit.Margin = new System.Windows.Forms.Padding(2);
+            this.btn_exit.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.btn_exit.Name = "btn_exit";
             this.btn_exit.Size = new System.Drawing.Size(73, 27);
             this.btn_exit.TabIndex = 90;
@@ -111,7 +111,7 @@
             // tb_lj
             // 
             this.tb_lj.Location = new System.Drawing.Point(68, 30);
-            this.tb_lj.Margin = new System.Windows.Forms.Padding(2);
+            this.tb_lj.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.tb_lj.Name = "tb_lj";
             this.tb_lj.ReadOnly = true;
             this.tb_lj.Size = new System.Drawing.Size(285, 21);
@@ -121,7 +121,7 @@
             // btn_selectPath
             // 
             this.btn_selectPath.Location = new System.Drawing.Point(356, 29);
-            this.btn_selectPath.Margin = new System.Windows.Forms.Padding(2);
+            this.btn_selectPath.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.btn_selectPath.Name = "btn_selectPath";
             this.btn_selectPath.Size = new System.Drawing.Size(47, 20);
             this.btn_selectPath.TabIndex = 40;
@@ -134,7 +134,7 @@
             // tb_mblj
             // 
             this.tb_mblj.Location = new System.Drawing.Point(68, 6);
-            this.tb_mblj.Margin = new System.Windows.Forms.Padding(2);
+            this.tb_mblj.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.tb_mblj.Name = "tb_mblj";
             this.tb_mblj.ReadOnly = true;
             this.tb_mblj.Size = new System.Drawing.Size(285, 21);
@@ -143,7 +143,7 @@
             // btn_openfilepath
             // 
             this.btn_openfilepath.Location = new System.Drawing.Point(356, 4);
-            this.btn_openfilepath.Margin = new System.Windows.Forms.Padding(2);
+            this.btn_openfilepath.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.btn_openfilepath.Name = "btn_openfilepath";
             this.btn_openfilepath.Size = new System.Drawing.Size(47, 20);
             this.btn_openfilepath.TabIndex = 10;
@@ -155,7 +155,7 @@
             // btn_TempDes
             // 
             this.btn_TempDes.Location = new System.Drawing.Point(407, 4);
-            this.btn_TempDes.Margin = new System.Windows.Forms.Padding(2);
+            this.btn_TempDes.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.btn_TempDes.Name = "btn_TempDes";
             this.btn_TempDes.Size = new System.Drawing.Size(65, 20);
             this.btn_TempDes.TabIndex = 20;
@@ -179,7 +179,7 @@
             this.cbo_sjy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.cbo_sjy.FormattingEnabled = true;
             this.cbo_sjy.Location = new System.Drawing.Point(68, 31);
-            this.cbo_sjy.Margin = new System.Windows.Forms.Padding(2);
+            this.cbo_sjy.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.cbo_sjy.Name = "cbo_sjy";
             this.cbo_sjy.Size = new System.Drawing.Size(285, 20);
             this.cbo_sjy.TabIndex = 50;
@@ -187,7 +187,7 @@
             // panel_container
             // 
             this.panel_container.Location = new System.Drawing.Point(66, 188);
-            this.panel_container.Margin = new System.Windows.Forms.Padding(2);
+            this.panel_container.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.panel_container.Name = "panel_container";
             this.panel_container.Size = new System.Drawing.Size(17, 21);
             this.panel_container.TabIndex = 5;
@@ -195,7 +195,7 @@
             // button3
             // 
             this.button3.Location = new System.Drawing.Point(407, 29);
-            this.button3.Margin = new System.Windows.Forms.Padding(2);
+            this.button3.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.button3.Name = "button3";
             this.button3.Size = new System.Drawing.Size(65, 20);
             this.button3.TabIndex = 40;
@@ -208,7 +208,7 @@
             // btn_preview
             // 
             this.btn_preview.Location = new System.Drawing.Point(312, 319);
-            this.btn_preview.Margin = new System.Windows.Forms.Padding(2);
+            this.btn_preview.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.btn_preview.Name = "btn_preview";
             this.btn_preview.Size = new System.Drawing.Size(73, 27);
             this.btn_preview.TabIndex = 80;
@@ -236,7 +236,7 @@
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(475, 351);
+            this.ClientSize = new System.Drawing.Size(475, 350);
             this.ControlBox = false;
             this.Controls.Add(this.button7);
             this.Controls.Add(this.cbo_sjy);
@@ -256,11 +256,11 @@
             this.Controls.Add(this.richTextBox1);
             this.Controls.Add(this.panel_container);
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
-            this.Margin = new System.Windows.Forms.Padding(2);
+            this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.MaximizeBox = false;
-            this.MaximumSize = new System.Drawing.Size(491, 390);
+            this.MaximumSize = new System.Drawing.Size(491, 389);
             this.MinimizeBox = false;
-            this.MinimumSize = new System.Drawing.Size(491, 390);
+            this.MinimumSize = new System.Drawing.Size(491, 389);
             this.Name = "OTSReport_Export";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
             this.Text = "报告程序输出界面";

+ 304 - 267
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_Export.cs

@@ -1244,393 +1244,391 @@ namespace OTSIncAReportApp
                 //创建表 ResultGrid
                 string[] strcolumns_ResultGrid = { "CLJGMC", "YXSJ", "SCZS", "FLFA", "YJCTZ", "SCMJ", "CKBZ" };
                 string[] strcoltypes_ResultGrid = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" };
-                sh.CreateTable("ResultGrid", strcolumns_ResultGrid, strcoltypes_ResultGrid);
+
 
                 //创建表 Largest_frame
                 string[] strcolumns_Largest_frame = { "pid", "Size", "Width", "Class", "ColName1", "ColName2", "ColName3", "ColName4", "ColName5", "ColName6",
                 "ColVal1", "ColVal2", "ColVal3", "ColVal4", "ColVal5", "ColVal6" ,"FieldId","p1"};
                 string[] strcoltypes_Largest_frame = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" ,
             "INT","BLOB"};
-                sh.CreateTable("Largest_frame", strcolumns_Largest_frame, strcoltypes_Largest_frame);
+                
 
                 //创建表 Largest20
                 string[] strcolumns_Largest20 = { "pid", "Size", "Width", "Class", "ColName1", "ColName2", "ColName3", "ColName4", "ColName5", "ColName6",
                 "ColVal1", "ColVal2", "ColVal3", "ColVal4", "ColVal5", "ColVal6" ,"p1" ,"p2" ,"p3"};
                 string[] strcoltypes_Largest20 = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" ,
             "BLOB","BLOB","BLOB"};
-                sh.CreateTable("Largest20", strcolumns_Largest20, strcoltypes_Largest20);
+                
 
                 //创建表 Largest2new
-                string[] strcolumns_Largest2new = { "pid", "Size", "Width", "Class", "ColName1", "ColName2", "ColName3", "ColName4", "ColName5", "ColName6",
-                "ColVal1", "ColVal2", "ColVal3", "ColVal4", "ColVal5", "ColVal6" ,"p1"};
-                string[] strcoltypes_Largest2new = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" ,
-            "BLOB"};
-                sh.CreateTable("Largest2new", strcolumns_Largest2new, strcoltypes_Largest2new);
+            //    string[] strcolumns_Largest2new = { "pid", "Size", "Width", "Class", "ColName1", "ColName2", "ColName3", "ColName4", "ColName5", "ColName6",
+            //    "ColVal1", "ColVal2", "ColVal3", "ColVal4", "ColVal5", "ColVal6" ,"p1"};
+            //    string[] strcoltypes_Largest2new = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" ,
+            //"BLOB"};
+            //    sh.CreateTable("Largest2new", strcolumns_Largest2new, strcoltypes_Largest2new);
 
                 //创建表 field_dt
                 string[] strcolumns_field_dt = { "FieldId", "FieldImg" };
                 string[] strcoltypes_field_dt = { "INT", "BLOB" };
-                sh.CreateTable("field_dt", strcolumns_field_dt, strcoltypes_field_dt);
-
+                
 
                 //创建表 ElementName
                 string[] strcolumns_ElementName = { "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9","e10","e11","e12","e13","e14" };
                 string[] strcoltypes_ElementName = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" };
-                sh.CreateTable("ElementName", strcolumns_ElementName, strcoltypes_ElementName);
+
 
                 //创建表 ElementValue
                 string[] strcolumns_ElementValue = { "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9","e10","e11","e12","e13","e14", "PName", "Count" , "AllElements" };
                 string[] strcoltypes_ElementValue = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" };
-                sh.CreateTable("ElementValue", strcolumns_ElementValue, strcoltypes_ElementValue);
+
 
                 //创建表 PartSize
                 string[] strcolumns_PartSize = { "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9" };
                 string[] strcoltypes_PartSize = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" };
-                sh.CreateTable("PartSize", strcolumns_PartSize, strcoltypes_PartSize);
+
 
                 //创建表 Particel
                 string[] strcolumns_Particel = { "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "SName", "total" };
                 string[] strcoltypes_Particel = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" };
-                sh.CreateTable("Particel", strcolumns_Particel, strcoltypes_Particel);
 
                 //创建表 PicKL
                 string[] strcolumns_PicKL = { "pict" };
                 string[] strcoltypes_PicKL = { "BLOB" };
-                sh.CreateTable("PicKL", strcolumns_PicKL, strcoltypes_PicKL);
+                
 
                 //创建表 夹杂物面积比
                 string[] strcolumns_PicInclusionAreaRatio = { "pict" };
                 string[] strcoltypes_PicInclusionAreaRatio = { "BLOB" };
-                sh.CreateTable("PicInclusionAreaRatio", strcolumns_PicKL, strcoltypes_PicKL);
+                
 
                 //创建表 PicYS
                 string[] strcolumns_PicYS = { "pict" };
                 string[] strcoltypes_PicYS = { "BLOB" };
-                sh.CreateTable("PicYS", strcolumns_PicYS, strcoltypes_PicYS);
+                
 
                 //创建表 PicSYXT2T
                 string[] strcolumns_PicSYXT2T = { "pict", "pict2" };
                 string[] strcoltypes_PicSYXT2T = { "BLOB", "BLOB" };
-                sh.CreateTable("PicSYXT2T", strcolumns_PicSYXT2T, strcoltypes_PicSYXT2T);
+                
 
                 //创建表 PicSYXT3T
                 string[] strcolumns_PicSYXT3T = { "pict", "pict2", "pict3" };
                 string[] strcoltypes_PicSYXT3T = { "BLOB", "BLOB", "BLOB" };
-                sh.CreateTable("PicSYXT3T", strcolumns_PicSYXT3T, strcoltypes_PicSYXT3T);
 
-                //创建 颗粒面积比表
+
                 string[] strcolums_AreaRatio = { "c1", "c2", "c3", "c4", "c5" };
                 string[] strcoltypes_AreaRatio = { "TEXT", "TEXT", "TEXT", "TEXT", "TEXT" };
-                sh.CreateTable("AreaRatio", strcolums_AreaRatio, strcoltypes_AreaRatio);
+                
 
                 //将数据插入到数据库中
                 List<DataTable> list_dt = m_export_reporttemplate.m_list_dt;
-                DataTable ls_AreaRatio = list_dt.Where(aa => aa.TableName.Contains("InclusionAreaRatio")).ToList()[0];
-                for (int i = 0; i < ls_AreaRatio.Rows.Count; i++)
-                {
-                    string ls_sqlstr = "insert into AreaRatio (c1, c2, c3, c4, c5) values('"
-                       + ls_AreaRatio.Rows[i][0].ToString() + "','"
-                       + ls_AreaRatio.Rows[i][1].ToString() + "','"
-                       + ls_AreaRatio.Rows[i][2].ToString() + "','"
-                       + ls_AreaRatio.Rows[i][3].ToString() + "','"
-                       + ls_AreaRatio.Rows[i][4].ToString() + "')";
-                    int iresult = sh.ExecuteQueryResult(ls_sqlstr, tr);
-                }
+                //创建 颗粒面积比表
+                if (JudgeWhetherTheTableExists(list_dt, "InclusionAreaRatio"))
+                    DataTableSurfaceSaveToDB(list_dt, "AreaRatio", "InclusionAreaRatio", sh, strcolums_AreaRatio, strcoltypes_AreaRatio, tr);
+
+                //创建 样品信息表
+                if (JudgeWhetherTheTableExists(list_dt, "ResultGrid"))
+                    DataTableSurfaceSaveToDB(list_dt, "ResultGrid", "ResultGrid",sh, strcolumns_ResultGrid, strcoltypes_ResultGrid,tr);
 
-                    DataTable ls_resultgrid = list_dt.Where(aa => aa.TableName.Contains("ResultGrid")).ToList()[0];
-                for (int i = 0; i < ls_resultgrid.Rows.Count; i++)
-                {
-                    string ls_sqlstr = "insert into ResultGrid (CLJGMC, YXSJ, SCZS, FLFA, YJCTZ, SCMJ, CKBZ) values('"
-                        + ls_resultgrid.Rows[i][0].ToString() + "','"
-                        + ls_resultgrid.Rows[i][1].ToString() + "','"
-                        + ls_resultgrid.Rows[i][2].ToString() + "','"
-                        + ls_resultgrid.Rows[i][3].ToString() + "','"
-                        + ls_resultgrid.Rows[i][4].ToString() + "','"
-                        + ls_resultgrid.Rows[i][5].ToString() + "','"
-                        + ls_resultgrid.Rows[i][6].ToString() + "')";
-                    int iresult = sh.ExecuteQueryResult(ls_sqlstr, tr);
-                }
 
                 //插入 Largest_frame
-                DataTable ls_Largest_frame = list_dt.Where(aa => aa.TableName.Contains("Largest_frame")).ToList()[0];
-                for (int i = 0; i < ls_Largest_frame.Rows.Count; i++)
+                if (JudgeWhetherTheTableExists(list_dt, "Largest_frame"))
                 {
-                    if (ls_Largest_frame.Rows[i][17] == null)
+                    sh.CreateTable("Largest_frame", strcolumns_Largest_frame, strcoltypes_Largest_frame);
+                    DataTable ls_Largest_frame = list_dt.Where(aa => aa.TableName.Contains("Largest_frame")).ToList()[0];
+                    for (int i = 0; i < ls_Largest_frame.Rows.Count; i++)
                     {
-                        continue;
+                        if (ls_Largest_frame.Rows[i][17] == null)
+                        {
+                            continue;
+                        }
+                        if (ls_Largest_frame.Rows[i][17] == DBNull.Value)
+                        {
+                            continue;
+                        }
+
+                        string ls_sqlstr = "insert into Largest_frame (pid, Size, Width, Class, ColName1, ColName2, ColName3, ColName4, ColName5, ColName6,ColVal1, ColVal2, ColVal3, ColVal4, ColVal5, ColVal6 ,FieldID,p1) values('"
+                            + ls_Largest_frame.Rows[i][0].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][1].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][2].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][3].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][4].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][5].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][6].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][7].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][8].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][9].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][10].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][11].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][12].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][13].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][14].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][15].ToString() + "',"
+                            + ls_Largest_frame.Rows[i][16].ToString() + ",:p1)";
+
+                        byte[] byte_p1 = (byte[])ls_Largest_frame.Rows[i][17];
+
+                        int iresult = sh.ExecuteQuery(ls_sqlstr, "p1", byte_p1, tr);
                     }
-                    if (ls_Largest_frame.Rows[i][17] == DBNull.Value)
+                }
+                    
+
+                //插入帧图子表
+                if(JudgeWhetherTheTableExists(list_dt, "FrameGraphSubTable"))
+                {
+                    sh.CreateTable("FrameGraphSubTable", strcolumns_Largest_frame, strcoltypes_Largest_frame);
+                    DataTable ls_Largest_frame = list_dt.Where(aa => aa.TableName.Contains("FrameGraphSubTable")).ToList()[0];
+                    for (int i = 0; i < ls_Largest_frame.Rows.Count; i++)
                     {
-                        continue;
+                        if (ls_Largest_frame.Rows[i][17] == null)
+                        {
+                            continue;
+                        }
+                        if (ls_Largest_frame.Rows[i][17] == DBNull.Value)
+                        {
+                            continue;
+                        }
+
+                        string ls_sqlstr = "insert into FrameGraphSubTable (pid, Size, Width, Class, ColName1, ColName2, ColName3, ColName4, ColName5, ColName6,ColVal1, ColVal2, ColVal3, ColVal4, ColVal5, ColVal6 ,FieldID,p1) values('"
+                            + ls_Largest_frame.Rows[i][0].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][1].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][2].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][3].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][4].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][5].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][6].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][7].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][8].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][9].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][10].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][11].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][12].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][13].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][14].ToString() + "','"
+                            + ls_Largest_frame.Rows[i][15].ToString() + "',"
+                            + ls_Largest_frame.Rows[i][16].ToString() + ",:p1)";
+
+                        byte[] byte_p1 = (byte[])ls_Largest_frame.Rows[i][17];
+
+                        int iresult = sh.ExecuteQuery(ls_sqlstr, "p1", byte_p1, tr);
                     }
-
-                    string ls_sqlstr = "insert into Largest_frame (pid, Size, Width, Class, ColName1, ColName2, ColName3, ColName4, ColName5, ColName6,ColVal1, ColVal2, ColVal3, ColVal4, ColVal5, ColVal6 ,FieldID,p1) values('"
-                        + ls_Largest_frame.Rows[i][0].ToString() + "','"
-                        + ls_Largest_frame.Rows[i][1].ToString() + "','"
-                        + ls_Largest_frame.Rows[i][2].ToString() + "','"
-                        + ls_Largest_frame.Rows[i][3].ToString() + "','"
-                        + ls_Largest_frame.Rows[i][4].ToString() + "','"
-                        + ls_Largest_frame.Rows[i][5].ToString() + "','"
-                        + ls_Largest_frame.Rows[i][6].ToString() + "','"
-                        + ls_Largest_frame.Rows[i][7].ToString() + "','"
-                        + ls_Largest_frame.Rows[i][8].ToString() + "','"
-                        + ls_Largest_frame.Rows[i][9].ToString() + "','"
-                        + ls_Largest_frame.Rows[i][10].ToString() + "','"
-                        + ls_Largest_frame.Rows[i][11].ToString() + "','"
-                        + ls_Largest_frame.Rows[i][12].ToString() + "','"
-                        + ls_Largest_frame.Rows[i][13].ToString() + "','"
-                        + ls_Largest_frame.Rows[i][14].ToString() + "','"
-                        + ls_Largest_frame.Rows[i][15].ToString() + "',"
-                        + ls_Largest_frame.Rows[i][16].ToString() + ",:p1)";
-
-                    byte[] byte_p1 = (byte[])ls_Largest_frame.Rows[i][17];
-
-                    int iresult = sh.ExecuteQuery(ls_sqlstr, "p1", byte_p1, tr);
                 }
 
                 //插入 Largest20
-                DataTable ls_Largest20 = list_dt.Where(aa => aa.TableName.Contains("Largest20")).ToList()[0];
-                for (int i = 0; i < ls_Largest20.Rows.Count; i++)
+                if(JudgeWhetherTheTableExists(list_dt, "Largest20"))
                 {
-                    if (ls_Largest20.Rows[i][16] == null)
+                    sh.CreateTable("Largest20", strcolumns_Largest20, strcoltypes_Largest20);
+                    DataTable ls_Largest20 = list_dt.Where(aa => aa.TableName.Contains("Largest20")).ToList()[0];
+                    for (int i = 0; i < ls_Largest20.Rows.Count; i++)
                     {
-                        continue;
+                        if (ls_Largest20.Rows[i][16] == null)
+                        {
+                            continue;
+                        }
+                        if (ls_Largest20.Rows[i][16] == DBNull.Value)
+                        {
+                            continue;
+                        }
+
+                        string ls_sqlstr = "insert into Largest20 (pid, Size, Width, Class, ColName1, ColName2, ColName3, ColName4, ColName5, ColName6,ColVal1, ColVal2, ColVal3, ColVal4, ColVal5, ColVal6 ,p1,p2,p3) values('"
+                            + ls_Largest20.Rows[i][0].ToString() + "','"
+                            + ls_Largest20.Rows[i][1].ToString() + "','"
+                            + ls_Largest20.Rows[i][2].ToString() + "','"
+                            + ls_Largest20.Rows[i][3].ToString() + "','"
+                            + ls_Largest20.Rows[i][4].ToString() + "','"
+                            + ls_Largest20.Rows[i][5].ToString() + "','"
+                            + ls_Largest20.Rows[i][6].ToString() + "','"
+                            + ls_Largest20.Rows[i][7].ToString() + "','"
+                            + ls_Largest20.Rows[i][8].ToString() + "','"
+                            + ls_Largest20.Rows[i][9].ToString() + "','"
+                            + ls_Largest20.Rows[i][10].ToString() + "','"
+                            + ls_Largest20.Rows[i][11].ToString() + "','"
+                            + ls_Largest20.Rows[i][12].ToString() + "','"
+                            + ls_Largest20.Rows[i][13].ToString() + "','"
+                            + ls_Largest20.Rows[i][14].ToString() + "','"
+                            + ls_Largest20.Rows[i][15].ToString() + "',:p1,:p2,:p3)";
+
+                        byte[] byte_p1 = (byte[])ls_Largest20.Rows[i][16];
+                        byte[] byte_p2 = (byte[])ls_Largest20.Rows[i][17];
+                        byte[] byte_p3 = (byte[])ls_Largest20.Rows[i][18];
+
+                        int iresult = sh.ExecuteQuery(ls_sqlstr, "p1", byte_p1, "p2", byte_p2, "p3", byte_p3, tr);
                     }
-                    if (ls_Largest20.Rows[i][16] == DBNull.Value)
-                    {
-                        continue;
-                    }
-
-                    string ls_sqlstr = "insert into Largest20 (pid, Size, Width, Class, ColName1, ColName2, ColName3, ColName4, ColName5, ColName6,ColVal1, ColVal2, ColVal3, ColVal4, ColVal5, ColVal6 ,p1,p2,p3) values('"
-                        + ls_Largest20.Rows[i][0].ToString() + "','"
-                        + ls_Largest20.Rows[i][1].ToString() + "','"
-                        + ls_Largest20.Rows[i][2].ToString() + "','"
-                        + ls_Largest20.Rows[i][3].ToString() + "','"
-                        + ls_Largest20.Rows[i][4].ToString() + "','"
-                        + ls_Largest20.Rows[i][5].ToString() + "','"
-                        + ls_Largest20.Rows[i][6].ToString() + "','"
-                        + ls_Largest20.Rows[i][7].ToString() + "','"
-                        + ls_Largest20.Rows[i][8].ToString() + "','"
-                        + ls_Largest20.Rows[i][9].ToString() + "','"
-                        + ls_Largest20.Rows[i][10].ToString() + "','"
-                        + ls_Largest20.Rows[i][11].ToString() + "','"
-                        + ls_Largest20.Rows[i][12].ToString() + "','"
-                        + ls_Largest20.Rows[i][13].ToString() + "','"
-                        + ls_Largest20.Rows[i][14].ToString() + "','"
-                        + ls_Largest20.Rows[i][15].ToString() + "',:p1,:p2,:p3)";
-
-                    byte[] byte_p1 = (byte[])ls_Largest20.Rows[i][16];
-                    byte[] byte_p2 = (byte[])ls_Largest20.Rows[i][17];
-                    byte[] byte_p3 = (byte[])ls_Largest20.Rows[i][18];
-
-                    int iresult = sh.ExecuteQuery(ls_sqlstr, "p1", byte_p1, "p2", byte_p2, "p3", byte_p3, tr);
                 }
+                
 
                 //-----------------------------------------------------------------------------------------------------------------------------------
                 ////插入标记帧部份,进行特殊处理,从硬盘中拿现已经生成好的标记图像,进行加载,然后转成byte数组,存入到数据库中                ////准备存放标记图的文件夹
                 string m_strFieldPath_Mark = m_ReportApp.m_rstDataMgr.ResultFilesList[m_ReportApp.m_rstDataMgr.GetWorkingResult()].FilePath + "\\FIELD_FILES_MARK\\";
 
                 //插入 field_dt
-                DataTable ls_field_dt = list_dt.Where(aa => aa.TableName.Contains("field_dt")).ToList()[0];
-                for (int i = 0; i < ls_field_dt.Rows.Count; i++)
+                if (JudgeWhetherTheTableExists(list_dt, "field_dt"))
                 {
-                    string ls_sqlstr = "insert into field_dt (FieldId,FieldImg) values(" + ls_field_dt.Rows[i]["FieldId"] + ",:pict)";
-                    string str_fieldid = ls_field_dt.Rows[i][0].ToString();
-
-                    //从生成的FIELD_FIES_MARK文件夹中加载图像并转成byte数组,保存到数据库,节省内存
-                    Bitmap ls_bp_mark = new Bitmap(m_strFieldPath_Mark + str_fieldid + ".bmp");
-                    MemoryStream newms_fieldmark = new MemoryStream();
-                    ls_bp_mark.Save(newms_fieldmark, System.Drawing.Imaging.ImageFormat.Bmp);
-                    newms_fieldmark.Seek(0, SeekOrigin.Begin);
-                    byte[] newarr_field_mrak = new byte[newms_fieldmark.Length];
-                    newms_fieldmark.Read(newarr_field_mrak, 0, newarr_field_mrak.Length);
-
-                    int iresult = sh.ExecuteQuery(ls_sqlstr, "pict", newarr_field_mrak, tr);
-
-                    newms_fieldmark.Dispose();
-                    newms_fieldmark = null;
-                    ls_bp_mark.Dispose();
-                    ls_bp_mark = null;
-
-                    GC.Collect();
-                    GC.WaitForPendingFinalizers();
+                    sh.CreateTable("field_dt", strcolumns_field_dt, strcoltypes_field_dt);
+                    DataTable ls_field_dt = list_dt.Where(aa => aa.TableName.Contains("field_dt")).ToList()[0];
+                    for (int i = 0; i < ls_field_dt.Rows.Count; i++)
+                    {
+                        string ls_sqlstr = "insert into field_dt (FieldId,FieldImg) values(" + ls_field_dt.Rows[i]["FieldId"] + ",:pict)";
+                        string str_fieldid = ls_field_dt.Rows[i][0].ToString();
+
+                        //从生成的FIELD_FIES_MARK文件夹中加载图像并转成byte数组,保存到数据库,节省内存
+                        Bitmap ls_bp_mark = new Bitmap(m_strFieldPath_Mark + str_fieldid + ".bmp");
+                        MemoryStream newms_fieldmark = new MemoryStream();
+                        ls_bp_mark.Save(newms_fieldmark, System.Drawing.Imaging.ImageFormat.Bmp);
+                        newms_fieldmark.Seek(0, SeekOrigin.Begin);
+                        byte[] newarr_field_mrak = new byte[newms_fieldmark.Length];
+                        newms_fieldmark.Read(newarr_field_mrak, 0, newarr_field_mrak.Length);
+
+                        int iresult = sh.ExecuteQuery(ls_sqlstr, "pict", newarr_field_mrak, tr);
+
+                        newms_fieldmark.Dispose();
+                        newms_fieldmark = null;
+                        ls_bp_mark.Dispose();
+                        ls_bp_mark = null;
+
+                        GC.Collect();
+                        GC.WaitForPendingFinalizers();
+                    }
                 }
+
                 //-----------------------------------------------------------------------------------------------------------------
 
                 //插入 ElementName
-                DataTable ls_ElementName = list_dt.Where(aa => aa.TableName.Contains("ElementName")).ToList()[0];
-                for (int i = 0; i < ls_ElementName.Rows.Count; i++)
-                {
-                    string ls_sqlstr = "insert into ElementName (e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14 ) values('"
-                        + ls_ElementName.Rows[i][0].ToString() + "','"
-                        + ls_ElementName.Rows[i][1].ToString() + "','"
-                        + ls_ElementName.Rows[i][2].ToString() + "','"
-                        + ls_ElementName.Rows[i][3].ToString() + "','"
-                        + ls_ElementName.Rows[i][4].ToString() + "','"
-                        + ls_ElementName.Rows[i][5].ToString() + "','"
-                        + ls_ElementName.Rows[i][6].ToString() + "','"
-                        + ls_ElementName.Rows[i][7].ToString() + "','"
-                        + ls_ElementName.Rows[i][8].ToString() + "','"
-                        + ls_ElementName.Rows[i][9].ToString() + "','"
-                        + ls_ElementName.Rows[i][10].ToString() + "','"
-                        + ls_ElementName.Rows[i][11].ToString() + "','"
-                        + ls_ElementName.Rows[i][12].ToString() + "','"
-                        + ls_ElementName.Rows[i][13].ToString() + "')";
-                    int iresult = sh.ExecuteQueryResult(ls_sqlstr, tr);
-                }
+                if (JudgeWhetherTheTableExists(list_dt, "ElementName"))
+                    DataTableSurfaceSaveToDB(list_dt, "ElementName", "ElementName", sh, strcolumns_ElementName, strcoltypes_ElementName, tr);
+
 
                 //插入 ElementValue
-                DataTable ls_ElementValue = list_dt.Where(aa => aa.TableName.Contains("ElementValue")).ToList()[0];
-                for (int i = 0; i < ls_ElementValue.Rows.Count; i++)
-                {
-                    string ls_sqlstr = "insert into ElementValue (e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14,PName,Count,AllElements ) values('"
-                        + ls_ElementValue.Rows[i][0].ToString() + "','"
-                         + ls_ElementValue.Rows[i][1].ToString() + "','"
-                          + ls_ElementValue.Rows[i][2].ToString() + "','"
-                           + ls_ElementValue.Rows[i][3].ToString() + "','"
-                            + ls_ElementValue.Rows[i][4].ToString() + "','"
-                             + ls_ElementValue.Rows[i][5].ToString() + "','"
-                             + ls_ElementValue.Rows[i][6].ToString() + "','"
-                             + ls_ElementValue.Rows[i][7].ToString() + "','"
-                             + ls_ElementValue.Rows[i][8].ToString() + "','"
-                           + ls_ElementValue.Rows[i][9].ToString() + "','"
-                           + ls_ElementValue.Rows[i][10].ToString() + "','"
-                           + ls_ElementValue.Rows[i][11].ToString() + "','"
-                           + ls_ElementValue.Rows[i][12].ToString() + "','"
-                           + ls_ElementValue.Rows[i][13].ToString() + "','"
-                           + ls_ElementValue.Rows[i][14].ToString() + "','"
-                           + ls_ElementValue.Rows[i][15].ToString() + "','"
-                        + ls_ElementValue.Rows[i][16].ToString() + "')";
-                    int iresult = sh.ExecuteQueryResult(ls_sqlstr, tr);
-                }
+                if (JudgeWhetherTheTableExists(list_dt, "ElementValue"))
+                    DataTableSurfaceSaveToDB(list_dt, "ElementValue", "ElementValue", sh, strcolumns_ElementValue, strcoltypes_ElementValue, tr);
+
 
                 //插入 PartSize
-                DataTable ls_PartSize = list_dt.Where(aa => aa.TableName.Contains("PartSize")).ToList()[0];
-                for (int i = 0; i < ls_PartSize.Rows.Count; i++)
-                {
-                    string ls_sqlstr = "insert into PartSize (c1, c2, c3, c4, c5, c6, c7, c8, c9 ) values('"
-                        + ls_PartSize.Rows[i][0].ToString() + "','"
-                        + ls_PartSize.Rows[i][1].ToString() + "','"
-                        + ls_PartSize.Rows[i][2].ToString() + "','"
-                        + ls_PartSize.Rows[i][3].ToString() + "','"
-                        + ls_PartSize.Rows[i][4].ToString() + "','"
-                        + ls_PartSize.Rows[i][5].ToString() + "','"
-                        + ls_PartSize.Rows[i][6].ToString() + "','"
-                        + ls_PartSize.Rows[i][7].ToString() + "','"
-                        + ls_PartSize.Rows[i][8].ToString() + "')";
-                    int iresult = sh.ExecuteQueryResult(ls_sqlstr, tr);
-                }
+                if (JudgeWhetherTheTableExists(list_dt, "PartSize"))
+                    DataTableSurfaceSaveToDB(list_dt, "PartSize", "PartSize", sh, strcolumns_PartSize, strcoltypes_PartSize, tr);
+
 
                 //插入 Particel
-                DataTable ls_Particel = list_dt.Where(aa => aa.TableName.Contains("Particel")).ToList()[0];
-                for (int i = 0; i < ls_Particel.Rows.Count; i++)
-                {
-                    string ls_sqlstr = "insert into Particel (c1, c2, c3, c4, c5, c6, c7, c8, c9,SName,total ) values('"
-                        + ls_Particel.Rows[i][0].ToString() + "','"
-                        + ls_Particel.Rows[i][1].ToString() + "','"
-                        + ls_Particel.Rows[i][2].ToString() + "','"
-                        + ls_Particel.Rows[i][3].ToString() + "','"
-                        + ls_Particel.Rows[i][4].ToString() + "','"
-                        + ls_Particel.Rows[i][5].ToString() + "','"
-                        + ls_Particel.Rows[i][6].ToString() + "','"
-                        + ls_Particel.Rows[i][7].ToString() + "','"
-                        + ls_Particel.Rows[i][8].ToString() + "','"
-                        + ls_Particel.Rows[i][9].ToString() + "','"
-                        + ls_Particel.Rows[i][10].ToString() + "')";
-                    int iresult = sh.ExecuteQueryResult(ls_sqlstr, tr);
-                }
+                if (JudgeWhetherTheTableExists(list_dt, "Particel"))
+                    DataTableSurfaceSaveToDB(list_dt, "Particel", "Particel", sh, strcolumns_Particel, strcoltypes_Particel, tr);
+
 
                 //插入 PicKL
-                DataTable ls_PicKL = list_dt.Where(aa => aa.TableName.Contains("PicKL")).ToList()[0];
-                for (int i = 0; i < ls_PicKL.Rows.Count; i++)
+                if (JudgeWhetherTheTableExists(list_dt, "PicKL"))
                 {
-                    if (ls_PicKL.Rows[i][0] == null)
+                    sh.CreateTable("PicKL", strcolumns_PicKL, strcoltypes_PicKL);
+                    DataTable ls_PicKL = list_dt.Where(aa => aa.TableName.Contains("PicKL")).ToList()[0];
+                    for (int i = 0; i < ls_PicKL.Rows.Count; i++)
                     {
-                        continue;
+                        if (ls_PicKL.Rows[i][0] == null)
+                        {
+                            continue;
+                        }
+                        if (ls_PicKL.Rows[i][0] == DBNull.Value)
+                        {
+                            continue;
+                        }
+
+                        string ls_sqlstr = "insert into PicKL (pict) values(:pict)";
+                        byte[] byte_p1 = (byte[])ls_PicKL.Rows[i][0];
+                        int iresult = sh.ExecuteQuery(ls_sqlstr, "pict", byte_p1, tr);
                     }
-                    if (ls_PicKL.Rows[i][0] == DBNull.Value)
-                    {
-                        continue;
-                    }
-
-                    string ls_sqlstr = "insert into PicKL (pict) values(:pict)";
-                    byte[] byte_p1 = (byte[])ls_PicKL.Rows[i][0];
-                    int iresult = sh.ExecuteQuery(ls_sqlstr, "pict", byte_p1, tr);
                 }
+                
 
                 //插入 Pic_InclusionAreaRatio
-                DataTable ls_PicInclusionAreaRatio = list_dt.Where(aa => aa.TableName.Contains("Pic_InclusionAreaRatio")).ToList()[0];
-                for (int i = 0; i < ls_PicInclusionAreaRatio.Rows.Count; i++)
+                if (JudgeWhetherTheTableExists(list_dt, "Pic_InclusionAreaRatio"))
                 {
-                    if (ls_PicInclusionAreaRatio.Rows[i][0] == null)
-                    {
-                        continue;
-                    }
-                    if (ls_PicInclusionAreaRatio.Rows[i][0] == DBNull.Value)
+                    sh.CreateTable("PicInclusionAreaRatio", strcolumns_PicKL, strcoltypes_PicKL);
+                    DataTable ls_PicInclusionAreaRatio = list_dt.Where(aa => aa.TableName.Contains("Pic_InclusionAreaRatio")).ToList()[0];
+                    for (int i = 0; i < ls_PicInclusionAreaRatio.Rows.Count; i++)
                     {
-                        continue;
+                        if (ls_PicInclusionAreaRatio.Rows[i][0] == null)
+                        {
+                            continue;
+                        }
+                        if (ls_PicInclusionAreaRatio.Rows[i][0] == DBNull.Value)
+                        {
+                            continue;
+                        }
+
+                        string ls_sqlstr = "insert into PicInclusionAreaRatio (pict) values(:pict)";
+                        byte[] byte_p1 = (byte[])ls_PicInclusionAreaRatio.Rows[i][0];
+                        int iresult = sh.ExecuteQuery(ls_sqlstr, "pict", byte_p1, tr);
                     }
-
-                    string ls_sqlstr = "insert into PicInclusionAreaRatio (pict) values(:pict)";
-                    byte[] byte_p1 = (byte[])ls_PicInclusionAreaRatio.Rows[i][0];
-                    int iresult = sh.ExecuteQuery(ls_sqlstr, "pict", byte_p1, tr);
                 }
+                
 
 
                 //插入 PicYS
-                DataTable ls_PicYS = list_dt.Where(aa => aa.TableName.Contains("PicYS")).ToList()[0];
-                for (int i = 0; i < ls_PicYS.Rows.Count; i++)
+                if (JudgeWhetherTheTableExists(list_dt, "PicYS"))
                 {
-                    if (ls_PicYS.Rows[i][0] == null)
+                    sh.CreateTable("PicYS", strcolumns_PicYS, strcoltypes_PicYS);
+                    DataTable ls_PicYS = list_dt.Where(aa => aa.TableName.Contains("PicYS")).ToList()[0];
+                    for (int i = 0; i < ls_PicYS.Rows.Count; i++)
                     {
-                        continue;
+                        if (ls_PicYS.Rows[i][0] == null)
+                        {
+                            continue;
+                        }
+                        if (ls_PicYS.Rows[i][0] == DBNull.Value)
+                        {
+                            continue;
+                        }
+                        string ls_sqlstr = "insert into PicYS (pict) values(:pict)";
+                        byte[] byte_p1 = (byte[])ls_PicYS.Rows[i][0];
+                        int iresult = sh.ExecuteQuery(ls_sqlstr, "pict", byte_p1, tr);
                     }
-                    if (ls_PicYS.Rows[i][0] == DBNull.Value)
-                    {
-                        continue;
-                    }
-                    string ls_sqlstr = "insert into PicYS (pict) values(:pict)";
-                    byte[] byte_p1 = (byte[])ls_PicYS.Rows[i][0];
-                    int iresult = sh.ExecuteQuery(ls_sqlstr, "pict", byte_p1, tr);
                 }
+                
 
                 //插入 PicSYXT2T
-                DataTable ls_PicSYXT2T = list_dt.Where(aa => aa.TableName.Contains("PicSYXT2T")).ToList()[0];
-                for (int i = 0; i < ls_PicSYXT2T.Rows.Count; i++)
+                if (JudgeWhetherTheTableExists(list_dt, "PicSYXT2T"))
                 {
-                    if (ls_PicSYXT2T.Rows[i][0] == null)
+                    sh.CreateTable("PicSYXT2T", strcolumns_PicSYXT2T, strcoltypes_PicSYXT2T);
+                    DataTable ls_PicSYXT2T = list_dt.Where(aa => aa.TableName.Contains("PicSYXT2T")).ToList()[0];
+                    for (int i = 0; i < ls_PicSYXT2T.Rows.Count; i++)
                     {
-                        continue;
+                        if (ls_PicSYXT2T.Rows[i][0] == null)
+                        {
+                            continue;
+                        }
+                        if (ls_PicSYXT2T.Rows[i][0] == DBNull.Value)
+                        {
+                            continue;
+                        }
+                        string ls_sqlstr = "insert into PicSYXT2T (pict,pict2) values(:pict,:pict2)";
+                        byte[] byte_p1 = (byte[])ls_PicSYXT2T.Rows[i][0];
+                        byte[] byte_p2 = (byte[])ls_PicSYXT2T.Rows[i][1];
+                        int iresult = sh.ExecuteQuery(ls_sqlstr, "pict", byte_p1, "pict2", byte_p2, tr);
                     }
-                    if (ls_PicSYXT2T.Rows[i][0] == DBNull.Value)
-                    {
-                        continue;
-                    }
-                    string ls_sqlstr = "insert into PicSYXT2T (pict,pict2) values(:pict,:pict2)";
-                    byte[] byte_p1 = (byte[])ls_PicSYXT2T.Rows[i][0];
-                    byte[] byte_p2 = (byte[])ls_PicSYXT2T.Rows[i][1];
-                    int iresult = sh.ExecuteQuery(ls_sqlstr, "pict", byte_p1, "pict2", byte_p2, tr);
                 }
+                
 
                 //插入 PicSYXT3T
-                DataTable ls_PicSYXT3T = list_dt.Where(aa => aa.TableName.Contains("PicSYXT3T")).ToList()[0];
-                for (int i = 0; i < ls_PicSYXT3T.Rows.Count; i++)
+                if (JudgeWhetherTheTableExists(list_dt, "PicSYXT3T"))
                 {
-                    if (ls_PicSYXT3T.Rows[i][0] == null)
-                    {
-                        continue;
-                    }
-                    if (ls_PicSYXT3T.Rows[i][0] == DBNull.Value)
+                    sh.CreateTable("PicSYXT3T", strcolumns_PicSYXT3T, strcoltypes_PicSYXT3T);
+                    DataTable ls_PicSYXT3T = list_dt.Where(aa => aa.TableName.Contains("PicSYXT3T")).ToList()[0];
+                    for (int i = 0; i < ls_PicSYXT3T.Rows.Count; i++)
                     {
-                        continue;
+                        if (ls_PicSYXT3T.Rows[i][0] == null)
+                        {
+                            continue;
+                        }
+                        if (ls_PicSYXT3T.Rows[i][0] == DBNull.Value)
+                        {
+                            continue;
+                        }
+
+                        string ls_sqlstr = "insert into PicSYXT3T (pict,pict2,pict3) values(:pict,:pict2,:pict3)";
+                        byte[] byte_p1 = (byte[])ls_PicSYXT3T.Rows[i][0];
+                        byte[] byte_p2 = (byte[])ls_PicSYXT3T.Rows[i][1];
+                        byte[] byte_p3 = (byte[])ls_PicSYXT3T.Rows[i][2];
+                        int iresult = sh.ExecuteQuery(ls_sqlstr, "pict", byte_p1, "pict2", byte_p2, "pict3", byte_p3, tr);
                     }
-
-                    string ls_sqlstr = "insert into PicSYXT3T (pict,pict2,pict3) values(:pict,:pict2,:pict3)";
-                    byte[] byte_p1 = (byte[])ls_PicSYXT3T.Rows[i][0];
-                    byte[] byte_p2 = (byte[])ls_PicSYXT3T.Rows[i][1];
-                    byte[] byte_p3 = (byte[])ls_PicSYXT3T.Rows[i][2];
-                    int iresult = sh.ExecuteQuery(ls_sqlstr, "pict", byte_p1, "pict2", byte_p2, "pict3", byte_p3, tr);
                 }
+                
 
                 //事务提交
                 sh.TranscationCommit(tr);
@@ -1648,6 +1646,42 @@ namespace OTSIncAReportApp
                 sh.CloseConnection();
             }
         }
+       
+        private void DataTableSurfaceSaveToDB(List<DataTable> list_dt,string a_surfaceName,string a_DatatableSurfaceName, SqlHelper sh,string[] strcolumns,string[] strcoltypes, SQLiteTransaction tr)
+        {
+            sh.CreateTable(a_surfaceName, strcolumns, strcoltypes);
+            DataTable dt = list_dt.Where(aa => aa.TableName.Contains(a_DatatableSurfaceName)).ToList()[0];
+            string strcolumnsName = "";
+            for (int i = 0;i< strcolumns.Count();i++)
+            {
+                strcolumnsName = strcolumnsName + strcolumns[i].ToString();
+                if (i != strcolumns.Count() - 1)
+                    strcolumnsName = strcolumnsName + ",";
+            }
+            for (int i = 0; i < dt.Rows.Count; i++)
+            {
+                string ls_dtstr = "";
+                for(int a=0;a< strcolumns.Count();a++)
+                {
+                    ls_dtstr = ls_dtstr + dt.Rows[i][a].ToString();
+                    if (a != strcolumns.Count() - 1)
+                        ls_dtstr = ls_dtstr + "','";
+
+                }
+                string ls_sqlstr = "insert into "+ a_surfaceName+" ("+strcolumnsName+") values('"
+                   + ls_dtstr + "')";
+                sh.ExecuteQueryResult(ls_sqlstr, tr);
+            }
+        }
+        private bool JudgeWhetherTheTableExists(List<DataTable> list_dt,string str)
+        {
+            for (int i=0;i< list_dt.Count;i++)
+            {
+                if (list_dt[i].TableName.Contains(str))
+                    return true;
+            }
+            return false;
+        }
         #endregion
 
         #region 导出工作线程部份
@@ -1831,7 +1865,9 @@ namespace OTSIncAReportApp
                     }
                     if (ls_str.IndexOf(table["rictbox13"].ToString()) > -1)
                     {
-                        m_export_reporttemplate.InsertReportTemplateTable_ParticlesGridDevidePage();
+                        //判断颗粒列表是否导出
+                        if (m_mbszclass.M_KLLBXX.b_ck_kllb_xsmk)
+                            m_export_reporttemplate.InsertReportTemplateTable_ParticlesGridDevidePage();
                         lock (m_thread_flag)
                             m_thread_flag = strNill;
                     }
@@ -1853,7 +1889,7 @@ namespace OTSIncAReportApp
 
                     if (ls_str.IndexOf(table["rictbox26"].ToString()) > -1)
                     {
-                        m_export_reporttemplate.InsertReportTemplateChart_ParticlesCompositionChart(AnalyticGraphics(m_mbszclass.M_KLFXJG.index_cb_jzwfl_xstx));
+                        //m_export_reporttemplate.InsertReportTemplateChart_ParticlesCompositionChart(AnalyticGraphics(m_mbszclass.M_KLFXJG.index_cb_jzwfl_xstx));
                         lock (m_thread_flag)
                             m_thread_flag = strNill;
                     }
@@ -1866,7 +1902,8 @@ namespace OTSIncAReportApp
 
                     if (ls_str.IndexOf(table["rictbox34"].ToString()) > -1)
                     {
-                        m_export_reporttemplate.InsertReportTemplateChart_Trianglediagram();
+                        if (m_mbszclass.M_SYXT.b_ck_syxt_xsmk)
+                            m_export_reporttemplate.InsertReportTemplateChart_Trianglediagram();
                         lock (m_thread_flag)
                             m_thread_flag = strNill;
                     }

+ 20 - 419
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_TemplateDesignerRM.Designer.cs

@@ -51,45 +51,22 @@
             this.groupBox1 = new System.Windows.Forms.GroupBox();
             this.tb_ymwb = new System.Windows.Forms.TextBox();
             this.label8 = new System.Windows.Forms.Label();
-            this.groupBox3 = new System.Windows.Forms.GroupBox();
-            this.cb_jzwfl_xsmk = new System.Windows.Forms.CheckBox();
-            this.label18 = new System.Windows.Forms.Label();
-            this.cb_jzwfl_klfw = new System.Windows.Forms.ComboBox();
-            this.label13 = new System.Windows.Forms.Label();
-            this.cb_jzwfl_ljb = new System.Windows.Forms.ComboBox();
-            this.label19 = new System.Windows.Forms.Label();
-            this.cb_jzwfl_xstx = new System.Windows.Forms.ComboBox();
-            this.label12 = new System.Windows.Forms.Label();
             this.groupBox4 = new System.Windows.Forms.GroupBox();
             this.ck_klcc_xsmk = new System.Windows.Forms.CheckBox();
             this.label17 = new System.Windows.Forms.Label();
-            this.cb_klcc_klfw = new System.Windows.Forms.ComboBox();
             this.cb_klcc_ljb = new System.Windows.Forms.ComboBox();
             this.cb_klcc_jsfs = new System.Windows.Forms.ComboBox();
-            this.label16 = new System.Windows.Forms.Label();
             this.label15 = new System.Windows.Forms.Label();
             this.label14 = new System.Windows.Forms.Label();
             this.groupBox5 = new System.Windows.Forms.GroupBox();
-            this.button5 = new System.Windows.Forms.Button();
-            this.tb_yscf_ysxx = new System.Windows.Forms.TextBox();
             this.ck_yscf_xsmk = new System.Windows.Forms.CheckBox();
             this.label20 = new System.Windows.Forms.Label();
-            this.cb_yscf_klfw = new System.Windows.Forms.ComboBox();
-            this.label21 = new System.Windows.Forms.Label();
             this.label22 = new System.Windows.Forms.Label();
             this.cb_yscf_xstx = new System.Windows.Forms.ComboBox();
-            this.label24 = new System.Windows.Forms.Label();
             this.groupBox6 = new System.Windows.Forms.GroupBox();
-            this.button4 = new System.Windows.Forms.Button();
-            this.tb_ysfx_xsys = new System.Windows.Forms.TextBox();
             this.ck_ysfx_xsmk = new System.Windows.Forms.CheckBox();
             this.label25 = new System.Windows.Forms.Label();
-            this.cb_ysfx_klfw = new System.Windows.Forms.ComboBox();
-            this.label26 = new System.Windows.Forms.Label();
-            this.label27 = new System.Windows.Forms.Label();
             this.groupBox7 = new System.Windows.Forms.GroupBox();
-            this.cb_syxt_klfw = new System.Windows.Forms.ComboBox();
-            this.label41 = new System.Windows.Forms.Label();
             this.lbv_syxt_mblb = new System.Windows.Forms.ListView();
             this.ck_syxt_xsmk = new System.Windows.Forms.CheckBox();
             this.label40 = new System.Windows.Forms.Label();
@@ -99,9 +76,6 @@
             this.label33 = new System.Windows.Forms.Label();
             this.label42 = new System.Windows.Forms.Label();
             this.groupBox8 = new System.Windows.Forms.GroupBox();
-            this.button3 = new System.Windows.Forms.Button();
-            this.tb_kllb_ylsx = new System.Windows.Forms.TextBox();
-            this.tb_kllb_sxys = new System.Windows.Forms.TextBox();
             this.ck_kllb_npxx = new System.Windows.Forms.CheckBox();
             this.ck_kllb_fdtx = new System.Windows.Forms.CheckBox();
             this.ck_kllb_ystx = new System.Windows.Forms.CheckBox();
@@ -110,10 +84,6 @@
             this.label31 = new System.Windows.Forms.Label();
             this.label30 = new System.Windows.Forms.Label();
             this.label34 = new System.Windows.Forms.Label();
-            this.cb_kllb_klfw = new System.Windows.Forms.ComboBox();
-            this.label35 = new System.Windows.Forms.Label();
-            this.label29 = new System.Windows.Forms.Label();
-            this.label36 = new System.Windows.Forms.Label();
             this.button6 = new System.Windows.Forms.Button();
             this.panel2 = new System.Windows.Forms.Panel();
             this.label53 = new System.Windows.Forms.Label();
@@ -133,7 +103,6 @@
             this.groupBox9 = new System.Windows.Forms.GroupBox();
             this.label39 = new System.Windows.Forms.Label();
             this.groupBox1.SuspendLayout();
-            this.groupBox3.SuspendLayout();
             this.groupBox4.SuspendLayout();
             this.groupBox5.SuspendLayout();
             this.groupBox6.SuspendLayout();
@@ -378,121 +347,19 @@
             this.label8.TabIndex = 41;
             this.label8.Text = "页眉文本";
             // 
-            // groupBox3
-            // 
-            this.groupBox3.Controls.Add(this.cb_jzwfl_xsmk);
-            this.groupBox3.Controls.Add(this.label18);
-            this.groupBox3.Controls.Add(this.cb_jzwfl_klfw);
-            this.groupBox3.Controls.Add(this.label13);
-            this.groupBox3.Controls.Add(this.cb_jzwfl_ljb);
-            this.groupBox3.Controls.Add(this.label19);
-            this.groupBox3.Controls.Add(this.cb_jzwfl_xstx);
-            this.groupBox3.Controls.Add(this.label12);
-            this.groupBox3.Location = new System.Drawing.Point(3, 648);
-            this.groupBox3.Margin = new System.Windows.Forms.Padding(2);
-            this.groupBox3.Name = "groupBox3";
-            this.groupBox3.Padding = new System.Windows.Forms.Padding(2);
-            this.groupBox3.Size = new System.Drawing.Size(268, 215);
-            this.groupBox3.TabIndex = 1;
-            this.groupBox3.TabStop = false;
-            this.groupBox3.Text = "夹杂物分类图";
-            // 
-            // cb_jzwfl_xsmk
-            // 
-            this.cb_jzwfl_xsmk.AutoSize = true;
-            this.cb_jzwfl_xsmk.Location = new System.Drawing.Point(224, 18);
-            this.cb_jzwfl_xsmk.Margin = new System.Windows.Forms.Padding(2);
-            this.cb_jzwfl_xsmk.Name = "cb_jzwfl_xsmk";
-            this.cb_jzwfl_xsmk.Size = new System.Drawing.Size(15, 14);
-            this.cb_jzwfl_xsmk.TabIndex = 53;
-            this.cb_jzwfl_xsmk.UseVisualStyleBackColor = true;
-            this.cb_jzwfl_xsmk.CheckedChanged += new System.EventHandler(this.cb_jzwfl_xsmk_CheckedChanged);
-            // 
-            // label18
-            // 
-            this.label18.AutoSize = true;
-            this.label18.Location = new System.Drawing.Point(7, 20);
-            this.label18.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label18.Name = "label18";
-            this.label18.Size = new System.Drawing.Size(65, 12);
-            this.label18.TabIndex = 52;
-            this.label18.Text = "显示该模块";
-            // 
-            // cb_jzwfl_klfw
-            // 
-            this.cb_jzwfl_klfw.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.cb_jzwfl_klfw.FormattingEnabled = true;
-            this.cb_jzwfl_klfw.Location = new System.Drawing.Point(19, 170);
-            this.cb_jzwfl_klfw.Margin = new System.Windows.Forms.Padding(2);
-            this.cb_jzwfl_klfw.Name = "cb_jzwfl_klfw";
-            this.cb_jzwfl_klfw.Size = new System.Drawing.Size(216, 20);
-            this.cb_jzwfl_klfw.TabIndex = 42;
-            // 
-            // label13
-            // 
-            this.label13.AutoSize = true;
-            this.label13.Location = new System.Drawing.Point(19, 152);
-            this.label13.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label13.Name = "label13";
-            this.label13.Size = new System.Drawing.Size(53, 12);
-            this.label13.TabIndex = 41;
-            this.label13.Text = "颗粒范围";
-            // 
-            // cb_jzwfl_ljb
-            // 
-            this.cb_jzwfl_ljb.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.cb_jzwfl_ljb.FormattingEnabled = true;
-            this.cb_jzwfl_ljb.Location = new System.Drawing.Point(19, 112);
-            this.cb_jzwfl_ljb.Margin = new System.Windows.Forms.Padding(2);
-            this.cb_jzwfl_ljb.Name = "cb_jzwfl_ljb";
-            this.cb_jzwfl_ljb.Size = new System.Drawing.Size(216, 20);
-            this.cb_jzwfl_ljb.TabIndex = 42;
-            // 
-            // label19
-            // 
-            this.label19.AutoSize = true;
-            this.label19.Location = new System.Drawing.Point(19, 47);
-            this.label19.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label19.Name = "label19";
-            this.label19.Size = new System.Drawing.Size(53, 12);
-            this.label19.TabIndex = 41;
-            this.label19.Text = "显示图形";
-            // 
-            // cb_jzwfl_xstx
-            // 
-            this.cb_jzwfl_xstx.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.cb_jzwfl_xstx.FormattingEnabled = true;
-            this.cb_jzwfl_xstx.Location = new System.Drawing.Point(19, 61);
-            this.cb_jzwfl_xstx.Margin = new System.Windows.Forms.Padding(2);
-            this.cb_jzwfl_xstx.Name = "cb_jzwfl_xstx";
-            this.cb_jzwfl_xstx.Size = new System.Drawing.Size(216, 20);
-            this.cb_jzwfl_xstx.TabIndex = 42;
-            // 
-            // label12
-            // 
-            this.label12.AutoSize = true;
-            this.label12.Location = new System.Drawing.Point(17, 98);
-            this.label12.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label12.Name = "label12";
-            this.label12.Size = new System.Drawing.Size(65, 12);
-            this.label12.TabIndex = 41;
-            this.label12.Text = "粒级表信息";
-            // 
             // groupBox4
             // 
             this.groupBox4.Controls.Add(this.ck_klcc_xsmk);
             this.groupBox4.Controls.Add(this.label17);
-            this.groupBox4.Controls.Add(this.cb_klcc_klfw);
             this.groupBox4.Controls.Add(this.cb_klcc_ljb);
             this.groupBox4.Controls.Add(this.cb_klcc_jsfs);
-            this.groupBox4.Controls.Add(this.label16);
             this.groupBox4.Controls.Add(this.label15);
             this.groupBox4.Controls.Add(this.label14);
             this.groupBox4.Location = new System.Drawing.Point(3, 448);
             this.groupBox4.Margin = new System.Windows.Forms.Padding(2);
             this.groupBox4.Name = "groupBox4";
             this.groupBox4.Padding = new System.Windows.Forms.Padding(2);
-            this.groupBox4.Size = new System.Drawing.Size(268, 196);
+            this.groupBox4.Size = new System.Drawing.Size(268, 158);
             this.groupBox4.TabIndex = 2;
             this.groupBox4.TabStop = false;
             this.groupBox4.Text = "颗粒尺寸分析结果";
@@ -518,16 +385,6 @@
             this.label17.TabIndex = 52;
             this.label17.Text = "显示该模块";
             // 
-            // cb_klcc_klfw
-            // 
-            this.cb_klcc_klfw.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.cb_klcc_klfw.FormattingEnabled = true;
-            this.cb_klcc_klfw.Location = new System.Drawing.Point(19, 161);
-            this.cb_klcc_klfw.Margin = new System.Windows.Forms.Padding(2);
-            this.cb_klcc_klfw.Name = "cb_klcc_klfw";
-            this.cb_klcc_klfw.Size = new System.Drawing.Size(216, 20);
-            this.cb_klcc_klfw.TabIndex = 42;
-            // 
             // cb_klcc_ljb
             // 
             this.cb_klcc_ljb.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
@@ -548,16 +405,6 @@
             this.cb_klcc_jsfs.Size = new System.Drawing.Size(216, 20);
             this.cb_klcc_jsfs.TabIndex = 42;
             // 
-            // label16
-            // 
-            this.label16.AutoSize = true;
-            this.label16.Location = new System.Drawing.Point(17, 147);
-            this.label16.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label16.Name = "label16";
-            this.label16.Size = new System.Drawing.Size(53, 12);
-            this.label16.TabIndex = 41;
-            this.label16.Text = "颗粒范围";
-            // 
             // label15
             // 
             this.label15.AutoSize = true;
@@ -580,46 +427,19 @@
             // 
             // groupBox5
             // 
-            this.groupBox5.Controls.Add(this.button5);
-            this.groupBox5.Controls.Add(this.tb_yscf_ysxx);
             this.groupBox5.Controls.Add(this.ck_yscf_xsmk);
             this.groupBox5.Controls.Add(this.label20);
-            this.groupBox5.Controls.Add(this.cb_yscf_klfw);
-            this.groupBox5.Controls.Add(this.label21);
             this.groupBox5.Controls.Add(this.label22);
             this.groupBox5.Controls.Add(this.cb_yscf_xstx);
-            this.groupBox5.Controls.Add(this.label24);
-            this.groupBox5.Location = new System.Drawing.Point(8, 1032);
+            this.groupBox5.Location = new System.Drawing.Point(3, 701);
             this.groupBox5.Margin = new System.Windows.Forms.Padding(2);
             this.groupBox5.Name = "groupBox5";
             this.groupBox5.Padding = new System.Windows.Forms.Padding(2);
-            this.groupBox5.Size = new System.Drawing.Size(263, 205);
+            this.groupBox5.Size = new System.Drawing.Size(263, 112);
             this.groupBox5.TabIndex = 3;
             this.groupBox5.TabStop = false;
             this.groupBox5.Text = "元素成份图";
             // 
-            // button5
-            // 
-            this.button5.Location = new System.Drawing.Point(193, 167);
-            this.button5.Margin = new System.Windows.Forms.Padding(2);
-            this.button5.Name = "button5";
-            this.button5.Size = new System.Drawing.Size(37, 19);
-            this.button5.TabIndex = 56;
-            this.button5.Text = "...";
-            this.button5.UseVisualStyleBackColor = true;
-            this.button5.Visible = false;
-            this.button5.Click += new System.EventHandler(this.button5_Click);
-            // 
-            // tb_yscf_ysxx
-            // 
-            this.tb_yscf_ysxx.Location = new System.Drawing.Point(16, 165);
-            this.tb_yscf_ysxx.Margin = new System.Windows.Forms.Padding(2);
-            this.tb_yscf_ysxx.Name = "tb_yscf_ysxx";
-            this.tb_yscf_ysxx.ReadOnly = true;
-            this.tb_yscf_ysxx.Size = new System.Drawing.Size(173, 21);
-            this.tb_yscf_ysxx.TabIndex = 54;
-            this.tb_yscf_ysxx.Visible = false;
-            // 
             // ck_yscf_xsmk
             // 
             this.ck_yscf_xsmk.AutoSize = true;
@@ -641,30 +461,10 @@
             this.label20.TabIndex = 52;
             this.label20.Text = "显示该模块";
             // 
-            // cb_yscf_klfw
-            // 
-            this.cb_yscf_klfw.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.cb_yscf_klfw.FormattingEnabled = true;
-            this.cb_yscf_klfw.Location = new System.Drawing.Point(14, 109);
-            this.cb_yscf_klfw.Margin = new System.Windows.Forms.Padding(2);
-            this.cb_yscf_klfw.Name = "cb_yscf_klfw";
-            this.cb_yscf_klfw.Size = new System.Drawing.Size(214, 20);
-            this.cb_yscf_klfw.TabIndex = 42;
-            // 
-            // label21
-            // 
-            this.label21.AutoSize = true;
-            this.label21.Location = new System.Drawing.Point(12, 95);
-            this.label21.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label21.Name = "label21";
-            this.label21.Size = new System.Drawing.Size(53, 12);
-            this.label21.TabIndex = 41;
-            this.label21.Text = "颗粒范围";
-            // 
             // label22
             // 
             this.label22.AutoSize = true;
-            this.label22.Location = new System.Drawing.Point(14, 45);
+            this.label22.Location = new System.Drawing.Point(12, 53);
             this.label22.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label22.Name = "label22";
             this.label22.Size = new System.Drawing.Size(53, 12);
@@ -675,61 +475,25 @@
             // 
             this.cb_yscf_xstx.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.cb_yscf_xstx.FormattingEnabled = true;
-            this.cb_yscf_xstx.Location = new System.Drawing.Point(16, 59);
+            this.cb_yscf_xstx.Location = new System.Drawing.Point(14, 67);
             this.cb_yscf_xstx.Margin = new System.Windows.Forms.Padding(2);
             this.cb_yscf_xstx.Name = "cb_yscf_xstx";
             this.cb_yscf_xstx.Size = new System.Drawing.Size(214, 20);
             this.cb_yscf_xstx.TabIndex = 42;
             // 
-            // label24
-            // 
-            this.label24.AutoSize = true;
-            this.label24.Location = new System.Drawing.Point(14, 151);
-            this.label24.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label24.Name = "label24";
-            this.label24.Size = new System.Drawing.Size(53, 12);
-            this.label24.TabIndex = 41;
-            this.label24.Text = "元素信息";
-            this.label24.Visible = false;
-            // 
             // groupBox6
             // 
-            this.groupBox6.Controls.Add(this.button4);
-            this.groupBox6.Controls.Add(this.tb_ysfx_xsys);
             this.groupBox6.Controls.Add(this.ck_ysfx_xsmk);
             this.groupBox6.Controls.Add(this.label25);
-            this.groupBox6.Controls.Add(this.cb_ysfx_klfw);
-            this.groupBox6.Controls.Add(this.label26);
-            this.groupBox6.Controls.Add(this.label27);
-            this.groupBox6.Location = new System.Drawing.Point(3, 867);
+            this.groupBox6.Location = new System.Drawing.Point(3, 614);
             this.groupBox6.Margin = new System.Windows.Forms.Padding(2);
             this.groupBox6.Name = "groupBox6";
             this.groupBox6.Padding = new System.Windows.Forms.Padding(2);
-            this.groupBox6.Size = new System.Drawing.Size(268, 156);
+            this.groupBox6.Size = new System.Drawing.Size(268, 72);
             this.groupBox6.TabIndex = 4;
             this.groupBox6.TabStop = false;
             this.groupBox6.Text = "元素分析表";
             // 
-            // button4
-            // 
-            this.button4.Location = new System.Drawing.Point(196, 114);
-            this.button4.Margin = new System.Windows.Forms.Padding(2);
-            this.button4.Name = "button4";
-            this.button4.Size = new System.Drawing.Size(37, 19);
-            this.button4.TabIndex = 56;
-            this.button4.Text = "...";
-            this.button4.UseVisualStyleBackColor = true;
-            this.button4.Click += new System.EventHandler(this.button4_Click);
-            // 
-            // tb_ysfx_xsys
-            // 
-            this.tb_ysfx_xsys.Location = new System.Drawing.Point(19, 114);
-            this.tb_ysfx_xsys.Margin = new System.Windows.Forms.Padding(2);
-            this.tb_ysfx_xsys.Name = "tb_ysfx_xsys";
-            this.tb_ysfx_xsys.ReadOnly = true;
-            this.tb_ysfx_xsys.Size = new System.Drawing.Size(173, 21);
-            this.tb_ysfx_xsys.TabIndex = 54;
-            // 
             // ck_ysfx_xsmk
             // 
             this.ck_ysfx_xsmk.AutoSize = true;
@@ -751,40 +515,8 @@
             this.label25.TabIndex = 52;
             this.label25.Text = "显示该模块";
             // 
-            // cb_ysfx_klfw
-            // 
-            this.cb_ysfx_klfw.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.cb_ysfx_klfw.FormattingEnabled = true;
-            this.cb_ysfx_klfw.Location = new System.Drawing.Point(19, 64);
-            this.cb_ysfx_klfw.Margin = new System.Windows.Forms.Padding(2);
-            this.cb_ysfx_klfw.Name = "cb_ysfx_klfw";
-            this.cb_ysfx_klfw.Size = new System.Drawing.Size(214, 20);
-            this.cb_ysfx_klfw.TabIndex = 42;
-            // 
-            // label26
-            // 
-            this.label26.AutoSize = true;
-            this.label26.Location = new System.Drawing.Point(17, 50);
-            this.label26.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label26.Name = "label26";
-            this.label26.Size = new System.Drawing.Size(53, 12);
-            this.label26.TabIndex = 41;
-            this.label26.Text = "颗粒范围";
-            // 
-            // label27
-            // 
-            this.label27.AutoSize = true;
-            this.label27.Location = new System.Drawing.Point(17, 100);
-            this.label27.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label27.Name = "label27";
-            this.label27.Size = new System.Drawing.Size(53, 12);
-            this.label27.TabIndex = 41;
-            this.label27.Text = "显示元素";
-            // 
             // groupBox7
             // 
-            this.groupBox7.Controls.Add(this.cb_syxt_klfw);
-            this.groupBox7.Controls.Add(this.label41);
             this.groupBox7.Controls.Add(this.lbv_syxt_mblb);
             this.groupBox7.Controls.Add(this.ck_syxt_xsmk);
             this.groupBox7.Controls.Add(this.label40);
@@ -793,7 +525,7 @@
             this.groupBox7.Controls.Add(this.label38);
             this.groupBox7.Controls.Add(this.label33);
             this.groupBox7.Controls.Add(this.label42);
-            this.groupBox7.Location = new System.Drawing.Point(8, 1241);
+            this.groupBox7.Location = new System.Drawing.Point(3, 827);
             this.groupBox7.Margin = new System.Windows.Forms.Padding(2);
             this.groupBox7.Name = "groupBox7";
             this.groupBox7.Padding = new System.Windows.Forms.Padding(2);
@@ -802,26 +534,6 @@
             this.groupBox7.TabStop = false;
             this.groupBox7.Text = "三元相图";
             // 
-            // cb_syxt_klfw
-            // 
-            this.cb_syxt_klfw.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.cb_syxt_klfw.FormattingEnabled = true;
-            this.cb_syxt_klfw.Location = new System.Drawing.Point(16, 63);
-            this.cb_syxt_klfw.Margin = new System.Windows.Forms.Padding(2);
-            this.cb_syxt_klfw.Name = "cb_syxt_klfw";
-            this.cb_syxt_klfw.Size = new System.Drawing.Size(214, 20);
-            this.cb_syxt_klfw.TabIndex = 42;
-            // 
-            // label41
-            // 
-            this.label41.AutoSize = true;
-            this.label41.Location = new System.Drawing.Point(14, 49);
-            this.label41.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label41.Name = "label41";
-            this.label41.Size = new System.Drawing.Size(53, 12);
-            this.label41.TabIndex = 41;
-            this.label41.Text = "颗粒范围";
-            // 
             // lbv_syxt_mblb
             // 
             this.lbv_syxt_mblb.CheckBoxes = true;
@@ -860,7 +572,7 @@
             // 
             this.cb_syxt_ljb.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.cb_syxt_ljb.FormattingEnabled = true;
-            this.cb_syxt_ljb.Location = new System.Drawing.Point(14, 112);
+            this.cb_syxt_ljb.Location = new System.Drawing.Point(14, 73);
             this.cb_syxt_ljb.Margin = new System.Windows.Forms.Padding(2);
             this.cb_syxt_ljb.Name = "cb_syxt_ljb";
             this.cb_syxt_ljb.Size = new System.Drawing.Size(214, 20);
@@ -870,7 +582,7 @@
             // 
             this.cb_syxt_mhxssl.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.cb_syxt_mhxssl.FormattingEnabled = true;
-            this.cb_syxt_mhxssl.Location = new System.Drawing.Point(14, 167);
+            this.cb_syxt_mhxssl.Location = new System.Drawing.Point(14, 150);
             this.cb_syxt_mhxssl.Margin = new System.Windows.Forms.Padding(2);
             this.cb_syxt_mhxssl.Name = "cb_syxt_mhxssl";
             this.cb_syxt_mhxssl.Size = new System.Drawing.Size(214, 20);
@@ -880,7 +592,7 @@
             // label38
             // 
             this.label38.AutoSize = true;
-            this.label38.Location = new System.Drawing.Point(12, 98);
+            this.label38.Location = new System.Drawing.Point(12, 59);
             this.label38.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label38.Name = "label38";
             this.label38.Size = new System.Drawing.Size(65, 12);
@@ -900,7 +612,7 @@
             // label42
             // 
             this.label42.AutoSize = true;
-            this.label42.Location = new System.Drawing.Point(12, 153);
+            this.label42.Location = new System.Drawing.Point(12, 136);
             this.label42.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label42.Name = "label42";
             this.label42.Size = new System.Drawing.Size(77, 12);
@@ -909,9 +621,6 @@
             // 
             // groupBox8
             // 
-            this.groupBox8.Controls.Add(this.button3);
-            this.groupBox8.Controls.Add(this.tb_kllb_ylsx);
-            this.groupBox8.Controls.Add(this.tb_kllb_sxys);
             this.groupBox8.Controls.Add(this.ck_kllb_npxx);
             this.groupBox8.Controls.Add(this.ck_kllb_fdtx);
             this.groupBox8.Controls.Add(this.ck_kllb_ystx);
@@ -920,53 +629,19 @@
             this.groupBox8.Controls.Add(this.label31);
             this.groupBox8.Controls.Add(this.label30);
             this.groupBox8.Controls.Add(this.label34);
-            this.groupBox8.Controls.Add(this.cb_kllb_klfw);
-            this.groupBox8.Controls.Add(this.label35);
-            this.groupBox8.Controls.Add(this.label29);
-            this.groupBox8.Controls.Add(this.label36);
-            this.groupBox8.Location = new System.Drawing.Point(8, 1757);
+            this.groupBox8.Location = new System.Drawing.Point(3, 1340);
             this.groupBox8.Margin = new System.Windows.Forms.Padding(2);
             this.groupBox8.Name = "groupBox8";
             this.groupBox8.Padding = new System.Windows.Forms.Padding(2);
-            this.groupBox8.Size = new System.Drawing.Size(263, 301);
+            this.groupBox8.Size = new System.Drawing.Size(263, 159);
             this.groupBox8.TabIndex = 6;
             this.groupBox8.TabStop = false;
             this.groupBox8.Text = "颗粒列表";
             // 
-            // button3
-            // 
-            this.button3.Location = new System.Drawing.Point(195, 168);
-            this.button3.Margin = new System.Windows.Forms.Padding(2);
-            this.button3.Name = "button3";
-            this.button3.Size = new System.Drawing.Size(37, 19);
-            this.button3.TabIndex = 55;
-            this.button3.Text = "...";
-            this.button3.UseVisualStyleBackColor = true;
-            this.button3.Visible = false;
-            this.button3.Click += new System.EventHandler(this.button3_Click);
-            // 
-            // tb_kllb_ylsx
-            // 
-            this.tb_kllb_ylsx.Location = new System.Drawing.Point(16, 114);
-            this.tb_kllb_ylsx.Margin = new System.Windows.Forms.Padding(2);
-            this.tb_kllb_ylsx.Name = "tb_kllb_ylsx";
-            this.tb_kllb_ylsx.Size = new System.Drawing.Size(214, 21);
-            this.tb_kllb_ylsx.TabIndex = 54;
-            // 
-            // tb_kllb_sxys
-            // 
-            this.tb_kllb_sxys.Location = new System.Drawing.Point(18, 166);
-            this.tb_kllb_sxys.Margin = new System.Windows.Forms.Padding(2);
-            this.tb_kllb_sxys.Name = "tb_kllb_sxys";
-            this.tb_kllb_sxys.ReadOnly = true;
-            this.tb_kllb_sxys.Size = new System.Drawing.Size(173, 21);
-            this.tb_kllb_sxys.TabIndex = 54;
-            this.tb_kllb_sxys.Visible = false;
-            // 
             // ck_kllb_npxx
             // 
             this.ck_kllb_npxx.AutoSize = true;
-            this.ck_kllb_npxx.Location = new System.Drawing.Point(224, 239);
+            this.ck_kllb_npxx.Location = new System.Drawing.Point(224, 118);
             this.ck_kllb_npxx.Margin = new System.Windows.Forms.Padding(2);
             this.ck_kllb_npxx.Name = "ck_kllb_npxx";
             this.ck_kllb_npxx.Size = new System.Drawing.Size(15, 14);
@@ -977,7 +652,7 @@
             // ck_kllb_fdtx
             // 
             this.ck_kllb_fdtx.AutoSize = true;
-            this.ck_kllb_fdtx.Location = new System.Drawing.Point(224, 213);
+            this.ck_kllb_fdtx.Location = new System.Drawing.Point(224, 90);
             this.ck_kllb_fdtx.Margin = new System.Windows.Forms.Padding(2);
             this.ck_kllb_fdtx.Name = "ck_kllb_fdtx";
             this.ck_kllb_fdtx.Size = new System.Drawing.Size(15, 14);
@@ -988,7 +663,7 @@
             // ck_kllb_ystx
             // 
             this.ck_kllb_ystx.AutoSize = true;
-            this.ck_kllb_ystx.Location = new System.Drawing.Point(224, 187);
+            this.ck_kllb_ystx.Location = new System.Drawing.Point(224, 64);
             this.ck_kllb_ystx.Margin = new System.Windows.Forms.Padding(2);
             this.ck_kllb_ystx.Name = "ck_kllb_ystx";
             this.ck_kllb_ystx.Size = new System.Drawing.Size(15, 14);
@@ -1010,7 +685,7 @@
             // label32
             // 
             this.label32.AutoSize = true;
-            this.label32.Location = new System.Drawing.Point(16, 241);
+            this.label32.Location = new System.Drawing.Point(16, 118);
             this.label32.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label32.Name = "label32";
             this.label32.Size = new System.Drawing.Size(53, 12);
@@ -1020,7 +695,7 @@
             // label31
             // 
             this.label31.AutoSize = true;
-            this.label31.Location = new System.Drawing.Point(14, 215);
+            this.label31.Location = new System.Drawing.Point(14, 92);
             this.label31.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label31.Name = "label31";
             this.label31.Size = new System.Drawing.Size(53, 12);
@@ -1030,7 +705,7 @@
             // label30
             // 
             this.label30.AutoSize = true;
-            this.label30.Location = new System.Drawing.Point(14, 189);
+            this.label30.Location = new System.Drawing.Point(14, 66);
             this.label30.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label30.Name = "label30";
             this.label30.Size = new System.Drawing.Size(53, 12);
@@ -1047,47 +722,6 @@
             this.label34.TabIndex = 52;
             this.label34.Text = "显示该模块";
             // 
-            // cb_kllb_klfw
-            // 
-            this.cb_kllb_klfw.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.cb_kllb_klfw.FormattingEnabled = true;
-            this.cb_kllb_klfw.Location = new System.Drawing.Point(14, 63);
-            this.cb_kllb_klfw.Margin = new System.Windows.Forms.Padding(2);
-            this.cb_kllb_klfw.Name = "cb_kllb_klfw";
-            this.cb_kllb_klfw.Size = new System.Drawing.Size(214, 20);
-            this.cb_kllb_klfw.TabIndex = 42;
-            // 
-            // label35
-            // 
-            this.label35.AutoSize = true;
-            this.label35.Location = new System.Drawing.Point(12, 49);
-            this.label35.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label35.Name = "label35";
-            this.label35.Size = new System.Drawing.Size(53, 12);
-            this.label35.TabIndex = 41;
-            this.label35.Text = "颗粒范围";
-            // 
-            // label29
-            // 
-            this.label29.AutoSize = true;
-            this.label29.Location = new System.Drawing.Point(14, 100);
-            this.label29.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label29.Name = "label29";
-            this.label29.Size = new System.Drawing.Size(53, 12);
-            this.label29.TabIndex = 41;
-            this.label29.Text = "数量上限";
-            // 
-            // label36
-            // 
-            this.label36.AutoSize = true;
-            this.label36.Location = new System.Drawing.Point(16, 152);
-            this.label36.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.label36.Name = "label36";
-            this.label36.Size = new System.Drawing.Size(53, 12);
-            this.label36.TabIndex = 41;
-            this.label36.Text = "显示元素";
-            this.label36.Visible = false;
-            // 
             // button6
             // 
             this.button6.Location = new System.Drawing.Point(855, 47);
@@ -1248,7 +882,6 @@
             this.panel3.Controls.Add(this.groupBox7);
             this.panel3.Controls.Add(this.groupBox5);
             this.panel3.Controls.Add(this.groupBox8);
-            this.panel3.Controls.Add(this.groupBox3);
             this.panel3.Controls.Add(this.groupBox6);
             this.panel3.Controls.Add(this.groupBox9);
             this.panel3.Controls.Add(this.groupBox4);
@@ -1312,8 +945,6 @@
             this.Load += new System.EventHandler(this.OTSReport_TemplateDesignerRM_Load);
             this.groupBox1.ResumeLayout(false);
             this.groupBox1.PerformLayout();
-            this.groupBox3.ResumeLayout(false);
-            this.groupBox3.PerformLayout();
             this.groupBox4.ResumeLayout(false);
             this.groupBox4.PerformLayout();
             this.groupBox5.ResumeLayout(false);
@@ -1364,50 +995,27 @@
         private System.Windows.Forms.Label label9;
         private System.Windows.Forms.TextBox tb_ymwb;
         private System.Windows.Forms.Label label8;
-        private System.Windows.Forms.GroupBox groupBox3;
-        private System.Windows.Forms.CheckBox cb_jzwfl_xsmk;
-        private System.Windows.Forms.Label label18;
-        private System.Windows.Forms.ComboBox cb_jzwfl_klfw;
-        private System.Windows.Forms.Label label13;
-        private System.Windows.Forms.ComboBox cb_jzwfl_ljb;
-        private System.Windows.Forms.Label label19;
-        private System.Windows.Forms.ComboBox cb_jzwfl_xstx;
-        private System.Windows.Forms.Label label12;
         private System.Windows.Forms.GroupBox groupBox4;
         private System.Windows.Forms.CheckBox ck_klcc_xsmk;
         private System.Windows.Forms.Label label17;
-        private System.Windows.Forms.ComboBox cb_klcc_klfw;
         private System.Windows.Forms.ComboBox cb_klcc_ljb;
         private System.Windows.Forms.ComboBox cb_klcc_jsfs;
-        private System.Windows.Forms.Label label16;
         private System.Windows.Forms.Label label15;
         private System.Windows.Forms.Label label14;
         private System.Windows.Forms.GroupBox groupBox5;
-        private System.Windows.Forms.TextBox tb_yscf_ysxx;
         private System.Windows.Forms.CheckBox ck_yscf_xsmk;
         private System.Windows.Forms.Label label20;
-        private System.Windows.Forms.ComboBox cb_yscf_klfw;
-        private System.Windows.Forms.Label label21;
         private System.Windows.Forms.Label label22;
         private System.Windows.Forms.ComboBox cb_yscf_xstx;
-        private System.Windows.Forms.Label label24;
         private System.Windows.Forms.GroupBox groupBox6;
-        private System.Windows.Forms.TextBox tb_ysfx_xsys;
         private System.Windows.Forms.CheckBox ck_ysfx_xsmk;
         private System.Windows.Forms.Label label25;
-        private System.Windows.Forms.ComboBox cb_ysfx_klfw;
-        private System.Windows.Forms.Label label26;
-        private System.Windows.Forms.Label label27;
         private System.Windows.Forms.GroupBox groupBox7;
         private System.Windows.Forms.CheckBox ck_syxt_xsmk;
         private System.Windows.Forms.Label label40;
         private System.Windows.Forms.ComboBox cb_syxt_mhxssl;
-        private System.Windows.Forms.ComboBox cb_syxt_klfw;
-        private System.Windows.Forms.Label label41;
         private System.Windows.Forms.Label label42;
         private System.Windows.Forms.GroupBox groupBox8;
-        private System.Windows.Forms.TextBox tb_kllb_ylsx;
-        private System.Windows.Forms.TextBox tb_kllb_sxys;
         private System.Windows.Forms.CheckBox ck_kllb_npxx;
         private System.Windows.Forms.CheckBox ck_kllb_fdtx;
         private System.Windows.Forms.CheckBox ck_kllb_ystx;
@@ -1416,15 +1024,8 @@
         private System.Windows.Forms.Label label31;
         private System.Windows.Forms.Label label30;
         private System.Windows.Forms.Label label34;
-        private System.Windows.Forms.ComboBox cb_kllb_klfw;
-        private System.Windows.Forms.Label label35;
-        private System.Windows.Forms.Label label29;
-        private System.Windows.Forms.Label label36;
         private System.Windows.Forms.CheckBox ck_ym;
-        private System.Windows.Forms.Button button5;
-        private System.Windows.Forms.Button button4;
         private System.Windows.Forms.Label label33;
-        private System.Windows.Forms.Button button3;
         private System.Windows.Forms.ListView lbv_syxt_mblb;
         private System.Windows.Forms.ComboBox cb_syxt_ljb;
         private System.Windows.Forms.Label label38;

+ 71 - 71
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_TemplateDesignerRM.cs

@@ -55,26 +55,26 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             BindComboBox(cb_klcc_ljb, OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE);
             //颗粒范围
             //BindComboBox(DisplayPicutureType.AnalyzeDataTable, cb_klcc_klfw, OTS_RETORT_PROP_GRID_ITEMS.CALCULATE_TABLE_TYPE, (int)CALCULATE_TABLE_TYPE.PARTICALE_GENE_INFO, OTS_RETORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
-            BindComboBox(cb_klcc_klfw, OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
+            //BindComboBox(cb_klcc_klfw, OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
             #endregion
 
             #region 夹杂物分类图
             //显示图形
-            cb_jzwfl_xstx.Items.Add(table["report1"].ToString());
-            cb_jzwfl_xstx.Items.Add(table["report2"].ToString());
-            cb_jzwfl_xstx.Items.Add(table["report3"].ToString());
-            cb_jzwfl_xstx.Items.Add(table["report4"].ToString());
-            cb_jzwfl_xstx.Items.Add(table["report5"].ToString());
-            cb_jzwfl_xstx.SelectedIndex = 0;
+            //cb_jzwfl_xstx.Items.Add(table["report1"].ToString());
+            //cb_jzwfl_xstx.Items.Add(table["report2"].ToString());
+            //cb_jzwfl_xstx.Items.Add(table["report3"].ToString());
+            //cb_jzwfl_xstx.Items.Add(table["report4"].ToString());
+            //cb_jzwfl_xstx.Items.Add(table["report5"].ToString());
+            //cb_jzwfl_xstx.SelectedIndex = 0;
             //计算方式
             //BindComboBox(DisplayPicutureType.AnalyzeDataChart, cb_jzwfl_jsfs, OTS_RETORT_PROP_GRID_ITEMS.CALCULATE_CHART_TYPE, (int)CALCULATE_CHART_TYPE.TRIO_CHART, OTS_RETORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE);
             //BindComboBox(cb_jzwfl_jsfs, OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE);
             //粒级表
             //BindComboBox(DisplayPicutureType.AnalyzeDataChart, cb_jzwfl_ljb, OTS_RETORT_PROP_GRID_ITEMS.CALCULATE_CHART_TYPE, (int)CALCULATE_CHART_TYPE.TRIO_CHART, OTS_RETORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE);
-            BindComboBox(cb_jzwfl_ljb, OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE);
+            //BindComboBox(cb_jzwfl_ljb, OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE);
             //颗粒范围
             //BindComboBox(DisplayPicutureType.AnalyzeDataTable, cb_jzwfl_klfw, OTS_RETORT_PROP_GRID_ITEMS.CALCULATE_TABLE_TYPE, (int)CALCULATE_TABLE_TYPE.PARTICALE_GENE_INFO, OTS_RETORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
-            BindComboBox(cb_jzwfl_klfw, OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
+            //BindComboBox(cb_jzwfl_klfw, OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
             #endregion
 
             #region 元素分析表
@@ -83,7 +83,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             //BindComboBox(cb_yxfx_jsfs, OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE);
             //颗粒范围
             //BindComboBox(DisplayPicutureType.AnalyzeDataTable, cb_ysfx_klfw, OTS_RETORT_PROP_GRID_ITEMS.CALCULATE_TABLE_TYPE, (int)CALCULATE_TABLE_TYPE.PARTICALE_GENE_INFO, OTS_RETORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
-            BindComboBox(cb_ysfx_klfw, OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
+            //BindComboBox(cb_ysfx_klfw, OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
             #endregion
 
             #region 元素成份图
@@ -99,7 +99,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             //BindComboBox(cb_yscf_jsfs, OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE);
             //颗粒范围
             //BindComboBox(DisplayPicutureType.AnalyzeDataTable, cb_yscf_klfw, OTS_RETORT_PROP_GRID_ITEMS.CALCULATE_TABLE_TYPE, (int)CALCULATE_TABLE_TYPE.PARTICALE_GENE_INFO, OTS_RETORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
-            BindComboBox(cb_yscf_klfw, OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
+            //BindComboBox(cb_yscf_klfw, OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
             #endregion
 
             #region 三元相图
@@ -108,7 +108,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             //BindComboBox(cb_syxt_jsfs, OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE);
             //颗粒范围
             //BindComboBox(DisplayPicutureType.AnalyzeDataTable, cb_syxt_klfw, OTS_RETORT_PROP_GRID_ITEMS.CALCULATE_CHART_TYPE, (int)CALCULATE_CHART_TYPE.TRIO_CHART, OTS_RETORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
-            BindComboBox(cb_syxt_klfw, OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
+            //BindComboBox(cb_syxt_klfw, OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
             //粒级表
             //BindComboBox(DisplayPicutureType.AnalyzeDataChart, cb_syxt_ljb, OTS_RETORT_PROP_GRID_ITEMS.CALCULATE_CHART_TYPE, (int)CALCULATE_CHART_TYPE.TRIO_CHART, OTS_RETORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE);
             BindComboBox(cb_syxt_ljb, OTS_REPORT_PROP_GRID_ITEMS.GRAIN_SIZE_CLASS_TABLE);
@@ -134,7 +134,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             //BindComboBox(cb_kllb_jsfs, OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE);
             //颗粒范围
             //BindComboBox(DisplayPicutureType.AnalyzeDataTable, cb_kllb_klfw, OTS_RETORT_PROP_GRID_ITEMS.CALCULATE_TABLE_TYPE, (int)CALCULATE_TABLE_TYPE.PARTICALE_GENE_INFO, OTS_RETORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
-            BindComboBox(cb_kllb_klfw, OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
+            //BindComboBox(cb_kllb_klfw, OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
             #endregion
 
         }
@@ -196,19 +196,19 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
         private void button4_Click(object sender, EventArgs e)
         {
             //元素分析表,显示元素
-            SetPeriodicTableControl(tb_ysfx_xsys, m_OTSReport_Export.m_mbszclass.M_YSFXJG.list_str_tb_ysfx_xsys);
+            //SetPeriodicTableControl(tb_ysfx_xsys, m_OTSReport_Export.m_mbszclass.M_YSFXJG.list_str_tb_ysfx_xsys);
         }
 
         private void button5_Click(object sender, EventArgs e)
         {
             //元素成份图,显示元素
-            SetPeriodicTableControl(tb_yscf_ysxx, m_OTSReport_Export.m_mbszclass.M_YSFXJG.list_str_tb_yscf_ysxx);
+            //SetPeriodicTableControl(tb_yscf_ysxx, m_OTSReport_Export.m_mbszclass.M_YSFXJG.list_str_tb_yscf_ysxx);
         }
 
         private void button3_Click(object sender, EventArgs e)
         {
             //颗粒列表,显示元素
-            SetPeriodicTableControl(tb_kllb_sxys, m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_tb_lllb_sxys);
+            //SetPeriodicTableControl(tb_kllb_sxys, m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_tb_lllb_sxys);
         }
 
         #endregion
@@ -353,7 +353,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLLBXX.b_ck_kllb_xsmk.ToString(), "M_KLLBXX", "b_ck_kllb_xsmk");    //是否显示模块
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_jsfs.ToString(), "M_KLLBXX", "index_cb_kllb_jsfs");    //计算方式
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_klfw.ToString(), "M_KLLBXX", "index_cb_kllb_klfw");    //颗粒范围
-                xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLLBXX.int_tb_kllb_ylsx.ToString(), "M_KLLBXX", "int_tb_kllb_ylsx");    //数量上限
+                //xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLLBXX.int_tb_kllb_ylsx.ToString(), "M_KLLBXX", "int_tb_kllb_ylsx");    //数量上限
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_tb_kllb_sxys.ToString(), "M_KLLBXX", "str_tb_kllb_sxys");    //显示元素
                 for (int i = 0; i < m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_str_tb_lllb_sxys.Count; i++)                              //显示元素列表
                 {
@@ -565,42 +565,42 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_klcc_jsfs = cb_klcc_jsfs.SelectedIndex;
             m_OTSReport_Export.m_mbszclass.M_KLFXJG.str_cb_klcc_ljb = cb_klcc_ljb.Text;//粒级表
             m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_klcc_ljb = cb_klcc_ljb.SelectedIndex;
-            m_OTSReport_Export.m_mbszclass.M_KLFXJG.str_cb_klcc_klfw = cb_klcc_klfw.Text;//颗粒范围
-            m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_klcc_klfw = cb_klcc_klfw.SelectedIndex;
+            //m_OTSReport_Export.m_mbszclass.M_KLFXJG.str_cb_klcc_klfw = cb_klcc_klfw.Text;//颗粒范围
+            //m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_klcc_klfw = cb_klcc_klfw.SelectedIndex;
 
-            m_OTSReport_Export.m_mbszclass.M_KLFXJG.b_cb_jzwfl_xsmk = cb_jzwfl_xsmk.Checked;
-            m_OTSReport_Export.m_mbszclass.M_KLFXJG.str_cb_jzwfl_xstx = cb_jzwfl_xstx.Text;//选择图像
-            m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_jzwfl_xstx = cb_jzwfl_xstx.SelectedIndex;
+            //m_OTSReport_Export.m_mbszclass.M_KLFXJG.b_cb_jzwfl_xsmk = cb_jzwfl_xsmk.Checked;
+            //m_OTSReport_Export.m_mbszclass.M_KLFXJG.str_cb_jzwfl_xstx = cb_jzwfl_xstx.Text;//选择图像
+            //m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_jzwfl_xstx = cb_jzwfl_xstx.SelectedIndex;
             //m_OTSReport_Export.m_mbszclass.M_KLFXJG.str_cb_jzwfl_jsfs = cb_jzwfl_jsfs.Text;//计算方式
             //m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_jzwfl_jsfs = cb_jzwfl_jsfs.SelectedIndex;
-            m_OTSReport_Export.m_mbszclass.M_KLFXJG.str_cb_jzwfl_ljb = cb_jzwfl_ljb.Text;//粒级表
-            m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_jzwfl_ljb = cb_jzwfl_ljb.SelectedIndex;
-            m_OTSReport_Export.m_mbszclass.M_KLFXJG.str_cb_jzwfl_klfw = cb_jzwfl_klfw.Text;//颗粒范围
-            m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_jzwfl_klfw = cb_jzwfl_klfw.SelectedIndex;
+            //m_OTSReport_Export.m_mbszclass.M_KLFXJG.str_cb_jzwfl_ljb = cb_jzwfl_ljb.Text;//粒级表
+            //m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_jzwfl_ljb = cb_jzwfl_ljb.SelectedIndex;
+            //m_OTSReport_Export.m_mbszclass.M_KLFXJG.str_cb_jzwfl_klfw = cb_jzwfl_klfw.Text;//颗粒范围
+            //m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_jzwfl_klfw = cb_jzwfl_klfw.SelectedIndex;
 
             //元素分析结果
             m_OTSReport_Export.m_mbszclass.M_YSFXJG.b_ck_ysfx_xsmk = ck_ysfx_xsmk.Checked;
             //m_OTSReport_Export.m_mbszclass.M_YSFXJG.str_cb_yxfx_jsfs = cb_yxfx_jsfs.Text;//计算方式
             //m_OTSReport_Export.m_mbszclass.M_YSFXJG.index_cb_yxfx_jsfs = cb_yxfx_jsfs.SelectedIndex;
-            m_OTSReport_Export.m_mbszclass.M_YSFXJG.str_cb_ysfx_klfw = cb_ysfx_klfw.Text;//颗粒范围
-            m_OTSReport_Export.m_mbszclass.M_YSFXJG.index_cb_ysfx_klfw = cb_ysfx_klfw.SelectedIndex;
-            m_OTSReport_Export.m_mbszclass.M_YSFXJG.str_tb_ysfx_xsys = tb_ysfx_xsys.Text;//显示元素
+            //m_OTSReport_Export.m_mbszclass.M_YSFXJG.str_cb_ysfx_klfw = cb_ysfx_klfw.Text;//颗粒范围
+            //m_OTSReport_Export.m_mbszclass.M_YSFXJG.index_cb_ysfx_klfw = cb_ysfx_klfw.SelectedIndex;
+            //m_OTSReport_Export.m_mbszclass.M_YSFXJG.str_tb_ysfx_xsys = tb_ysfx_xsys.Text;//显示元素
 
             m_OTSReport_Export.m_mbszclass.M_YSFXJG.b_ck_yscf_xsmk = ck_yscf_xsmk.Checked;
             m_OTSReport_Export.m_mbszclass.M_YSFXJG.str_cb_yscf_xstx = cb_yscf_xstx.Text;//显示图形
             m_OTSReport_Export.m_mbszclass.M_YSFXJG.index_cb_yscf_xstx = cb_yscf_xstx.SelectedIndex;
             //m_OTSReport_Export.m_mbszclass.M_YSFXJG.str_cb_yscf_jsfs = cb_yscf_jsfs.Text;//计算方式
             //m_OTSReport_Export.m_mbszclass.M_YSFXJG.index_cb_yscf_jsfs = cb_yscf_jsfs.SelectedIndex;
-            m_OTSReport_Export.m_mbszclass.M_YSFXJG.str_cb_yscf_klfw = cb_yscf_klfw.Text;//颗粒范围
-            m_OTSReport_Export.m_mbszclass.M_YSFXJG.index_cb_yscf_klfw = cb_yscf_klfw.SelectedIndex;
-            m_OTSReport_Export.m_mbszclass.M_YSFXJG.str_tb_yscf_ysxx = tb_yscf_ysxx.Text;//显示元素
+            //m_OTSReport_Export.m_mbszclass.M_YSFXJG.str_cb_yscf_klfw = cb_yscf_klfw.Text;//颗粒范围
+            //m_OTSReport_Export.m_mbszclass.M_YSFXJG.index_cb_yscf_klfw = cb_yscf_klfw.SelectedIndex;
+            //m_OTSReport_Export.m_mbszclass.M_YSFXJG.str_tb_yscf_ysxx = tb_yscf_ysxx.Text;//显示元素
 
             //三元相图
             m_OTSReport_Export.m_mbszclass.M_SYXT.b_ck_syxt_xsmk = ck_syxt_xsmk.Checked;
             //m_OTSReport_Export.m_mbszclass.M_SYXT.str_cb_syxt_jsfs = cb_syxt_jsfs.Text;//计算方式
             //m_OTSReport_Export.m_mbszclass.M_SYXT.index_cb_syxt_jsfs = cb_syxt_jsfs.SelectedIndex;
-            m_OTSReport_Export.m_mbszclass.M_SYXT.str_cb_syxt_klfw = cb_syxt_klfw.Text;//颗粒范围
-            m_OTSReport_Export.m_mbszclass.M_SYXT.index_cb_syxt_klfw = cb_syxt_klfw.SelectedIndex;
+            //m_OTSReport_Export.m_mbszclass.M_SYXT.str_cb_syxt_klfw = cb_syxt_klfw.Text;//颗粒范围
+            //m_OTSReport_Export.m_mbszclass.M_SYXT.index_cb_syxt_klfw = cb_syxt_klfw.SelectedIndex;
             m_OTSReport_Export.m_mbszclass.M_SYXT.str_cb_syxt_ljb = cb_syxt_ljb.Text;//粒级表
             m_OTSReport_Export.m_mbszclass.M_SYXT.index_cb_syxt_ljb = cb_syxt_ljb.SelectedIndex;
             m_OTSReport_Export.m_mbszclass.M_SYXT.str_cb_syxt_mhxssl = cb_syxt_mhxssl.Text;//每行显示数量
@@ -626,18 +626,18 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             m_OTSReport_Export.m_mbszclass.M_KLLBXX.b_ck_kllb_xsmk = ck_kllb_xsmk.Checked;
             //m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_cb_kllb_jsfs = cb_kllb_jsfs.Text;//计算方式
             //m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_jsfs = cb_kllb_jsfs.SelectedIndex;
-            m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_cb_kllb_klfw = cb_kllb_klfw.Text;//颗粒范围
-            m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_klfw = cb_kllb_klfw.SelectedIndex;
+            //m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_cb_kllb_klfw = cb_kllb_klfw.Text;//颗粒范围
+            //m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_klfw = cb_kllb_klfw.SelectedIndex;
             if (ck_kllb_xsmk.Checked)
             {
-                m_OTSReport_Export.m_mbszclass.M_KLLBXX.int_tb_kllb_ylsx = Convert.ToInt32(tb_kllb_ylsx.Text.Trim());//数量上限
+                //m_OTSReport_Export.m_mbszclass.M_KLLBXX.int_tb_kllb_ylsx = Convert.ToInt32(tb_kllb_ylsx.Text.Trim());//数量上限
             }
             else
             {
                 m_OTSReport_Export.m_mbszclass.M_KLLBXX.int_tb_kllb_ylsx = Convert.ToInt32("1");
             }
 
-            m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_tb_kllb_sxys = tb_kllb_sxys.Text;//显示元素
+            //m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_tb_kllb_sxys = tb_kllb_sxys.Text;//显示元素
             m_OTSReport_Export.m_mbszclass.M_KLLBXX.b_ck_kllb_ystx = ck_kllb_ystx.Checked;//原始图像
             m_OTSReport_Export.m_mbszclass.M_KLLBXX.b_ck_kllb_fdtx = ck_kllb_fdtx.Checked;//放大图像
             m_OTSReport_Export.m_mbszclass.M_KLLBXX.b_ck_kllb_npxx = ck_kllb_npxx.Checked;//能谱图像
@@ -667,25 +667,25 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             //cb_klcc_ljb.Text = m_OTSReport_Export.m_mbszclass.M_KLFXJG.str_cb_klcc_ljb;//粒级表
             cb_klcc_ljb.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_klcc_ljb;
             //cb_klcc_klfw.Text = m_OTSReport_Export.m_mbszclass.M_KLFXJG.str_cb_klcc_klfw;//颗粒范围
-            cb_klcc_klfw.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_klcc_klfw;
+            //cb_klcc_klfw.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_klcc_klfw;
 
-            cb_jzwfl_xsmk.Checked = m_OTSReport_Export.m_mbszclass.M_KLFXJG.b_cb_jzwfl_xsmk;
+            //cb_jzwfl_xsmk.Checked = m_OTSReport_Export.m_mbszclass.M_KLFXJG.b_cb_jzwfl_xsmk;
             //cb_jzwfl_xstx.Text = m_OTSReport_Export.m_mbszclass.M_KLFXJG.str_cb_jzwfl_xstx;//选择图像
-            cb_jzwfl_xstx.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_jzwfl_xstx;
+            //cb_jzwfl_xstx.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_jzwfl_xstx;
             //cb_jzwfl_jsfs.Text = m_OTSReport_Export.m_mbszclass.M_KLFXJG.str_cb_jzwfl_jsfs;//计算方式
             //cb_jzwfl_jsfs.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_jzwfl_jsfs;
             //cb_jzwfl_ljb.Text = m_OTSReport_Export.m_mbszclass.M_KLFXJG.str_cb_jzwfl_ljb;//粒级表
-            cb_jzwfl_ljb.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_jzwfl_ljb;
+            //cb_jzwfl_ljb.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_jzwfl_ljb;
             //cb_jzwfl_klfw.Text = m_OTSReport_Export.m_mbszclass.M_KLFXJG.str_cb_jzwfl_klfw;//颗粒范围
-            cb_jzwfl_klfw.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_jzwfl_klfw;
+            //cb_jzwfl_klfw.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_KLFXJG.index_cb_jzwfl_klfw;
 
             //元素分析结果
             ck_ysfx_xsmk.Checked = m_OTSReport_Export.m_mbszclass.M_YSFXJG.b_ck_ysfx_xsmk;
             //cb_yxfx_jsfs.Text = m_OTSReport_Export.m_mbszclass.M_YSFXJG.str_cb_yxfx_jsfs;//计算方式
             //cb_yxfx_jsfs.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_YSFXJG.index_cb_yxfx_jsfs;
             //cb_ysfx_klfw.Text = m_OTSReport_Export.m_mbszclass.M_YSFXJG.str_cb_ysfx_klfw;//颗粒范围
-            cb_ysfx_klfw.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_YSFXJG.index_cb_ysfx_klfw;
-            tb_ysfx_xsys.Text = m_OTSReport_Export.m_mbszclass.M_YSFXJG.str_tb_ysfx_xsys;//显示元素
+            //cb_ysfx_klfw.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_YSFXJG.index_cb_ysfx_klfw;
+            //tb_ysfx_xsys.Text = m_OTSReport_Export.m_mbszclass.M_YSFXJG.str_tb_ysfx_xsys;//显示元素
 
             ck_yscf_xsmk.Checked = m_OTSReport_Export.m_mbszclass.M_YSFXJG.b_ck_yscf_xsmk;
             //cb_yscf_xstx.Text = m_OTSReport_Export.m_mbszclass.M_YSFXJG.str_cb_yscf_xstx;//显示图形
@@ -693,15 +693,15 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             //cb_yscf_jsfs.Text = m_OTSReport_Export.m_mbszclass.M_YSFXJG.str_cb_yscf_jsfs;//计算方式
             //cb_yscf_jsfs.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_YSFXJG.index_cb_yscf_jsfs;
             //cb_yscf_klfw.Text = m_OTSReport_Export.m_mbszclass.M_YSFXJG.str_cb_yscf_klfw;//颗粒范围
-            cb_yscf_klfw.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_YSFXJG.index_cb_yscf_klfw;
-            tb_yscf_ysxx.Text = m_OTSReport_Export.m_mbszclass.M_YSFXJG.str_tb_yscf_ysxx;//显示元素
+            //cb_yscf_klfw.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_YSFXJG.index_cb_yscf_klfw;
+            //tb_yscf_ysxx.Text = m_OTSReport_Export.m_mbszclass.M_YSFXJG.str_tb_yscf_ysxx;//显示元素
 
             //三元相图
             ck_syxt_xsmk.Checked = m_OTSReport_Export.m_mbszclass.M_SYXT.b_ck_syxt_xsmk;
             //cb_syxt_jsfs.Text = m_OTSReport_Export.m_mbszclass.M_SYXT.str_cb_syxt_jsfs;//计算方式
             //cb_syxt_jsfs.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_SYXT.index_cb_syxt_jsfs;
             //cb_syxt_klfw.Text = m_OTSReport_Export.m_mbszclass.M_SYXT.str_cb_syxt_klfw;//颗粒范围
-            cb_syxt_klfw.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_SYXT.index_cb_syxt_klfw;
+            //cb_syxt_klfw.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_SYXT.index_cb_syxt_klfw;
 
             cb_syxt_ljb.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_SYXT.index_cb_syxt_ljb;//粒级表
 
@@ -725,10 +725,10 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             //cb_kllb_jsfs.Text = m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_cb_kllb_jsfs;//计算方式
             //cb_kllb_jsfs.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_jsfs;
             //cb_kllb_klfw.Text = m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_cb_kllb_klfw;//颗粒范围
-            cb_kllb_klfw.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_klfw;
+            //cb_kllb_klfw.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_klfw;
 
-            tb_kllb_ylsx.Text = m_OTSReport_Export.m_mbszclass.M_KLLBXX.int_tb_kllb_ylsx.ToString();//数量上限
-            tb_kllb_sxys.Text = m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_tb_kllb_sxys;//显示元素
+            //tb_kllb_ylsx.Text = m_OTSReport_Export.m_mbszclass.M_KLLBXX.int_tb_kllb_ylsx.ToString();//数量上限
+            //tb_kllb_sxys.Text = m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_tb_kllb_sxys;//显示元素
             ck_kllb_ystx.Checked = m_OTSReport_Export.m_mbszclass.M_KLLBXX.b_ck_kllb_ystx;//原始图像
             ck_kllb_fdtx.Checked = m_OTSReport_Export.m_mbszclass.M_KLLBXX.b_ck_kllb_fdtx;//放大图像
             ck_kllb_npxx.Checked = m_OTSReport_Export.m_mbszclass.M_KLLBXX.b_ck_kllb_npxx;//能谱图像
@@ -866,19 +866,19 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 }
                 else if (i == 3)
                 {
-                    if (cb_jzwfl_xsmk.Checked)
-                    {
-                        pictureBox3.Visible = true;
-                        top = top + 950;
-                        pictures[i - 1].Top = top;
-                        pictures[i - 1].Left = left;
-                        pictures[i - 1].Width = 673;
-                        pictures[i - 1].Height = 954;
-                    }
-                    else
-                    {
+                    //if (cb_jzwfl_xsmk.Checked)
+                    //{
+                    //    pictureBox3.Visible = true;
+                    //    top = top + 950;
+                    //    pictures[i - 1].Top = top;
+                    //    pictures[i - 1].Left = left;
+                    //    pictures[i - 1].Width = 673;
+                    //    pictures[i - 1].Height = 954;
+                    //}
+                    //else
+                    //{
                         pictureBox3.Visible = false;
-                    }
+                    //}
                 }
                 else if (i == 4)
                 {
@@ -1032,15 +1032,15 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
 
         private void cb_jzwfl_xsmk_CheckedChanged(object sender, EventArgs e)
         {
-            if (cb_jzwfl_xsmk.Checked)
-            {
-                pictureBox3.Visible = true;
-                this.pictureBox3.Image = Properties.Resources.颗粒成分图;
-            }
-            else
-            {
+            //if (cb_jzwfl_xsmk.Checked)
+            //{
+            //    pictureBox3.Visible = true;
+            //    this.pictureBox3.Image = Properties.Resources.颗粒成分图;
+            //}
+            //else
+            //{
                 pictureBox3.Visible = false;
-            }
+            //}
             LocationPicture();
         }
 

+ 5 - 2
OTSIncAReportApp/1-UI/frmReportApp.cs

@@ -413,9 +413,12 @@ namespace OTSIncAReportApp
             fileDialog.Filter = "text File|*.rst";
             fileDialog.RestoreDirectory = true; 
             if (fileDialog.ShowDialog() == DialogResult.OK)
+            {
                 path = System.IO.Path.GetFullPath(fileDialog.FileName);
-            log.Info("begin to load the result!");
-            this.m_RstWindow.AddSampleResult(path);
+                log.Info("begin to load the result!");
+                this.m_RstWindow.AddSampleResult(path);
+            }
+                
         }
 
 

+ 21 - 13
OTSIncAReportTemplate/OTSIncAReportTemplate.cs

@@ -91,7 +91,7 @@ namespace OTSIncAReportTemplate
                 m_arg4 = "100";
                 m_arg5 = "0-100";
             }
-            
+            //MessageBox.Show("");
 
             //初始化xml类
             xmlutil = new XmlConfigUtil(m_arg2);
@@ -255,12 +255,12 @@ namespace OTSIncAReportTemplate
                 DataTable dataTable = new DataTable();
                 rmReport1.AddDataSet(dataTable, "PartSize");
                 rmReport1.AddDataSet(dataTable, "Particel");
-                rmReport1.AddDataSet(dataTable, "PicKL");
+                //rmReport1.AddDataSet(dataTable, "PicKL");
                 dataTable.Dispose();
                 dataTable.Clear();
                 rmReport1.FindObject("MasterData2").Prop["Visible"] = false;
                 rmReport1.FindObject("MasterData126").Prop["Visible"] = false;
-                rmReport1.FindObject("MasterData95").Prop["Visible"] = false;
+                //rmReport1.FindObject("MasterData95").Prop["Visible"] = false;
                 rmReport1.DeletePage(1);
             }
             else
@@ -301,11 +301,11 @@ namespace OTSIncAReportTemplate
                 }
                 else
                 {
-                    DataTable dataTable = new DataTable();
-                    rmReport1.AddDataSet(dataTable, "PicKL");
-                    dataTable.Dispose();
-                    dataTable.Clear();
-                    rmReport1.FindObject("MasterData95").Prop["Visible"] = false;
+                    //DataTable dataTable = new DataTable();
+                    //rmReport1.AddDataSet(dataTable, "PicKL");
+                    //dataTable.Dispose();
+                    //dataTable.Clear();
+                    //rmReport1.FindObject("MasterData95").Prop["Visible"] = false;
                 }
             }
 
@@ -384,7 +384,7 @@ namespace OTSIncAReportTemplate
                 }
                 //FlushMemory();
                 #region 主副表
-                DataTable ls_dt_frame = list_dt.Where(aa => aa.TableName.Contains("Largest_frame")).ToList()[0].Copy();//副表
+                DataTable ls_dt_frame = list_dt.Where(aa => aa.TableName.Contains("FrameGraphSubTable")).ToList()[0].Copy();//副表
                 DataTable ls_dt_fielddt = list_dt.Where(aa => aa.TableName.Contains("field_dt")).ToList()[0].Copy();//帧图主表
                 DataSet ds = new DataSet("fieldimgds");
 
@@ -898,13 +898,20 @@ namespace OTSIncAReportTemplate
             DataTable ls_ResultGrid = sh.ExecuteQuery("select * from ResultGrid");
             ls_ResultGrid.TableName = "ResultGrid";
             list_dt.Add(ls_ResultGrid);
+            
 
             string strmix = m_arg5.Substring(0, m_arg5.IndexOf("-"));
             string strmax = m_arg5.Substring(m_arg5.IndexOf("-") + 1, m_arg5.Length - m_arg5.IndexOf("-") - 1);
 
-            DataTable ls_Largest_frame = sh.ExecuteQuery("select * from Largest_frame where cast(fieldid as int) > " + strmix + " and cast(fieldid as int) < " + strmax + " ");
-            ls_Largest_frame.TableName = "Largest_frame";
-            list_dt.Add(ls_Largest_frame);
+            DataTable ls_Largest_frame2 = sh.ExecuteQuery("select * from Largest_frame where cast(fieldid as int) > " + strmix + " and cast(fieldid as int) < " + strmax + " ");
+            ls_Largest_frame2.TableName = "Largest_frame";
+            list_dt.Add(ls_Largest_frame2);
+
+            //DataTable ls_FrameGraphSubTable = sh.ExecuteQuery("select * from FrameGraphSubTable where cast(fieldid as int) > " + strmix + " and cast(fieldid as int) < " + strmax + " ");
+            DataTable ls_FrameGraphSubTable = sh.ExecuteQuery("select * from FrameGraphSubTable ");
+            ls_FrameGraphSubTable.TableName = "FrameGraphSubTable";
+            list_dt.Add(ls_FrameGraphSubTable);
+
 
             DataTable ls_Largest20 = sh.ExecuteQuery("select * from Largest20");
             ls_Largest20.TableName = "Largest20";
@@ -919,7 +926,8 @@ namespace OTSIncAReportTemplate
             //ls_Largest2new.TableName = "Largest2new";
             //list_dt.Add(ls_Largest2new);
 
-            DataTable ls_field_dt = sh.ExecuteQuery("select * from field_dt where cast(fieldid as int) > " + strmix + " and cast(fieldid as int) < " + strmax + " ");
+            //DataTable ls_field_dt = sh.ExecuteQuery("select * from field_dt where cast(fieldid as int) > " + strmix + " and cast(fieldid as int) < " + strmax + " ");
+            DataTable ls_field_dt = sh.ExecuteQuery("select * from field_dt ");
             ls_field_dt.TableName = "field_dt";
             list_dt.Add(ls_field_dt);
 

+ 2 - 0
OTSIncAReportTemplate/SqLiteHelper.cs

@@ -104,6 +104,8 @@ namespace OTSSysMgrTools
             }
             catch (Exception e)
             {
+                DataTable dtNill = new DataTable();
+                dt = dtNill;
                 //Log(e.Message);
             }