Bladeren bron

1.重新梳理颗粒列表数据源类型,添加拼接颗粒子列表
2.调整颗粒列表进度条显示位置
3.删除颗粒列表选择颗粒功能

cxs 2 jaren geleden
bovenliggende
commit
bc3ab09ace

+ 1 - 1
Bin/x64/Debug/Resources/XMLData/AppResource_EN.xml

@@ -799,7 +799,6 @@
 	  <Control name="sscaptionname21" text="Particle Size Type" />
 	  <Control name="sscaptionname22" text="Measured Data" />
 	  <Control name="sscaptionname23" text="All Particles" />
-	  <Control name="sscaptionname24" text="Select Particles" />
 	  <Control name="sscaptionname25" text="Results Overview" />
 	  <Control name="sscaptionname26" text="Sample Information" />
 	  <Control name="sscaptionname27" text="Particle Composition" />
@@ -830,6 +829,7 @@
 	  <Control name="ParticlesAnalyzed" text="ParticlesAnalyzed" />
 	  <Control name="SelectParticles" text="SelectParticles" />
 	  <Control name="otherParticles" text="otherParticles" />
+	  <Control name="MergeParticles" text="MergeParticles" />
 	  <Control name="DataSourceType" text="DataSourceType" />
 	  <Control name="InclusionAreaRatio" text="ParticleAreaRatio" />
 	  <Control name="IncaArea scale" text="ParticleAreaRatio" />

+ 4 - 1
Bin/x64/Debug/Resources/XMLData/AppResource_ZH.xml

@@ -838,7 +838,6 @@
 	  <Control name="sscaptionname21" text="按尺寸排列" />
 	  <Control name="sscaptionname22" text="排列方式" />
 	  <Control name="sscaptionname23" text="全部颗粒" />
-	  <Control name="sscaptionname24" text="选择颗粒" />
 	  <Control name="sscaptionname25" text="测量结果概况" />
 	  <Control name="sscaptionname26" text="样品测量信息" />
 	  <Control name="sscaptionname27" text="颗粒成分子分类" />
@@ -869,6 +868,7 @@
 	  <Control name="ParticlesAnalyzed" text="已分析颗粒" />
 	  <Control name="SelectParticles" text="选择颗粒" />
 	  <Control name="otherParticles" text="其它颗粒" />
+	  <Control name="MergeParticles" text="拼接颗粒" />
 	  <Control name="DataSourceType" text="数据源类型" />
 	  <Control name="InclusionAreaRatio" text="颗粒面积比" />
 	  <Control name="IncaAreascale" text="颗粒面积比" />
@@ -1434,6 +1434,9 @@
 	  <Control name="str31" text="展开长度μm" />
 	  <Control name="str32" text="展开长宽比" />
 	  <Control name="str33" text="朝向角度°" />
+	  <Control name="str34" text="硬度" />
+	  <Control name="str35" text="密度" />
+	  <Control name="str36" text="导电性" />
     </Controls>
  </Form>
  <Form>

+ 1 - 12
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage.Designer.cs

@@ -66,7 +66,6 @@
             this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
             this.ToolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
             this.ToolStripMenuItem5 = new System.Windows.Forms.ToolStripMenuItem();
-            this.ToolStripMenuItem_selectparticle = new System.Windows.Forms.ToolStripMenuItem();
             this.ToolStripMenuItem_exportimagefile = new System.Windows.Forms.ToolStripMenuItem();
             this.testToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.EXCELToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -396,14 +395,13 @@
             this.toolStripSeparator1,
             this.ToolStripMenuItem3,
             this.ToolStripMenuItem5,
-            this.ToolStripMenuItem_selectparticle,
             this.ToolStripMenuItem_exportimagefile,
             this.testToolStripMenuItem,
             this.EXCELToolStripMenuItem,
             this.ToolStripMenuItemDelete_Particle,
             this.ImportSTDDb});
             this.contextMenuStrip1.Name = "contextMenuStrip1";
-            this.contextMenuStrip1.Size = new System.Drawing.Size(219, 340);
+            this.contextMenuStrip1.Size = new System.Drawing.Size(219, 332);
             // 
             // ToolStripMenuItem1
             // 
@@ -450,14 +448,6 @@
             this.ToolStripMenuItem5.Text = "移动SEM到颗粒视域位置";
             this.ToolStripMenuItem5.Click += new System.EventHandler(this.ToolStripMenuItem5_Click);
             // 
