Browse Source

1.调整颗粒总数的获取方式,优化加载速度
2.去除颗粒列表中拼接颗粒的组成颗粒信息
3.修改获取帧图总数的位置,尤IncAData表改为Field表,解决获取帧图数不准的问题;

CXS 3 years ago
parent
commit
dad632c135

+ 1 - 1
OTSCleanReportApp/DataOperation/DataAccess/FieldData.cs

@@ -133,7 +133,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             //存放查询数据的数据表
             DataTable DT = null;
 
-            string sql = "select FieldId from IncAData group by FieldId";
+            string sql = "select FieldId from Field group by FieldId";
             DT = dbHelper.ExecuteDataTable(sql, null);
             return DT.Rows.Count;
 

+ 19 - 6
OTSIncAReportApp/Control_Grids/ParticlesGridDevidePage.cs

@@ -521,13 +521,12 @@ namespace OTSIncAReportGrids
             {
                 dgV_ParticlesDevidePage.Columns.Add(ElementTypeSort[i], ElementTypeSort[i]);
             }
-
-            RecordCount = fielddata.GetAllInfo(condition).Rows.Count;
-
             double jd = 95f / (double)particles.Rows.Count;//计算进度刻度
 
             string filePath = result.FilePath + "\\FIELD_FILES\\";
             KeyValuePair<string, Bitmap> FieldImage = new KeyValuePair<string, Bitmap>();
+            int DelParticlesCount = 0;        //此值= 合成拼接颗粒的所有子颗粒数目-拼接颗粒数目 , 颗粒总数 = 所有子颗粒数目 - 合成拼接颗粒的所有子颗粒数目 + 拼接颗粒数目;
+
             for (int i = 0; i < particles.Rows.Count; i++)
             {
                 //更新进度,每100条记录加载完,更新一次进度
@@ -547,7 +546,6 @@ namespace OTSIncAReportGrids
                         if (enl.Current.Key == "rowid")
                         {
                             //dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = i + 1;
-
                         }
                         if (enl.Current.Key == "ParticleImage")
                         {
@@ -566,11 +564,26 @@ namespace OTSIncAReportGrids
                                 Bitmap bmap = fielddata.GetBitmapForBig(subt, xs, result.FilePath);
                                 if (bmap != null)
                                 {
-                                    bmap.Tag = new List<string>() { subt.Split(',')[0].Split(':')[0], subt.Split(',')[0].Split(':')[1], particles.Rows[i]["TypeId"].ToString() };
+                                    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;
+
+                                    DelParticlesCount+= str.Length-1;
+
+                                    //在颗粒总数中去除合成拼接颗粒的所有子颗粒数目
+                                    foreach (var part in str)
+                                    {
+                                        DataRow[] foundRow;
+                                        foundRow = particles.Select("fieldid = "+part.Split(':')[0]+ "and particleid = "+ part.Split(':')[1], "");
+                                        foreach (DataRow row in foundRow)
+                                        {
+                                            particles.Rows.Remove(row);
+                                        }
+                                    }
+
                                 }
                                 else
                                 {
@@ -648,7 +661,7 @@ namespace OTSIncAReportGrids
                     }
                 }
             }
-
+            RecordCount = fielddata.GetCountOfPsrticles(condition)- DelParticlesCount;
             #region 加载进度条进度部份结束
             //加载完成设置鼠标为默认
             this.Cursor = Cursors.Default;

+ 26 - 0
OTSIncAReportApp/DataOperation/DataAccess/ParticleData.cs

@@ -382,6 +382,32 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             DataTable DT = dbHelper.ExecuteQuery(sqliteString);
             return DT;
         }
+        /// <summary>
+        /// 获取合并颗粒总数
+        /// </summary>
+        /// <param name="condition"></param>
+        /// <returns></returns>
+        public int GetCountOfMergedPsrticles(string condition)
+        {
+            string sqliteString = "select count(*) from MergedParticleInfo " + condition;
+            DataTable DT = dbHelper.ExecuteQuery(sqliteString);
+            int Count = int.Parse(DT.Rows[0]["Count"].ToString());
+            return Count;
+        }
+
+        /// <summary>
+        /// 获取正常颗粒总数,包含组成合并颗粒的几个部分
+        /// </summary>
+        /// <param name="condition"></param>
+        /// <returns></returns>
+        public int GetCountOfPsrticles(string condition)
+        {
+            string sqliteString = "select count(*) from INcAData " + condition;
+            DataTable DT = dbHelper.ExecuteQuery(sqliteString);
+            int Count = int.Parse(DT.Rows[0][0].ToString());
+            return Count;
+        }
+
 
         /// <summary>
         /// 获取分页查询所需信息