Browse Source

更新优化报告程序删除颗粒代码

zhangjiaxin 3 years ago
parent
commit
4b4e3d05b0

+ 9 - 8
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.cs

@@ -1021,7 +1021,7 @@ namespace OTSIncAReportGraph.Controls
                             {
                                 dp.IsMouseOver = true;
 
-                               
+
                                 //显示x-ray能谱图 
                                 if (control_XRayTable1.Visible == false)
                                     ShowXRay(dp);
@@ -1370,13 +1370,13 @@ namespace OTSIncAReportGraph.Controls
         {
             if (m_mouseOver_dparticle == null)
                 return;
-           if (m_mouseOver_dparticle.guid == in_dparticle.guid)
+            if (m_mouseOver_dparticle.guid == in_dparticle.guid || m_mouseOver_dparticle.IsDeleted==true)
             {
                 //如果是刚才移动过的颗粒的话,那么这里再对xray进行隐藏
                 control_XRayTable1.Visible = false;
                 delaytimer.Enabled = false;
             }
-          
+
         }
 
 
@@ -2059,11 +2059,12 @@ namespace OTSIncAReportGraph.Controls
                 {
                     MessageBox.Show("Deleted successfully");
 
-                    
-                    FieldData fieldData = new FieldData(resultFile.FilePath);
-                    List<Field> fieldlist = fieldData.GetFieldList();
-                    m_ReportApp.m_rstDataMgr.CurResultFile.List_OTSField = fieldlist;
-                    LoadUpdateDisplay();
+
+                    m_mouseOver_dparticle.IsDeleted=true;
+                    //FieldData fieldData = new FieldData(resultFile.FilePath);
+                    //List<Field> fieldlist = fieldData.GetFieldList();
+                    //m_ReportApp.m_rstDataMgr.CurResultFile.List_OTSField = fieldlist;
+                    //LoadUpdateDisplay();
                 }
                else
                 {

+ 24 - 6
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage.cs

@@ -237,6 +237,11 @@ namespace OTSIncAReportGrids
             
         }
         private void ParticlesGridDevidePage_Load(object sender, EventArgs e)
+        {
+
+            UpdateLoad();
+        }
+        private void UpdateLoad()
         {
             if (!Init())
             {
@@ -248,7 +253,7 @@ namespace OTSIncAReportGrids
             {
                 return;
             }
-
+           
             cbB_PageSize.Items.Add("20");
             cbB_PageSize.Items.Add("100");
             cbB_PageSize.Items.Add("500");
@@ -256,11 +261,9 @@ namespace OTSIncAReportGrids
             cbB_PageSize.Items.Add("5000");
             cbB_PageSize.Items.Add("All");
             cbB_PageSize.SelectedIndex = 0;
-
         }
-
         #region 自定义方法
-       
+
         bool UpdateTable()
         {
             int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
@@ -1574,8 +1577,7 @@ namespace OTSIncAReportGrids
                 DrawControl(true);
             }
         }
-
-        private void cbB_PageSize_SelectedIndexChanged(object sender, EventArgs e)
+        private void DisplayData()
         {
             if (cbB_PageSize.SelectedItem.ToString() == "All")
             {
@@ -1589,6 +1591,11 @@ namespace OTSIncAReportGrids
             SetDataGridViewStyle();
         }
 
+        private void cbB_PageSize_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            DisplayData();
+        }
+
         /// <summary>
         /// 在帧图上标记颗粒的位置矩形,并保存到FIELD_FILES_MARK文件夹中
         /// </summary>
@@ -1938,6 +1945,17 @@ namespace OTSIncAReportGrids
                             if (ReportFun.DeleteParticlesFromLibrary(item.ParticleId, item.FieldId))
                             {
                                 MessageBox.Show("Deleted successfully");
+                                
+                                for (int i=0;i< particlesAll.Rows.Count;i++)
+                                {
+                                    if (particlesAll.Rows[i]["Fieldid"].ToString()== item.FieldId.ToString() && particlesAll.Rows[i]["Particleid"].ToString()==item.ParticleId.ToString())
+                                    {
+                                        particlesAll.Rows.RemoveAt(i);
+                                    }
+                                }
+
+                                DisplayData();
+
                             }
                             else
                             {