-            // ToolStripMenuItem_selectparticle
-            // 
-            this.ToolStripMenuItem_selectparticle.Image = global::OTSIncAReportApp.Properties.Resources.选择颗粒;
-            this.ToolStripMenuItem_selectparticle.Name = "ToolStripMenuItem_selectparticle";
-            this.ToolStripMenuItem_selectparticle.Size = new System.Drawing.Size(218, 30);
-            this.ToolStripMenuItem_selectparticle.Text = "Select Particles";
-            this.ToolStripMenuItem_selectparticle.Click += new System.EventHandler(this.ToolStripMenuItem_selectparticle_Click);
-            // 
             // ToolStripMenuItem_exportimagefile
             // 
             this.ToolStripMenuItem_exportimagefile.Image = global::OTSIncAReportApp.Properties.Resources.导出;
@@ -561,7 +551,6 @@
         private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
         private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem3;
         private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem5;
-        private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem_selectparticle;
         private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem_exportimagefile;
         private System.Windows.Forms.ToolStripMenuItem testToolStripMenuItem;
         private System.Windows.Forms.Label label_Condition;

+ 72 - 57
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage.cs

@@ -96,6 +96,14 @@ namespace OTSIncAReportGrids
         DataTable userLibraryData;
         NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
 
+        enum SelItem
+        {
+            analyticalParticle=0,
+            selectParticles=1,
+            otherParticles=2,
+            MergeParticles=3
+        }
+
         #region 分页器相关
 
         #region 分页字段和属性
