Forráskód Böngészése

修改 报告 表图 系列 删除 无效 颗粒和 lowcount
颗粒 列表 添加 del按键

cxs 1 éve
szülő
commit
8341f322b1

+ 4 - 1
OTSIncAReportApp/1-UI/Control_ECharts/EChart_ParticlesComposition.cs

@@ -337,7 +337,10 @@ namespace OTSIncAReportApp.Control_ECharts
             DataOperation.DataAccess.ParticleData particledata = new DataOperation.DataAccess.ParticleData(path);
             DataTable data = new DataTable();
             data = particledata.GetAreaByAllIncA("");//获取所有分类面积和数量信息
-
+            if(data.Rows.Count==0)
+            {
+                return data;
+            }
             
             DataTable AreaInformationOfAllElements = ConSolidateInvalid(data);
             DataTable AllAnalysisDetails = new DataTable();

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

@@ -521,6 +521,7 @@
             this.dgV_ParticlesDevidePage.Size = new System.Drawing.Size(1502, 741);
             this.dgV_ParticlesDevidePage.TabIndex = 5;
             this.dgV_ParticlesDevidePage.SortCompare += new System.Windows.Forms.DataGridViewSortCompareEventHandler(this.dgV_ParticlesDevidePage_SortCompare);
+            this.dgV_ParticlesDevidePage.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dgV_ParticlesDevidePage_KeyDown);
             this.dgV_ParticlesDevidePage.MouseDown += new System.Windows.Forms.MouseEventHandler(this.dgV_ParticlesDevidePage_MouseDown);
             this.dgV_ParticlesDevidePage.MouseUp += new System.Windows.Forms.MouseEventHandler(this.dgV_ParticlesDevidePage_MouseUp);
             // 

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

@@ -82,9 +82,9 @@ namespace OTSIncAReportGrids
         enum SelItem
         {
             analyticalParticle = 0,
-            otherParticles = 2,
-            MergeParticles = 3,
-            allParticles=4
+            otherParticles = 1,
+            MergeParticles = 2,
+            allParticles=3
         }
 
         #region 分页器相关
@@ -432,7 +432,7 @@ namespace OTSIncAReportGrids
 
             string vs = "," + sub.Replace(':', '-') + ",";
 
-            DataTable dataTable = fielddata.GetParticleAll(vs);
+            DataTable dataTable = fielddata.GetParticleAllforparticlelist(vs);
             if (dataTable.Rows.Count == 0)
             {
                 return null;
@@ -2595,6 +2595,14 @@ namespace OTSIncAReportGrids
                 SaveParticleslist_select();
             }
         }
+
+        private void dgV_ParticlesDevidePage_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyData == Keys.Delete)
+            {
+                ToolStripMenuItem_Delete_Particle_Click(null, null);
+            }
+        }
     }
 }
 

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

@@ -112,7 +112,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             string sqlp = @"select TypeId,TypeName,TypeColor,count(1) as con,sum(Area) as Area,avg(" + con
                 + ") as av,max(" + con
                 + ") as max ";
-            sqlp = sqlp + " from IncAData group by TypeId";
+            sqlp = sqlp + "from IncAData where typeid !=-1 and typeid !=4 group by TypeId";
 
             DataTable DT = dbHelper.ExecuteDataTable(sqlp, null);
             return DT;
@@ -129,10 +129,10 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             string sqlp = @"select TypeId,TypeName,TypeColor,count(1) as con,avg(" + con
                 + ") as av,max(" + con
                 + ") as max ,GroupName";
-            sqlp = sqlp + " from IncAData ";
+            sqlp = sqlp + " from IncAData where typeid !=-1 and typeid !=4";
             if (fieldAndPartic != "")
             {
-                sqlp = sqlp + " where '" + fieldAndPartic + "' like ('%,'||fieldid||'-'||particleid||',%')";
+                sqlp = sqlp + " and '" + fieldAndPartic + "' like ('%,'||fieldid||'-'||particleid||',%')";
             }
 
             sqlp = sqlp + " group by TypeId ";
