Преглед изворни кода

The particle selection function has been restored

cxs пре 3 месеци
родитељ
комит
6bd97b57ae

+ 0 - 30
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.cs

@@ -2680,7 +2680,6 @@ namespace OTSIncAReportGraph.Controls
 
         public void DisplayParticleByParticlelist(List<Particle> particle)
         {
-            bool flag = true;
             foreach (var fil in m_list_allDfield)
             {
                 foreach (var p2 in particle)
@@ -2692,36 +2691,7 @@ namespace OTSIncAReportGraph.Controls
                             var dp = p;
                             if (dp.objParticleData.ParticleId == p2.ParticleId)
                             {
-                                if (flag)
-                                {
-                                    var p1 = dp.GetCenterPoint();
-                                    foreach (var item in m_list_allDfield)
-                                    {
-                                        item.DraggingPoint = p1;
-                                        item.DraggingMove(new PointF(this.Width / 2, this.Height / 2));
-                                        foreach (DisplayParticle dp1 in item.List_DParticle)
-                                        {
-
-                                            dp1.DraggingPoint = p1;
-                                            dp1.DraggingMove(new PointF(this.Width / 2, this.Height / 2));
-                                            dp1.DraggingPoint = Point.Empty;
-                                        }
-                                    }
-                                    foreach (var item in m_CurGBFields)
-                                    {
-                                        item.DraggingPoint = p1;
-                                        item.DraggingMove(new PointF(this.Width / 2, this.Height / 2));
-                                    }
-                                    m_beforedrag_pointf = p1;
-                                    //同样重新计算backrectf的坐标
-                                    m_backRect = new RectangleF(m_backRect.Location.X + this.Width / 2 - m_beforedrag_pointf.X,
-                                         m_backRect.Location.Y + this.Height / 2 - m_beforedrag_pointf.Y, m_backRect.Width, m_backRect.Height);
-
-                                    ImageZoom(2.5f, new PointF(dp.GetCenterPoint().X, dp.GetCenterPoint().Y));
-                                    flag = false;
-                                }
                                 dp.IsSelect = true;
-                                break;
                             }
                         }
                     }

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

@@ -2407,39 +2407,39 @@ namespace OTSIncAReportGrids
         }
 
 
-        //private void SaveParticleslist_select()
-        //{
-        //    ParticleData fielddata = new ParticleData(result.FilePath);
-        //    List<Particle> particles = fielddata.GetParticleAllList();
-
-        //    Particleslist_selecttodisplay.Clear();
-        //    for (int l = 0; l < dgV_ParticlesDevidePage.SelectedRows.Count; l++)
-        //    {
-        //        //从事先加载的Bitmap对象的Tag中取出List<string>
-        //        DataGridViewRow dgvr = dgV_ParticlesDevidePage.SelectedRows[l];
-        //        Bitmap ls_bp = (Bitmap)dgvr.Cells[2].Value;
-        //        List<string> list_str = (List<string>)ls_bp.Tag;
-        //        if (list_str != null)
-        //        {
-        //            int i_ls_fieldid = Convert.ToInt32(list_str[0]);
-        //            int i_ls_particleid = Convert.ToInt32(list_str[1]);
-        //            foreach (Particle item in particles)
-        //            {
-        //                if (i_ls_fieldid == item.FieldId && i_ls_particleid == item.ParticleId)
-        //                {
-        //                    Particleslist_selecttodisplay.Add(item);
-        //                    break;
-        //                }
-        //            }
-
-        //        }
-        //    }
-        //}
-
-        //public List<Particle> GetParticleslist_select()
-        //{
-        //    return Particleslist_selecttodisplay;
-        //}
+        private void SaveParticleslist_select()
+        {
+            ParticleData fielddata = new ParticleData(result.FilePath);
+            List<Particle> particles = fielddata.GetParticleAllList();
+
+            Particleslist_selecttodisplay.Clear();
+            for (int l = 0; l < dgV_ParticlesDevidePage.SelectedRows.Count; l++)
+            {
+                //从事先加载的Bitmap对象的Tag中取出List<string>
+                DataGridViewRow dgvr = dgV_ParticlesDevidePage.SelectedRows[l];
+                Bitmap ls_bp = (Bitmap)dgvr.Cells[2].Value;
+                List<string> list_str = (List<string>)ls_bp.Tag;
+                if (list_str != null)
+                {
+                    int i_ls_fieldid = Convert.ToInt32(list_str[0]);
+                    int i_ls_particleid = Convert.ToInt32(list_str[1]);
+                    foreach (Particle item in particles)
+                    {
+                        if (i_ls_fieldid == item.FieldId && i_ls_particleid == item.ParticleId)
+                        {
+                            Particleslist_selecttodisplay.Add(item);
+                            break;
+                        }
+                    }
+
+                }
+            }
+        }
+
+        public List<Particle> GetParticleslist_select()
+        {
+            return Particleslist_selecttodisplay;
+        }
 
 
 
@@ -2513,7 +2513,7 @@ namespace OTSIncAReportGrids
                     Invalidate();
                     ToolStripMenuItem_SimilarityReclassification.Enabled = true;
                 }
-                //SaveParticleslist_select();
+                SaveParticleslist_select();
             }
         }
 

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

@@ -187,7 +187,7 @@ namespace OTSIncAReportApp
                     }
                     break;
                 case (int)DisplayPicutureType.AnalyzeDataTable:
-                    //Particles = im_ParticlesGridDevidePage.GetParticleslist_select();
+                    Particles = im_ParticlesGridDevidePage.GetParticleslist_select();
                     break;
                 default:
                     break;

+ 8 - 9
OTSIncAReportApp/1-UI/frmSampleImage.cs

@@ -68,23 +68,22 @@ namespace OTSIncAReportApp
                     m_ReportApp.m_RstWindow.Activate();
                 }
             }
-
             //判断分布图,排序图全局对象是否为空,不为空的话,加载选择列表,用此来代替刷新,对颗粒列表中的选择颗粒,显示选择到分布图与排序图中
             if (m_ReportApp.im_Control_DrawDistrbutionImageAndBSE != null)
             {
-                //if (m_ReportApp.im_ParticlesGridDevidePage != null)
-                //{
-                //    //分布图显示选择颗粒
-                //    m_ReportApp.im_Control_DrawDistrbutionImageAndBSE.DisplayParticleByParticlelist(m_ReportApp.im_ParticlesGridDevidePage.GetParticleslist_select());
-                //}
+                if (m_ReportApp.im_ParticlesGridDevidePage != null)
+                {
+                    //分布图显示选择颗粒
+                    m_ReportApp.im_Control_DrawDistrbutionImageAndBSE.DisplayParticleByParticlelist(m_ReportApp.im_ParticlesGridDevidePage.GetParticleslist_select());
+                }
             }
             if (m_ReportApp.im_Control_DrawDistrbutionSortImage != null)
             {
-                //if (m_ReportApp.im_ParticlesGridDevidePage != null)
-                //{
+                if (m_ReportApp.im_ParticlesGridDevidePage != null)
+                {
                     //排序图显示选择颗粒
                     m_ReportApp.im_Control_DrawDistrbutionSortImage.SetSelectParticle(m_ReportApp.GetSelectedParticles());
-                //}
+                }
             }
 
         }