@@ -280,7 +288,7 @@ namespace OTSIncAReportGrids
 
         bool UpdateTable()
         {
-            int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
+            int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.PARTICE_LIST);
             if (sel == 1)
             {
                 List<Particle> selectParticles = m_ReportApp.GetSelectedParticles();
@@ -312,14 +320,14 @@ namespace OTSIncAReportGrids
                 dtUelect.Columns.Add("DFERET");
                 dtUelect.Columns.Add("TypeName");
                 dtUelect.Columns.Add("TypeColor");
-                dtUelect.Columns.Add("SubParticles");
+                //dtUelect.Columns.Add("SubParticles");
                 dtUelect.Columns.Add("Element");
                 dtUelect.Columns.Add("Hardness");
                 dtUelect.Columns.Add("Density");
                 dtUelect.Columns.Add("Electrical_conductivity");
                 for (int i = 0; i < selectParticles.Count; i++)
                 {
-                    dtUelect.Rows.Add(selectParticles[i].FieldId, selectParticles[i].ParticleId, selectParticles[i].AveGray, selectParticles[i].RectLeft, selectParticles[i].RectTop, selectParticles[i].RectWidth, selectParticles[i].RectHeight, selectParticles[i].Area, selectParticles[i].PosX, selectParticles[i].PosX, selectParticles[i].TypeId, /*selectParticles[i].ElementNum,*/ selectParticles[i].SegmentNum, selectParticles[i].SEMPosX, selectParticles[i].SEMPosY, selectParticles[i].ParticleId, selectParticles[i].DMAX, selectParticles[i].DMIN, selectParticles[i].DPERP, selectParticles[i].PERIMETER, selectParticles[i].ORIENTATION, selectParticles[i].DINSCR, selectParticles[i].DMEAN, selectParticles[i].DELONG, selectParticles[i].DFERET, selectParticles[i].TypeName, selectParticles[i].TypeColor, "", "", "", "", "");
+                    dtUelect.Rows.Add(selectParticles[i].FieldId, selectParticles[i].ParticleId, selectParticles[i].AveGray, selectParticles[i].RectLeft, selectParticles[i].RectTop, selectParticles[i].RectWidth, selectParticles[i].RectHeight, selectParticles[i].Area, selectParticles[i].PosX, selectParticles[i].PosX, selectParticles[i].TypeId, /*selectParticles[i].ElementNum,*/ selectParticles[i].SegmentNum, selectParticles[i].SEMPosX, selectParticles[i].SEMPosY, selectParticles[i].ParticleId, selectParticles[i].DMAX, selectParticles[i].DMIN, selectParticles[i].DPERP, selectParticles[i].PERIMETER, selectParticles[i].ORIENTATION, selectParticles[i].DINSCR, selectParticles[i].DMEAN, selectParticles[i].DELONG, selectParticles[i].DFERET, selectParticles[i].TypeName, selectParticles[i].TypeColor,/* "", */"", "", "", "");
                 }
                 if (userLibraryData != null)
                 {
@@ -357,7 +365,20 @@ namespace OTSIncAReportGrids
             {
                 //多次测试发现 读取数据库时间耗时长,但读取条数目对读取数据库时长影响不大,故此处直接读取所有数据库信息,以取代多次连接数据库方式,优化分页速度
                 particlesAll = new DataTable();
-                particlesAll = Particledata.GetInfoForPartucleDevidePage2(condition);
+                if (sel == (int)SelItem.analyticalParticle)
+                {
+                    //particlesAll = Particledata.GetInfoForPartucleDevidePage2(condition);
+                    particlesAll = Particledata.GetInfoForPartucleDevidePage_analyticalParticle(condition);
+                }
+                if (sel == (int)SelItem.otherParticles)
+                {
+                    particlesAll = Particledata.GetInfoForPartucleDevidePage_otherParticle(condition);
+                }
+                if (sel == (int)SelItem.MergeParticles)
+                {
+                    particlesAll = Particledata.GetInfoForPartucleDevidePage_mergeParticles(condition);
+                }
+
                 particlesAll.Columns.Add("Hardness");
                 particlesAll.Columns.Add("Density");
                 particlesAll.Columns.Add("Electrical_conductivity");
@@ -368,9 +389,6 @@ namespace OTSIncAReportGrids
                         DataRow[] dr = userLibraryData.Select("STDId=" + particlesAll.Rows[i]["TypeId"].ToString());
                         if (dr.Length > 0)
                         {
-                            //particlesAll.Rows[i]["Hardness"] = System.Text.RegularExpressions.Regex.Replace(dr[0]["Hardness"].ToString(), @"[^\d.\d]", "");
-                            //particlesAll.Rows[i]["Density"] = System.Text.RegularExpressions.Regex.Replace(dr[0]["Density"].ToString(), @"[^\d.\d]", "");
-                            //particlesAll.Rows[i]["Electrical_conductivity"] = System.Text.RegularExpressions.Regex.Replace(dr[0]["Electrical_conductivity"].ToString(), @"[^\d.\d]", "");
                             particlesAll.Rows[i]["Hardness"] = dr[0]["Hardness"].ToString();
                             particlesAll.Rows[i]["Density"] = dr[0]["Density"].ToString();
                             particlesAll.Rows[i]["Electrical_conductivity"] = dr[0]["Electrical_conductivity"].ToString();
@@ -392,16 +410,7 @@ namespace OTSIncAReportGrids
                         particlesAll.Rows[i]["Electrical_conductivity"] = "";
                     }
                 }
-                if (sel == 0)
-                {
-                    string str = "TypeId <> -1 and TypeId <> 9 and TypeId <> 0";
-                    particlesAll = SreeenDataTable(particlesAll, str);
-                }
-                if (sel == 2)
-                {
-                    string str = "TypeId = " + "-1 or TypeId =" + "9 or TypeId =" + "0";
-                    particlesAll = SreeenDataTable(particlesAll, str);
-                }
+                
                 btn_Sel.Enabled = true;
             }
             if (particlesAll == null)
@@ -807,33 +816,36 @@ namespace OTSIncAReportGrids
                         }
                         if (enl.Current.Key == "ParticleImage")
                         {
-                            string subt = particles.Rows[i]["SubParticles"].ToString();
-                            if (subt != null && subt != "")
+                            if (particles.Columns.Contains("SubParticles"))
                             {
-                                double ScanFieldSize = Convert.ToDouble(((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)result.ResultInfo["Sample"])["Members"])["SEMDataMsr"])["ScanFieldSize"]);
-                                string filePatht = result.FilePath + "\\FIELD_FILES\\";
-                                string imagePatht = filePatht + "Field" + subt.Split(',')[0].Split(':')[0].ToString() + ".bmp";
-                                //然后将取出的数据,转换成Bitmap对象
-                                Bitmap tempbit = Particledata.ReadImageFile(imagePatht);
-                                int pixw = tempbit.Width;
-                                double xs = pixw / ScanFieldSize;
-
-                                particleM = particleM + "," + subt;
-                                Bitmap bmap = Particledata.GetBitmapForBig(subt, xs, result.FilePath, tempbit.Height, tempbit.Width);
-                                if (bmap != null)
+                                string subt = particles.Rows[i]["SubParticles"].ToString();
+                                if (subt != null && subt != "")
                                 {
-                                    string[] str = subt.Split(',');
-                                    bmap.Tag = new List<string>() { str[0].Split(':')[0], str[0].Split(':')[1], particles.Rows[i]["TypeId"].ToString() };
-                                    dgV_ParticlesDevidePage.Rows[add_rowindex].Height = 150;
-                                    dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = bmap;
-                                    dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
-                                    dgV_ParticlesDevidePage.Rows[add_rowindex].DefaultCellStyle.ForeColor = Color.Chocolate;
-                                }
-                                else
-                                {
-                                    dgV_ParticlesDevidePage.Rows[add_rowindex].Height = 150;
+                                    double ScanFieldSize = Convert.ToDouble(((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)result.ResultInfo["Sample"])["Members"])["SEMDataMsr"])["ScanFieldSize"]);
+                                    string filePatht = result.FilePath + "\\FIELD_FILES\\";
+                                    string imagePatht = filePatht + "Field" + subt.Split(',')[0].Split(':')[0].ToString() + ".bmp";
+                                    //然后将取出的数据,转换成Bitmap对象
+                                    Bitmap tempbit = Particledata.ReadImageFile(imagePatht);
+                                    int pixw = tempbit.Width;
+                                    double xs = pixw / ScanFieldSize;
+
+                                    particleM = particleM + "," + subt;
+                                    Bitmap bmap = Particledata.GetBitmapForBig(subt, xs, result.FilePath, tempbit.Height, tempbit.Width);
+                                    if (bmap != null)
+                                    {
+                                        string[] str = subt.Split(',');
+                                        bmap.Tag = new List<string>() { str[0].Split(':')[0], str[0].Split(':')[1], particles.Rows[i]["TypeId"].ToString() };
+                                        dgV_ParticlesDevidePage.Rows[add_rowindex].Height = 150;
+                                        dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = bmap;
+                                        dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
+                                        dgV_ParticlesDevidePage.Rows[add_rowindex].DefaultCellStyle.ForeColor = Color.Chocolate;
+                                    }
+                                    else
+                                    {
+                                        dgV_ParticlesDevidePage.Rows[add_rowindex].Height = 150;
 
-                                    dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
+                                        dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
+                                    }
                                 }
                             }
                             else