@@ -157,10 +157,10 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         {
 
             string sqlp = @"select e.name,sum(e.percentage*p.area) as earea from ElementChemistry e 
-                inner join INcAData p on e.xrayid=p.xrayid and e.fieldid = p.fieldid";
+                inner join INcAData p on e.xrayid=p.xrayid and e.fieldid = p.fieldid from IncAData where typeid !=-1 and typeid !=4";
             if (fieldAndPartic != "")
             {
-                sqlp = sqlp + " where '" + fieldAndPartic + "' like ('%,'||p.fieldid||'-'||p.particleid||',%')";
+                sqlp = sqlp + " and '" + fieldAndPartic + "' like ('%,'||p.fieldid||'-'||p.particleid||',%')";
             }
 
             sqlp = sqlp + " group by e.name  order by sum(e.percentage*p.area) desc";
@@ -187,6 +187,23 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         /// </summary>
         /// <returns></returns>
         public DataTable GetParticleAll(string fieldAndPartic)
+        {
+            string sqlp = @"select * from INcAData where typeid !=-1 and typeid !=4";
+            if (fieldAndPartic != "")
+            {
+                sqlp = sqlp + " and '" + fieldAndPartic + "' like ('%,'||fieldid||'-'||particleid||',%')";
+            }
+            DataTable DT = dbHelper.ExecuteDataTable(sqlp, null);
+            for (int i = 0; i < DT.Rows.Count; i++)
+            {
+                DT.Rows[i]["Area"] = Math.Sqrt((double)DT.Rows[i]["Area"] / Math.PI) * 2;
+            }
+
+
+            return DT;
+        }
+
+        public DataTable GetParticleAllforparticlelist(string fieldAndPartic)
         {
             string sqlp = @"select * from INcAData";
             if (fieldAndPartic != "")
@@ -229,11 +246,11 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         /// <returns></returns>
         public DataTable GetParticleAllHaveXray(string fieldAndPartic)
         {
-            string incaSql = @"select * from IncAData";
+            string incaSql = @"select * from IncAData where typeid !=-1 and typeid !=4";
 
             if (fieldAndPartic != "")
             {
-                incaSql = incaSql + " where '" + fieldAndPartic + "' like ('%,'||fieldid||'-'||particleid||',%')";
+                incaSql = incaSql + " and '" + fieldAndPartic + "' like ('%,'||fieldid||'-'||particleid||',%')";
             }
             DataTable incaDT = dbHelper.ExecuteDataTable(incaSql, null);
 
@@ -310,10 +327,10 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         /// <returns></returns>
         public DataTable GetAreaByAllIncA(string fieldAndPartic)
         {
-            string sqlp = @"select TypeId,TypeName,sum(area) as ar,count(1) as con ,GroupName from INcAData";
+            string sqlp = @"select TypeId,TypeName,sum(area) as ar,count(1) as con ,GroupName from INcAData where typeid !=-1 and typeid !=4";
             if (fieldAndPartic != "")
             {
-                sqlp = sqlp + " where '" + fieldAndPartic + "' like ('%,'||fieldid||'-'||particleid||',%')";
+                sqlp = sqlp + " and '" + fieldAndPartic + "' like ('%,'||fieldid||'-'||particleid||',%')";
             }
             sqlp = sqlp + "  group by TypeId";
 
@@ -588,7 +605,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
 
         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 and typeid !=0" +
+            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 and typeid !=4" +
                 condition;
             DataTable DT = new DataTable();
             DT = dbHelper.ExecuteQuery(sqliteString);
@@ -598,7 +615,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
 
         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 or typeid =0) " +
+            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 typeid =9 or typeid =-1 or typeid =4 " +
                 condition;
             DataTable DT = new DataTable();
             DT = dbHelper.ExecuteQuery(sqliteString);