@@ -2425,23 +2437,26 @@ namespace OTSIncAReportGrids
         {
 
             var SelectRows = dgV_ParticlesDevidePage.SelectedRows;
-            if (SelectRows != null && SelectRows.Count == 1)
-            {
-                DataGridViewRow dgvr = SelectRows[0];
-                Bitmap ls_bp = (Bitmap)dgvr.Cells[2].Value;
-                List<string> list_str = (List<string>)ls_bp.Tag;
-                //if (list_str[2].ToString() == "9")
-                //{
-                    contextMenuStrip1.Items[11].Visible = true;
-                //}
-                //else
-                //{
-                //    contextMenuStrip1.Items[11].Visible = false;
-                //}
-            }
-            else
+            int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.PARTICE_LIST);
             {
-                contextMenuStrip1.Items[11].Visible = false;
+                if (sel != (int)SelItem.MergeParticles)
+                {
+                    if (SelectRows != null && SelectRows.Count == 1)
+                    {
+                        DataGridViewRow dgvr = SelectRows[0];
+                        Bitmap ls_bp = (Bitmap)dgvr.Cells[2].Value;
+                        List<string> list_str = (List<string>)ls_bp.Tag;
+                        contextMenuStrip1.Items[10].Visible = true;
+                    }
+                    else
+                    {
+                        contextMenuStrip1.Items[10].Visible = false;
+                    }
+                }
+                else
+                {
+                    contextMenuStrip1.Items[10].Visible = false;
+                }
             }
         }
     }

+ 1 - 1
OTSIncAReportApp/1-UI/OTSDisplaySourceGridData/OTSSampleReportInfo/OTSSampleReportInfo.cs

@@ -183,7 +183,7 @@ namespace OTSIncAReportApp.OTSSampleReportInfo
         /// <summary>
         /// 颗粒列表
         /// </summary>
-            PARTICE_LIST=17
+        PARTICE_LIST=17
 
 
     };

+ 7 - 2
OTSIncAReportApp/1-UI/OTSDisplaySourceGridData/frmReportConditionChoose.cs

@@ -118,9 +118,10 @@ namespace OTSIncAReportApp
             string americanStandard = resTable["americanstandard"].ToString();//美标
             string germanStandard = resTable["germanstandard"].ToString();//德标
             string commonClassification = resTable["commonclassification"].ToString();//常用夹杂物分类
-            string allParticles = resTable["particlesanalyzed"].ToString();//已分析颗粒
+            string allParticles = resTable["sscaptionname23"].ToString();//全部颗粒
             string selectParticles = resTable["selectparticles"].ToString();//选择颗粒
             string otherParticles = resTable["otherparticles"].ToString(); ;//其它颗粒
+            string MergeParticles = resTable["mergeparticles"].ToString(); ;//合成颗粒
             string dataSourceType = resTable["datasourcetype"].ToString();//数据源类型
             string InclusionAreaRatio = resTable["inclusionarearatio"].ToString();//夹杂物面积比
             #endregion
@@ -181,6 +182,10 @@ namespace OTSIncAReportApp
             List<string> stdlistname = m_rstDataMgr.GetSTDIdList();
            
             AddGridData(OTS_REPORT_PROP_GRID_ITEMS.STD_ID, "ClassifyId", OTS_ITEM_TYPES.COMBO, false, "std list", stdlistname[0], stdlistname, null);
+
+            //颗粒列表数据类型
+            List<string> list_PARTICE_LIST = new List<string>() { analyticalParticle, selectParticles, otherParticles, MergeParticles };
+            AddGridData(OTS_REPORT_PROP_GRID_ITEMS.PARTICE_LIST, dataSourceType, OTS_ITEM_TYPES.COMBO, false, "data source type", list_PARTICE_LIST[0], list_PARTICE_LIST, 0);
         }
         #region 属性Grid相关方法
         public void ShowsTheDefaultPic()
@@ -447,7 +452,7 @@ namespace OTSIncAReportApp
 
                 if ((int)sampleData3.itemVal == (int)CALCULATE_TABLE_TYPE.PARTICALE_GENE_INFO)
                 {
-                    var sampleData1 = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE];
+                    var sampleData1 = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.PARTICE_LIST];
                     //list.Add(sampleData1);
                     list.Insert(1, sampleData1);
                 }

+ 28 - 0
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/ParticleData.cs

@@ -564,6 +564,34 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             return DT;
         }
 
+        public DataTable GetInfoForPartucleDevidePage_analyticalParticle(string condition)
+        {
+            string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,'' as Element from INcAData where xrayid > -1  and typeid !=9 and typeid !=-1 " +
+                condition;
+            DataTable DT = new DataTable();
+            DT = dbHelper.ExecuteQuery(sqliteString);
+            return DT;
+        }
+
+
+        public DataTable GetInfoForPartucleDevidePage_otherParticle(string condition)
+        {
+            string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,SEMPosX,SEMPosY,XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,'' as Element from INcAData where xrayid > -1  and (typeid =9 or typeid =-1) " +
+                condition;
+            DataTable DT = new DataTable();
+            DT = dbHelper.ExecuteQuery(sqliteString);
+            return DT;
+        }
+
+        public DataTable GetInfoForPartucleDevidePage_mergeParticles(string condition)
+        {
+            string sqliteString = "select fieldid,particleid,AveGray,RectLeft,RectTop,RectWidth,RectHeight,Area,PosX,PosY,TypeId,SegmentNum,FieldPosX " +
+                "as 'SEMPosX',FieldPosY as 'SEMPosY',XrayId,DMAX,DMIN,DPERP,PERIMETER,ORIENTATION,DINSCR,DMEAN,DELONG,DFERET,TypeName,TypeColor,SubParticles,''as Element from MergedParticleInfo where 1=1 " + condition;
+            DataTable DT = new DataTable();
+            DT = dbHelper.ExecuteQuery(sqliteString);
+            return DT;
+        }
+
         public DataTable GetElementChemistry()
         {
             string sqliteString = "select * from ElementChemistry";

+ 0 - 1
OTSPartA_STDEditor/Program.cs

@@ -15,7 +15,6 @@ namespace OTSPartA_STDEditor
         [STAThread]
         static void Main(string[] args)
         {
-            //MessageBox.Show("a");
             Application.EnableVisualStyles();
             Application.SetCompatibleTextRenderingDefault(false);
             //Application.Run(new Form_ConstantsEditor2());