Ver código fonte

restore the DATASOURCE_TYPE chosen function.

gsp 4 anos atrás
pai
commit
3c759ce2ce

+ 5 - 5
Bin/x64/Debug/Resources/XMLData/AppResource_ZH.xml

@@ -758,8 +758,8 @@
  <Form>
    <Name>Control_DrawDistrbutionImageAndBSE</Name>
     <Controls>
-      <Control name="ToolStripMenuItem_selected" text="选颗粒" />
-      <Control name="ToolStripMenuItem_delete" text="删除颗粒" />
+          <Control name="ToolStripMenuItem_selected" text="选中这些颗粒" />
+          <Control name="ToolStripMenuItem_delete" text="排除这些颗粒" />
 	  <Control name="另存选择颗粒ToolStripMenuItem" text="另存为" />
 	  <Control name="ToolStripMenuItem_movesempoint" text="移动SEM到当前位置" />
 	  <Control name="toolStripMenuItem_copyimage" text="复制图像" />
@@ -768,9 +768,9 @@
 	  <Control name="str3" text="SEM位置:" />
 	  <Control name="str4" text="灰度#:" />
 	  <Control name="str5" text="撤销" />
-	  <Control name="str6" text="选颗粒" />
+	  <Control name="str6" text="选中这些颗粒" />
 	  <Control name="str7" text="视域位置:" />
-	  <Control name="str8" text="复制图像" />
+	  <Control name="str8" text="复制当前屏幕图像" />
 	  <Control name="str9" text="移动SEM到当前位置" />
 	  <Control name="str10" text="移动SEM到颗粒视域位置" />
     </Controls>
@@ -779,7 +779,7 @@
    <Name>Control_DrawDistrbutionSortImage</Name>
     <Controls>
       <Control name="ToolStripMenuItem_selected" text="选择颗粒" />
-      <Control name="ToolStripMenuItem_delete" text="除颗粒" />
+      <Control name="ToolStripMenuItem_delete" text="除颗粒" />
 	  <Control name="另存选择颗粒ToolStripMenuItem" text="另存为" />
 	  <Control name="ToolStripMenuItem_movesempoint" text="移动SEM到当前位置" />
 	  <Control name="toolStripMenuItem_copyimage" text="复制图像" />

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

@@ -117,7 +117,7 @@ namespace OTSIncAReportApp.Control_ECharts
             string filedAndParticl = "";
             if (sel == 1)
             {
-                List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.SelectedParticles;
+                List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.GetSelectedParticles();
                 foreach (var item in selectParticles)
                 {
                     filedAndParticl = filedAndParticl + "," + (item.FieldId.ToString() + "-" + item.ParticleId.ToString());
@@ -212,7 +212,7 @@ namespace OTSIncAReportApp.Control_ECharts
             string filedAndParticl = "";
             if (sel == 1)
             {
-                List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.SelectedParticles;
+                List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.GetSelectedParticles();
                 foreach (var item in selectParticles)
                 {
                     filedAndParticl = filedAndParticl + "," + (item.FieldId.ToString() + "-" + item.ParticleId.ToString());
@@ -302,7 +302,7 @@ namespace OTSIncAReportApp.Control_ECharts
             string filedAndParticl = "";
             if (sel == 1)
             {
-                List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.SelectedParticles;
+                List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.GetSelectedParticles();
                 foreach (var item in selectParticles)
                 {
                     filedAndParticl = filedAndParticl + "," + (item.FieldId.ToString() + "-" + item.ParticleId.ToString());
@@ -392,7 +392,7 @@ namespace OTSIncAReportApp.Control_ECharts
             string filedAndParticl = "";
             if (sel == 1)
             {
-                List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.SelectedParticles;
+                List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.GetSelectedParticles();
                 foreach (var item in selectParticles)
                 {
                     filedAndParticl = filedAndParticl + "," + (item.FieldId.ToString() + "-" + item.ParticleId.ToString());
@@ -495,7 +495,7 @@ namespace OTSIncAReportApp.Control_ECharts
             string filedAndParticl = "";
             if (sel == 1)
             {
-                List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.SelectedParticles;
+                List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.GetSelectedParticles();
                 foreach (var item in selectParticles)
                 {
                     filedAndParticl = filedAndParticl + "," + (item.FieldId.ToString() + "-" + item.ParticleId.ToString());

+ 1 - 1
OTSIncAReportApp/1-UI/Control_ECharts/EChart_Trianglediagram.cs

@@ -236,7 +236,7 @@ namespace OTSIncAReportApp.Control_ECharts
             string filedAndParticl = "";
             if (sel == 1)
             {
-                List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.SelectedParticles;
+                List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.GetSelectedParticles();
                 foreach (var item in selectParticles)
                 {
                     filedAndParticl = filedAndParticl + "," + (item.FieldId.ToString() + "-" + item.ParticleId.ToString());

+ 142 - 270
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.cs

@@ -1,4 +1,5 @@
 using NLog;
+using OTSIncAReportApp;
 using OTSIncAReportApp.DataOperation.DataAccess;
 using OTSIncAReportApp.DataOperation.Model;
 using OTSIncAReportApp.OTSSampleReportInfo;
@@ -36,6 +37,14 @@ namespace OTSIncAReportGraph.Controls
         //进行选择的矩形范围
        public RectangleF Rect ;
 
+    }
+    public enum RightButtonMenu
+    { 
+       Include=0,
+      
+       MoveSEMToParticle=1,
+       CopyImage=2
+    
     }
     public partial class Control_DrawDistrbutionImageAndBSE : UserControl
     {
@@ -142,13 +151,13 @@ namespace OTSIncAReportGraph.Controls
         private Thread m_mythread;
 
         //记录线程是否已经运行完成的状态
-        private bool m_mythread_state = false;
+        //private bool m_mythread_state = false;
 
         private Color m_ColorNotContent = Color.SkyBlue;
 
         //读取背景原图的名称和图片
-        private List<Image> originalImages = new List<Image>();
-        private List<string> originalImageNames = new List<string>();
+        private Dictionary<string, Image> originalImages = new Dictionary<string, Image>();
+        //private List<string> originalImageNames = new List<string>();
         //背景使用原图
         private bool OriginalBackground = false;
 
@@ -211,7 +220,7 @@ namespace OTSIncAReportGraph.Controls
          
             m_frm_userprogress = new Frm_UserProgress();
             
-            m_mythread_state = false;
+            //m_mythread_state = false;
 
             m_mythread = new Thread(new ParameterizedThreadStart(Thread_GO));
             
@@ -466,50 +475,8 @@ namespace OTSIncAReportGraph.Controls
             ReportFun.m_field_count = fieldlist.Count;
             ReportFun.m_particle_count = m_list_allDPart.Count;
         }
-        /// <summary>
-        /// 根据颗粒排序图获取已经选择上的颗粒,返回被选择上的颗粒的列表
-        /// </summary>
-        /// <returns></returns>
-        public List<Particle> GetSelectedParticleList_ForDrawDistrbutionImageAndBSE()
-        {
-            List<Particle> list_particle = new List<Particle>();
-
-            //防止为空校验判断
-            if (resultFile.List_OTSField == null)
-                return list_particle;
-
-            //先取出,所有被选择的dparticle列表的
-            List<DisplayParticle> list_selectedDp = new List<DisplayParticle>();
-            foreach (DisplayParticle ls_dp in m_list_allDPart)
-            {
-                if (ls_dp.IsSelect)
-                {
-                    list_selectedDp.Add(ls_dp);
-                }
-            }
-
-            //并开始查找包含tagid和fieldid的cotsparticle的对象,保存到list当中
-            for (int i = 0; i < list_selectedDp.Count(); i++)
-            {
-                for (int j = 0; j < resultFile.List_OTSField.Count(); j++)
-                {
-                    //先获取该field中的所有particle
-                    List<Particle> list_cotsparticleclr = new List<Particle>();
-                    list_cotsparticleclr =resultFile.List_OTSField[j].ParticleList;
-
-                    for (int k = 0; k < list_cotsparticleclr.Count(); k++)
-                    {
-                        if (list_cotsparticleclr[k].ParticleId == list_selectedDp[i].ParticleId
-                            && list_cotsparticleclr[k].FieldId == list_selectedDp[i].FieldId)
-                        {
-                            list_particle.Add(list_cotsparticleclr[k]);
-                        }
-                    }
-                }
-            }
-
-            return list_particle;
-        }
+  
+       
         /// <summary>
         /// 分布图和BSE图中,从底层获取相关结果后,重新组织显示
         /// </summary>
@@ -520,7 +487,7 @@ namespace OTSIncAReportGraph.Controls
             bool stdIdconditionResult;
             string stdId = "";
             int stdIdIndex = 0;
-            //find the std condition
+            //find the stdId condition
             var STDIdItm = sourceGridData.ConditionItemList.Find(s => s.iItemId == OTS_REPORT_PROP_GRID_ITEMS.STD_ID);
             if (STDIdItm != null)
             {
@@ -608,11 +575,11 @@ namespace OTSIncAReportGraph.Controls
                 }
                 if (stdIdconditionResult && sizeconditionResult)
                 {
-                    ls_dp.DisplayState = DisplayState.DISPLAY;
+                    ls_dp.SetDisplayState(DisplayState.DISPLAY);
                 }
                 else
                 {
-                    ls_dp.DisplayState = DisplayState.NODISPLAY;
+                    ls_dp.SetDisplayState(DisplayState.NODISPLAY);
 
                 }
                 
@@ -917,27 +884,40 @@ namespace OTSIncAReportGraph.Controls
                     m_SelectTool.StartPoint = e.Location;
                 }
                 else
-                { 
-              
+                {
+                    bool ifClickOnParticle=false;
                     foreach (BaseObject item in m_list_allDPart)
                     {
                         var dp = (DisplayParticle)item;
-                        if (dp.Rect.Left > -120 && dp.Rect.Right < this.Width + 120 && dp.Rect.Top > -120 && dp.Rect.Bottom < this.Height + 120)
+                        if (ReportFun.WhetherInRange(dp, e.Location))
                         {
-                            item.IsDragging = true;
-                            
+                            dp.IsSelect = !dp.IsSelect;
+                            ifClickOnParticle = true;
+                            break;
                         }
-                        item.DraggingPoint = e.Location;
+                    }
+                    if (ifClickOnParticle == false)
+                    { 
+                        foreach (BaseObject item in m_list_allDPart)
+                        {
+                            var dp = (DisplayParticle)item;
+                            if (dp.Rect.Left > -120 && dp.Rect.Right < this.Width + 120 && dp.Rect.Top > -120 && dp.Rect.Bottom < this.Height + 120)
+                            {
+                                item.IsDragging = true;
+                            
+                            }
+                            item.DraggingPoint = e.Location;
 
 
+                        }
+                        foreach (DisplayField item in m_list_allDfield)
+                        {
+                            item.IsDragging = true;
+                            item.DraggingPoint = e.Location;
+                        }
+                        m_isDrag = true;
+                        m_beforedrag_pointf = e.Location;
                     }
-                    foreach (DisplayField item in m_list_allDfield)
-                    {
-                        item.IsDragging = true;
-                        item.DraggingPoint = e.Location;
-                    }
-                    m_isDrag = true;
-                    m_beforedrag_pointf = e.Location;
 
                 }
             }
@@ -1120,19 +1100,12 @@ namespace OTSIncAReportGraph.Controls
             if (e.Button == MouseButtons.Left)
             {
                 this.Cursor = Cursors.Default;
-                //还原多选变量
+               
                 if (m_SelectTool.IsSelecting)
                 {
                    
-                    foreach (DisplayParticle dp in m_list_allDPart)
-                    {
-                        if (dp.IsSelect)
-                        {
-                            dp.SetPaintState(PaintState.NORMALPAINT);
-                        }
-                    }
-                    //然后在这里判断都有哪些颗粒所有的point点,是否在选取的图形graphicsPath闭合路径中
-                    //首先先将选取的图形填充成graphicsPath
+         
+                  
                     if (m_SelectTool.Rect.Width > 0 && m_SelectTool.Rect.Height > 0)
                     {
                         GraphicsPath ls_gpath = new GraphicsPath();
@@ -1152,14 +1125,14 @@ namespace OTSIncAReportGraph.Controls
                       
                         foreach (DisplayParticle dp in m_list_allDPart)
                         {
-                            if (dp.GetPaintState() != PaintState.NOPAINT && !dp.IsDeleted)//不显示的和删除状态的不让进行选择
+                            if (dp.GetPaintState() != PaintState.NOPAINT )
                             {
                                 PointF[] lspointf = ls_gpath.PathPoints;
                                
                                     if (true == ReportFun.WhetherInRange(m_SelectTool.Rect, lspointf,new Point((int)dp.Rect.X,(int)dp.Rect.Y)))
                                     {
-                                    //选择到了该路径,那么就选取该图像
-                                    dp.IsSelect = true;
+                                    
+                                    dp.IsSelect =!dp.IsSelect ;// set the particle to the opsite selected state
                                     }
                               
                             }
@@ -1170,10 +1143,7 @@ namespace OTSIncAReportGraph.Controls
                     m_SelectTool.Rect.Width = 0;
                     m_SelectTool.Rect.Height = 0;
                     m_SelectTool.IsSelecting = false;
-                   
 
-                    //将多选选择上的颗粒发送给报告框架
-                    SelectParticleListSendToReportFrame();
                 }
                 else
                 {
@@ -1221,92 +1191,58 @@ namespace OTSIncAReportGraph.Controls
                         m_isDrag = false;
 
                     }
-                    else
-                    { //在颗粒上点击,则对该颗粒附加显示x-ray的状态,同时将其它颗粒上显示x-ray的状态全部去掉。
-                        foreach (DisplayParticle dp in m_list_allDPart)
-                        {
-                            PointF[] lspointf = dp.GPath.PathPoints;
-                            if (true == ReportFun.WhetherInRange(dp, new Point(e.X, e.Y)))
-                            {
-                                //选择到了该路径,那么就选取该图像b
-                                dp.Operator_ShowXRay = ParticleShowXray.SELECTANDDISPLAYXRAY;
-                            }
-                            else
-                            {
-                                dp.Operator_ShowXRay = ParticleShowXray.NODISPLAY;
-                            }
-                        }
-                    }
+                   
                 }
             }
 
-            //右键菜单控件
-            CMenuStrip.Items[0].Tag = "";
-            CMenuStrip.Items[0].Enabled = false;
-            CMenuStrip.Items[1].Tag = "";
-            CMenuStrip.Items[1].Enabled = false;
-            CMenuStrip.Items[2].Tag = "";
-            CMenuStrip.Items[2].Enabled = false;
-            CMenuStrip.Items[3].Tag = "";
-            CMenuStrip.Items[3].Enabled = false;
-            CMenuStrip.Items[4].Tag = "";
-            CMenuStrip.Items[4].Enabled = false;
 
             if (e.Button == MouseButtons.Right)
             {
-                //线程未执行完成,则不让再进行选择,右键移动到SEM位置的菜单选项
-                if (m_mythread_state == false)
-                    CMenuStrip.Items[4].Enabled = true;
-                else
-                    CMenuStrip.Items[4].Enabled = false;
+           
+                
+                bool ifClickOnParticle=false;
+                bool ifThereIsSelectedParticle = false;
 
-                //这个判断右键菜单加在这里,也不知道对不对
+               
                 foreach (BaseObject item in m_list_allDPart)
                 {
                     if (true == ReportFun.WhetherInRange((DisplayParticle)item, e.Location))
                     {
-                        DisplayParticle dp = (DisplayParticle)item;
-                        CMenuStrip.Items[0].Enabled = true;
-                        CMenuStrip.Items[0].Tag = dp;
-
-                        CMenuStrip.Items[1].Enabled = true;
-                        if (dp.IsSelect)
-                        {
-                            CMenuStrip.Items[1].Text = table["str5"].ToString();
-                        }
-                        else
-                        {
-                            CMenuStrip.Items[1].Text = table["str6"].ToString();
-                        }
-
-                        CMenuStrip.Items[2].Enabled = true;
-                        CMenuStrip.Items[3].Enabled = true;
+                        ifClickOnParticle = true;
+                        CMenuStrip.Items[(int)RightButtonMenu.Include].Visible = false;
+                       
+                        CMenuStrip.Items[(int)RightButtonMenu.CopyImage].Visible = false;
+                        CMenuStrip.Items[(int)RightButtonMenu.MoveSEMToParticle].Visible = true;
+                        CMenuStrip.Items[(int)RightButtonMenu.MoveSEMToParticle].Tag = item;
+                    }
+                    if (((DisplayParticle)item).IsSelect)
+                    {
+                        ifThereIsSelectedParticle = true;
+                    }
+                }
+                if (ifClickOnParticle == false)
+                {
+                    if (ifThereIsSelectedParticle)
+                    {
 
-           
+                        CMenuStrip.Items[(int)RightButtonMenu.Include].Visible = true;
+                       
+                       
+                    }
+                    else
+                    {
+                        CMenuStrip.Items[(int)RightButtonMenu.Include].Visible = false;
+                       
+                       
 
-                        m_sem_mouse_now_point = new Point(dp.SEMPosX, dp.SEMPosY);
-                        //获取颜色方法1,使用API来获取当前鼠标指向位置的颜色值-----------------------------------------------------
-                        Color ls_c = GetColorByMousePoint(e.X, e.Y);
-                        m_str_mouseshow_right = "灰度#" + ls_c.R.ToString();
-                        m_str_mouseshow_left = "颗粒SEM位置:" + dp.SEMPosX.ToString() + ":" + dp.SEMPosY.ToString();
+                    }
+                    CMenuStrip.Items[(int)RightButtonMenu.CopyImage].Visible = true;
 
-                        m_ReportApp.mouseMatter.Text = m_str_mouseshow_right;
-                        m_ReportApp.RSGrayVal.Text = m_str_mouseshow_left;
+                    CMenuStrip.Items[(int)RightButtonMenu.MoveSEMToParticle].Visible = false;
 
-                    }
-                }
 
-                //判断菜单的状态,来判断当前鼠标是否在颗粒中,对菜单选项进行设置
-                if (CMenuStrip.Items[1].Enabled == true)
-                {
-                    CMenuStrip.Items[4].Visible = false;//暂时隐藏
-                    CMenuStrip.Items[4].Text = table["str8"].ToString();
-                }
-                else
-                {
-                    CMenuStrip.Items[4].Visible = true;//去除隐藏
-                    CMenuStrip.Items[4].Text = table["str8"].ToString();
                 }
+                      
 
             }
 
@@ -1318,74 +1254,34 @@ namespace OTSIncAReportGraph.Controls
         private void ToolStripMenuItem_id_Click(object sender, EventArgs e)
         {
             //ID
-            DisplayParticle dp = (DisplayParticle)CMenuStrip.Items[0].Tag;
-            MessageBox.Show(dp.guid.ToString());
+            //DisplayParticle dp = (DisplayParticle)CMenuStrip.Items[0].Tag;
+            //MessageBox.Show(dp.guid.ToString());
         }
 
 
         //是否显示过小颗菜单
         private void ToolStripMenuItem_ShowSmallParticle_Click(object sender, EventArgs e)
         {
-            if (bShowSmallParticle == false)
-            {
-                bShowSmallParticle = true;
-                CMenuStrip.Items[7].Text = table["str8"].ToString();
-            }
-            else
-            {
-                bShowSmallParticle = false;
-                CMenuStrip.Items[7].Text = table["str9"].ToString();
-            }
-
-        
-            //缩放的基数,临时变量
-            m_Zoom_Base = 0;
-            //与原先缩放的记录数
-            m_zoom_record = 1;
-     
-        
-            //每像素代表的尺寸大小,还不知道在哪里进行计算
-            m_pixelSize = 4.5f;
-            //提供鼠标在右下角显示的文本,左侧
-            m_str_mouseshow_left = "";
-            //提供鼠标在右下角显示的文本,右侧
-            m_str_mouseshow_right = "";
-            //整个背景矩形的背景色
-            m_backrangecolor = Color.White;
-
-
-            m_list_allDfield = new List<DisplayField>();
-   
-            m_list_allDPart = new List<BaseObject>();
- 
-            m_frm_userprogress = new Frm_UserProgress();
-
-            m_mythread_state = false;
-
-            m_mythread = new Thread(new ParameterizedThreadStart(Thread_GO));
-
-            Control_DrawDistrbutionImageAndBSE_Load(null, null);
+           
         }
 
 
         private void ToolStripMenuItem_selected_Click(object sender, EventArgs e)
         {
-            //选择
-            DisplayParticle dp = (DisplayParticle)CMenuStrip.Items[0].Tag;
-            if (dp.IsSelect)
+            List<DisplayParticle> selectedParts = new List<DisplayParticle>();
+            foreach (var dp  in m_list_allDPart)
             {
-                dp.SetPaintState(PaintState.NORMALPAINT);
-                CMenuStrip.Items[1].Text = table["str6"].ToString();
-                control_XRayTable1.Visible = false;
-            }
-            else
-            {
-                dp.IsSelect = true ;
-                CMenuStrip.Items[1].Text = table["str5"].ToString();
+                if (dp.IsSelect)
+                {
+                    selectedParts.Add((DisplayParticle)dp);
+                  
+                }
+              
             }
+          
 
-            //发送选择的颗粒到报告框架中
-            SelectParticleListSendToReportFrame();
+           
+            SendSelectParticleListToReportFrame(selectedParts);
         }
 
         /// <summary>
@@ -1504,10 +1400,18 @@ namespace OTSIncAReportGraph.Controls
         /// <summary>
         /// 封装,将分布图中的颗粒list传送给报告项目框架中
         /// </summary>
-        private void SelectParticleListSendToReportFrame()
+        private void SendSelectParticleListToReportFrame(List<DisplayParticle> selectParts)
         {
             //先获取分布图中,有哪些颗粒已经被选择上了
-            m_ReportApp.SelectedParticles = GetSelectedParticleList_ForDrawDistrbutionImageAndBSE();
+            foreach (var p in selectParts)
+            {
+                if (!frmReportApp.selectedParticles.ContainsKey(p.guid))
+                {
+                    frmReportApp.selectedParticles.Add(p.guid, p);
+                }
+            
+            }
+           
         }
 
         /// <summary>
@@ -1545,19 +1449,24 @@ namespace OTSIncAReportGraph.Controls
 
         private void ToolStripMenuItem_delete_Click(object sender, EventArgs e)
         {
-            //删除颗粒
-            DisplayParticle dp = (DisplayParticle)CMenuStrip.Items[0].Tag;
-
-            //同样,要在历史操作记录类中,添加记录,好可以进行撤消操作
-            //HistoryApolygon hApolygon = new HistoryApolygon();
-            //hApolygon.APolygonID = dp.guid;
-            //hApolygon.IsDeleted = true;
-            //hApolygon.OldOperator = dp.displayState;
-            //hApolygon.ID = m_list_historyapolygon.Count;
-            //m_list_historyapolygon.Add(hApolygon);
-            //m_operator_currentid = hApolygon.ID;//当前操作到的历史操作记录
-            //设置颗粒的状态为已经被删除
-            dp.SetPaintState(PaintState.NOPAINT);
+            List<DisplayParticle> selectedParts = new List<DisplayParticle>();
+            foreach (var obj in m_list_allDPart)
+            {
+              var  dp = (DisplayParticle)obj;
+                if (dp.IsSelect)
+                {
+                    dp.IsDeleted = true;
+                }
+                else 
+                {
+                    selectedParts.Add(dp);
+                }
+   
+              
+
+            }
+            SendSelectParticleListToReportFrame(selectedParts);
+           
         }
 
         //复制图像
@@ -1610,9 +1519,7 @@ namespace OTSIncAReportGraph.Controls
         /// </summary>
         private void Thread_GO(object in_obj)
         {
-            if (m_mythread_state == false)
-            {
-                m_mythread_state = true;
+      
 
                 Point sem_point = (Point)in_obj;
 
@@ -1634,10 +1541,7 @@ namespace OTSIncAReportGraph.Controls
                 //第三步,断开电镜连接
                 ReportFun.DisConnectSEM();
 
-                //Thread.Sleep(1000);
-
-                m_mythread_state = false;
-            }
+               
 
         }
 
@@ -1649,7 +1553,7 @@ namespace OTSIncAReportGraph.Controls
         {
             FilterParticleByOtherCondition(in_griddata);
             Invalidate();
-      
+            this.Refresh();
         }
 
         /// <summary>
@@ -1881,7 +1785,7 @@ namespace OTSIncAReportGraph.Controls
             }
 
             //将排列图选择的颗粒传送给报告框架中
-            SelectParticleListSendToReportFrame();
+            //SendSelectParticleListToReportFrame();
 
             this.Invalidate();
         }
@@ -1898,14 +1802,13 @@ namespace OTSIncAReportGraph.Controls
                 
             }
 
-            //将排列图选择的颗粒传送给报告框架中
-            SelectParticleListSendToReportFrame();
+          
 
             this.Invalidate();
         }
 
 
-
+        
 
         /// <summary>
         /// 将整个图像拷贝到内存中
@@ -1959,7 +1862,7 @@ namespace OTSIncAReportGraph.Controls
                 OriginalBackground = true;
                 foreach (DisplayParticle ls_dp in m_list_allDPart)
                 {
-                    ls_dp.DisplayState = DisplayState.NODISPLAY;
+                    ls_dp.SetDisplayState(DisplayState.NODISPLAY);
                 }
                 FullGraphMatch();
             }
@@ -2008,51 +1911,20 @@ namespace OTSIncAReportGraph.Controls
         /// <returns></returns>
         private void GetPic(PaintEventArgs args)
         {
-            //将原图读取到内存中
-            if (originalImages.Count == 0)
-            {
-                string path = resultFile.FilePath;
-                System.IO.DirectoryInfo theFolder = new System.IO.DirectoryInfo(path + "\\FIELD_FILES");
-                foreach (System.IO.FileInfo nextifile in theFolder.GetFiles())
-                {
-                    if (nextifile.Name.Contains(".bmp") == true || nextifile.Name.Contains(".BMP") == true)
-                    {
-                        Image image = Image.FromFile(path + "\\FIELD_FILES\\" + nextifile.Name);
-                        originalImageNames.Add(nextifile.Name);
-                        originalImages.Add(image);
-                    }
-                }
-            }
-            //绘制原图的大小和位置
-            if (m_list_allDfield.Count > 0)
-            {
-                if (originalImageNames.Count > 0)
-                {
-                    for (int i = 0; i < originalImageNames.Count; i++)
-                    {
-                        Size size = new Size();
-                        string ImageName = originalImageNames[i].ToString();
-                        Image Image = originalImages[i];
-                        string result = System.Text.RegularExpressions.Regex.Replace(ImageName, @"[^0-9]+", "");
-                        var curfldrec = m_list_allDfield[Convert.ToInt32(result)].Current_Rect;
-                        size.Height = (int)curfldrec.Height;
-                        size.Width = (int)curfldrec.Width;
-                        PointF pointF = new PointF();
-                        pointF.X =curfldrec.X;
-                        pointF.Y = curfldrec.Y;
-
-                        if (curfldrec.Left > -500 && curfldrec.Right <this.Width + 500 && curfldrec.Top > -500 && curfldrec.Bottom < this.Height + 500)
-                        {
 
+                    foreach (var f in m_list_allDfield)
+                    {
 
-                            Bitmap bitmap = new Bitmap(Image, size);
+                        var curfldrec = f.Current_Rect;
+                        if (curfldrec.Left > -1000 && curfldrec.Right <this.Width + 1000 && curfldrec.Top > -1000 && curfldrec.Bottom < this.Height + 1000)
+                        {
 
 
-                            args.Graphics.DrawImage(bitmap, pointF);
+                     
+                            args.Graphics.DrawImage(f.OriginalImage, f.Current_Rect.X, f.Current_Rect.Y, f.Current_Rect.Width, f.Current_Rect.Height);
                         }
                     }
-                }
-            }
+          
         }
 
         

+ 2 - 41
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.designer.cs

@@ -28,15 +28,11 @@
         /// </summary>
         private void InitializeComponent()
         {
-          
             this.components = new System.ComponentModel.Container();
             this.CMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
-            this.ToolStripMenuItem_id = new System.Windows.Forms.ToolStripMenuItem();
             this.ToolStripMenuItem_selected = new System.Windows.Forms.ToolStripMenuItem();
-            this.ToolStripMenuItem_delete = new System.Windows.Forms.ToolStripMenuItem();
             this.ToolStripMenuItem_movesempoint = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripMenuItem_copyimage = new System.Windows.Forms.ToolStripMenuItem();
-            this.ToolStripMenuItem_ShowSmallParticle = new System.Windows.Forms.ToolStripMenuItem();
             this.CMenuStrip.SuspendLayout();
             this.SuspendLayout();
             // 
@@ -44,22 +40,11 @@
             // 
             this.CMenuStrip.ImageScalingSize = new System.Drawing.Size(24, 24);
             this.CMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.ToolStripMenuItem_id,
             this.ToolStripMenuItem_selected,
-            this.ToolStripMenuItem_delete,
             this.ToolStripMenuItem_movesempoint,
-            this.toolStripMenuItem_copyimage,
-            this.ToolStripMenuItem_ShowSmallParticle});
+            this.toolStripMenuItem_copyimage});
             this.CMenuStrip.Name = "contextMenuStrip1";
-            this.CMenuStrip.Size = new System.Drawing.Size(219, 184);
-            // 
-            // ToolStripMenuItem_id
-            // 
-            this.ToolStripMenuItem_id.Name = "ToolStripMenuItem_id";
-            this.ToolStripMenuItem_id.Size = new System.Drawing.Size(218, 30);
-            this.ToolStripMenuItem_id.Text = "ID";
-            this.ToolStripMenuItem_id.Visible = false;
-            this.ToolStripMenuItem_id.Click += new System.EventHandler(this.ToolStripMenuItem_id_Click);
+            this.CMenuStrip.Size = new System.Drawing.Size(219, 94);
             // 
             // ToolStripMenuItem_selected
             // 
@@ -69,14 +54,6 @@
             this.ToolStripMenuItem_selected.Text = "选择颗粒";
             this.ToolStripMenuItem_selected.Click += new System.EventHandler(this.ToolStripMenuItem_selected_Click);
             // 
-            // ToolStripMenuItem_delete
-            // 
-            this.ToolStripMenuItem_delete.Image = global::OTSIncAReportApp.Properties.Resources.删除颗粒;
-            this.ToolStripMenuItem_delete.Name = "ToolStripMenuItem_delete";
-            this.ToolStripMenuItem_delete.Size = new System.Drawing.Size(218, 30);
-            this.ToolStripMenuItem_delete.Text = "删除";
-            this.ToolStripMenuItem_delete.Click += new System.EventHandler(this.ToolStripMenuItem_delete_Click);
-            // 
             // ToolStripMenuItem_movesempoint
             // 
             this.ToolStripMenuItem_movesempoint.Image = global::OTSIncAReportApp.Properties.Resources.移动SEM到当前位置;
@@ -93,23 +70,10 @@
             this.toolStripMenuItem_copyimage.Text = "复制图像";
             this.toolStripMenuItem_copyimage.Click += new System.EventHandler(this.toolStripMenuItem_copyimage_Click);
             // 
-            // ToolStripMenuItem_ShowSmallParticle
-            // 
-            this.ToolStripMenuItem_ShowSmallParticle.Name = "ToolStripMenuItem_ShowSmallParticle";
-            this.ToolStripMenuItem_ShowSmallParticle.Size = new System.Drawing.Size(218, 30);
-            this.ToolStripMenuItem_ShowSmallParticle.Text = "显示过小颗粒";
-            this.ToolStripMenuItem_ShowSmallParticle.Visible = false;
-            this.ToolStripMenuItem_ShowSmallParticle.Click += new System.EventHandler(this.ToolStripMenuItem_ShowSmallParticle_Click);
-            // control_XRayTable1
-            // 
-
-            // 
-            // 
             // Control_DrawDistrbutionImageAndBSE
             // 
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
             this.ContextMenuStrip = this.CMenuStrip;
-          
             this.Name = "Control_DrawDistrbutionImageAndBSE";
             this.Size = new System.Drawing.Size(1204, 781);
             this.Load += new System.EventHandler(this.Control_DrawDistrbutionImageAndBSE_Load);
@@ -123,12 +87,9 @@
 
         private Control_XRayTable control_XRayTable1;
         private System.Windows.Forms.ContextMenuStrip CMenuStrip;
-        private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem_id;
         private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem_selected;
-        private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem_delete;
         private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem_movesempoint;
         private Control_Ruler control_Ruler1;
         private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem_copyimage;
-        private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem_ShowSmallParticle;
     }
 }

+ 3 - 4
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionSortImage.cs

@@ -600,7 +600,7 @@ namespace OTSIncAReportGraph.Controls
                 
 
                     //将排列图选择的颗粒传送给报告框架中
-                    SelectParticleListSendToReportFrame();
+                    //SelectParticleListSendToReportFrame();
                 }
                 else //is draging
                 {
@@ -1042,7 +1042,7 @@ namespace OTSIncAReportGraph.Controls
         private void SelectParticleListSendToReportFrame()
         {
             //先获取排列图中,有哪些颗粒已经被选择上了
-            m_ReportApp.SelectedParticles = GetSelectedParticleList_ForDrawDistrbutionSortImage();
+            //m_ReportApp.SetSelectedParticles(GetSelectedParticleList_ForDrawDistrbutionSortImage());
         }
 
         /// <summary>
@@ -1383,8 +1383,7 @@ namespace OTSIncAReportGraph.Controls
                 }
             }
 
-            //将排列图选择的颗粒传送给报告框架中
-            SelectParticleListSendToReportFrame();
+          
 
             this.Invalidate();
         }

+ 2 - 2
OTSIncAReportApp/1-UI/Control_Graph/OTSIncAReportGraphFuncation/SortParticleDistribution.cs

@@ -195,7 +195,7 @@ namespace OTSIncAReportGraph
                 foreach (DisplayParticle ls_del_dp in list_dp1)
                 {
                     //通过包含的线,获取多边形的尺寸大小
-                    ls_del_dp.FSize = ls_del_dp.GetSizeFormSegmentsAllWidth();
+                    ls_del_dp.FSize = ls_del_dp.GetAreaFormSegments();
 
                     if (f_max_size < ls_del_dp.FSize)
                     {
@@ -264,7 +264,7 @@ namespace OTSIncAReportGraph
                 foreach (DisplayParticle ls_del_dp in list_dp1)
                 {
                     //通过包含的线,获取多边形的尺寸大小
-                    ls_del_dp.FSize = ls_del_dp.GetSizeFormSegmentsAllWidth();
+                    ls_del_dp.FSize = ls_del_dp.GetAreaFormSegments();
 
                     if (f_min_size > ls_del_dp.FSize)
                     {

+ 1 - 1
OTSIncAReportApp/1-UI/Control_Grids/CompositionDistributionGrid.cs

@@ -99,7 +99,7 @@ namespace OTSIncAReportGrids
             string filedAndParticl = "";
             if (sel == 1)
             {
-                List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.SelectedParticles;
+                List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.GetSelectedParticles();
                 foreach (var item in selectParticles)
                 {
                     filedAndParticl = filedAndParticl + "," + (item.FieldId.ToString() + "-" + item.ParticleId.ToString());

+ 1 - 1
OTSIncAReportApp/1-UI/Control_Grids/ElementCompositionAvgGrid.cs

@@ -63,7 +63,7 @@ namespace OTSIncAReportGrids
             string filedAndParticl = "";
             if (sel == 1)
             {
-                List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.SelectedParticles;
+                List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.GetSelectedParticles();
                 foreach (var item in selectParticles)
                 {
                     filedAndParticl = filedAndParticl + "," + (item.FieldId.ToString() + "-" + item.ParticleId.ToString());

+ 1 - 1
OTSIncAReportApp/1-UI/Control_Grids/ElementContentGrid.cs

@@ -57,7 +57,7 @@ namespace OTSIncAReportGrids
             string filedAndParticle = "";
             if (sel == 1)
             {
-                List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.SelectedParticles;
+                List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.GetSelectedParticles();
                 foreach (var item in selectParticles)
                 {
                     filedAndParticle = filedAndParticle + "," + (item.FieldId.ToString() + "-" + item.ParticleId.ToString());

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

@@ -1015,7 +1015,7 @@ namespace OTSIncAReportGrids
 
                 }
             }
-            m_ReportApp.SelectedParticles = ls_list_cotsparticleclr;
+            m_ReportApp.SetSelectedParticles(ls_list_cotsparticleclr);
             string str1 = table["str1"].ToString();
             //然后循环得出,list cotsparticleclr列表,返回给框架
             //m_sec.SendCall(str1, "", "", ls_list_cotsparticleclr);

+ 1 - 1
OTSIncAReportApp/1-UI/Control_Grids/ParticlesSizeGrid.cs

@@ -91,7 +91,7 @@ namespace OTSIncAReportGrids
             string filedAndParticl = "";
             if (sel == 1)
             {
-                List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.SelectedParticles;
+                List<OTSIncAReportApp.DataOperation.Model.Particle> selectParticles = m_ReportApp.GetSelectedParticles();
                 foreach (var item in selectParticles)
                 {
                     filedAndParticl = filedAndParticl + "," + (item.FieldId.ToString() + "-" + item.ParticleId.ToString());

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

@@ -44,6 +44,11 @@ namespace OTSIncAReportApp.OTSSampleReportInfo
         ORIGINALCLASSIFIED=3
 
     }
+    public enum DATASOURCE_TYPE
+    { 
+        ALL=0,
+        SELECTED=1
+    }
     public enum CALCULATE_TABLE_TYPE
     {
         INVALID = -1,

+ 25 - 11
OTSIncAReportApp/1-UI/OTSDisplaySourceGridData/frmReportConditionChoose.cs

@@ -79,9 +79,21 @@ namespace OTSIncAReportApp
             sampleData.comboDownList = list_source_str;
             sampleData.itemVal = m_rstDataMgr.GetWorkingResult();
             m_CurrentConditions.Add(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE,sampleData);
-
+            //数据源类型,全部 or selected
+            List<string> list_sourcetype = new List<string>() { "全部颗粒","选择颗粒" };
+            //string sSCaptionName1 = resTable["sscaptionname1"].ToString();
+            ConditionItem sampleDatatype = new ConditionItem();
+            sampleDatatype.iItemId = OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE;
+            sampleDatatype.sSCaptionName = "数据源类型";
+            sampleDatatype.iItemValType = OTS_ITEM_TYPES.COMBO;
+            sampleDatatype.bReadOnly = false;
+            sampleDatatype.sDescriptionInfo = "data source type";
+            sampleDatatype.itemDisplayVal = list_sourcetype[(int)DATASOURCE_TYPE.ALL];
+            sampleDatatype.comboDownList = list_sourcetype;
+            sampleDatatype.itemVal = DATASOURCE_TYPE.ALL;
+            m_CurrentConditions.Add(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE, sampleDatatype);
             //测量图类别 分布图 or 排列图
-           
+
             string sSCaptionName3 = resTable["sscaptionname3"].ToString();
             string sscaptionname14 = resTable["sscaptionname14"].ToString();
             string sscaptionname15 = resTable["sscaptionname15"].ToString();
@@ -472,10 +484,11 @@ namespace OTSIncAReportApp
                 sampleData = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE];
                 list.Add(sampleData);
 
-
+               var sampleData1 = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE];
+                list.Add(sampleData1);
 
                 //数据表类型
- 
+
                 var sampleData3 = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.CALCULATE_TABLE_TYPE];
                 list.Add(sampleData3);
                 if ((int)sampleData3.itemVal == (int)CALCULATE_TABLE_TYPE.PARTICALE_SIZE_DISTRIBUTION )
@@ -510,10 +523,11 @@ namespace OTSIncAReportApp
                 sampleData = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE];
                 list.Add(sampleData);
 
-
+                var sampleData1 = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE];
+                list.Add(sampleData1);
 
                 //数据图类型
-      
+
                 var sampleData3 = m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.CALCULATE_CHART_TYPE];
                 list.Add(sampleData3);
                 if ((int)sampleData3.itemVal == (int)CALCULATE_CHART_TYPE.PARTICALE_SIZE_DISTRIBUTION)
@@ -608,7 +622,7 @@ namespace OTSIncAReportApp
                            
                             m_ReportApp.m_SImageWindow.Activate();
                             m_ReportApp.im_Control_DrawDistrbutionImageAndBSE.DrawDistrbutionImageAndBSE_ByQuery(m_SourceGridData);
-                            m_ReportApp.im_Control_DrawDistrbutionImageAndBSE.SetSelectParticle(m_ReportApp.SelectedParticles);
+                            m_ReportApp.im_Control_DrawDistrbutionImageAndBSE.SetSelectParticle(m_ReportApp.GetSelectedParticles());
 
                             ConditionItem imgType =m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.IMAGE_TYPE];
                             //切换分布图显示方式
@@ -628,7 +642,7 @@ namespace OTSIncAReportApp
                             m_ReportApp.m_SImageWindow.Controls.Add(m_ReportApp.im_Control_DrawDistrbutionImageAndBSE);
                             m_ReportApp.m_SImageWindow.Activate();
                             m_ReportApp.im_Control_DrawDistrbutionImageAndBSE.DrawDistrbutionImageAndBSE_ByQuery(m_SourceGridData);
-                            m_ReportApp.im_Control_DrawDistrbutionImageAndBSE.SetSelectParticle(m_ReportApp.SelectedParticles);
+                            m_ReportApp.im_Control_DrawDistrbutionImageAndBSE.SetSelectParticle(m_ReportApp.GetSelectedParticles());
                             m_ReportApp.im_Control_DrawDistrbutionImageAndBSE.FullGraphMatch();
                         }
 
@@ -655,13 +669,13 @@ namespace OTSIncAReportApp
                             m_ReportApp.m_SImageWindow.Controls.Add(m_ReportApp.im_Control_DrawDistrbutionSortImage);
                             m_ReportApp.m_SImageWindow.Activate();
                             m_ReportApp.im_Control_DrawDistrbutionSortImage.GetDistrbutionSortimage_ByQuery(m_CurrentConditions);
-                            m_ReportApp.im_Control_DrawDistrbutionSortImage.SetSelectParticle(m_ReportApp.SelectedParticles);
+                            m_ReportApp.im_Control_DrawDistrbutionSortImage.SetSelectParticle(m_ReportApp.GetSelectedParticles());
 
                             //判断当前点击测量结果中的数据源名,是否与已经加载的排序图显示的数据源名相同
                             if (m_fileName == m_ReportApp.im_Control_DrawDistrbutionSortImage.ShowSourceName)
                             {
                                 //相同,加载计算条件
-                                m_ReportApp.im_Control_DrawDistrbutionSortImage.SetSelectParticle(m_ReportApp.SelectedParticles);
+                                m_ReportApp.im_Control_DrawDistrbutionSortImage.SetSelectParticle(m_ReportApp.GetSelectedParticles());
 
                                 ConditionItem itm =m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.IMAGE_TYPE];
                                 //切换BSE和分类,两种影像的显示方式
@@ -686,7 +700,7 @@ namespace OTSIncAReportApp
                             m_ReportApp.m_SImageWindow.Controls.Add(m_ReportApp.im_Control_DrawDistrbutionSortImage);
                             m_ReportApp.m_SImageWindow.Activate();
                             m_ReportApp.im_Control_DrawDistrbutionSortImage.GetDistrbutionSortimage_ByQuery(m_CurrentConditions);
-                            m_ReportApp.im_Control_DrawDistrbutionSortImage.SetSelectParticle(m_ReportApp.SelectedParticles);
+                            m_ReportApp.im_Control_DrawDistrbutionSortImage.SetSelectParticle(m_ReportApp.GetSelectedParticles());
                         }
                     }
 

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

@@ -1,10 +1,12 @@
 using CefSharp;
 using CefSharp.WinForms;
 using OTS.WinFormsUI.Docking;
+using OTSIncAReportApp.DataOperation.Model;
 using OTSIncAReportApp.OTSDataMgrFunction;
 using OTSIncAReportApp.OTSRibbon;
 using OTSIncAReportApp.OTSSampleReportInfo;
 using OTSIncAReportApp.SysMgrTools;
+using OTSIncAReportGraph;
 using OTSIncAReprotCharts;
 
 using System;
@@ -41,17 +43,17 @@ namespace OTSIncAReportApp
         public OTSRibbonFun m_RibbonFun = null;                                             //报告菜单相关操作类
         public string m_OTSReportMgrParamFile = ResultDataMgr.m_ReportMgrParamFile; //报告对应使用的参数文件名
 
-                                                                                   //测量结果ID
-       
-      
-                                                                                  //当前工作结果
+        //测量结果ID
+
+
+        //当前工作结果
+
+
+
+
+        public static Dictionary<Guid, DisplayParticle> selectedParticles = new Dictionary<Guid, DisplayParticle>();     //所有选择颗粒
 
-        
-    
-   
-        public List<DataOperation.Model.Particle> SelectedParticles = new List<DataOperation.Model.Particle>();     //所有选择颗粒
 
-        
         public string MoreSource = "";
 
         Hashtable table;                                                                                            //国际化表
@@ -156,6 +158,36 @@ namespace OTSIncAReportApp
         /// </summary>
         public OTSIncAReportGB.DINStandardABCDDS im_DINStandardABCDDS = null;
 
+        public List<Particle> GetSelectedParticles()
+        {
+            List<Particle> parts = new List<Particle>();
+            foreach (var p in selectedParticles.Values)
+            {
+                parts.Add(p.objParticleData);
+            }
+            return parts;
+        }
+
+        public void SetSelectedParticles(List<Particle> value)
+        {
+            foreach (var p in im_Control_DrawDistrbutionImageAndBSE.m_list_allDPart)
+            {
+                var dp = (p as DisplayParticle);
+                foreach (var p2 in value)
+                {
+                    if (dp.objParticleData.FieldId == p2.FieldId)
+                    {
+                        if (dp.objParticleData.ParticleId == p2.ParticleId)
+                        {
+                            dp.IsSelect = true;
+                        }
+                    }
+                }
+              
+            }
+           
+        }
+
         #endregion //--------------------------------------------------------------------------------------------
 
 
@@ -241,7 +273,7 @@ namespace OTSIncAReportApp
             m_conditionChoose = new frmReportConditionChoose(this);
 
             //初始化图形组件中返回的颗粒列表对象
-            SelectedParticles = new List<DataOperation.Model.Particle>();
+            //SetSelectedParticles(new List<DataOperation.Model.Particle>());
 
 
             //分布图,排列图窗体
@@ -595,7 +627,7 @@ namespace OTSIncAReportApp
                             m_SImageWindow.Activate();
                             im_Control_DrawDistrbutionImageAndBSE.ShowSourceName = "";
                             im_Control_DrawDistrbutionImageAndBSE.DrawDistrbutionImageAndBSE_ByQuery(m_conditionChoose.m_SourceGridData);
-                            im_Control_DrawDistrbutionImageAndBSE.SetSelectParticle(SelectedParticles);
+                            im_Control_DrawDistrbutionImageAndBSE.SetSelectParticle(GetSelectedParticles());
                             //并删除排列图
                             im_Control_DrawDistrbutionSortImage = null;
                         }
@@ -615,7 +647,7 @@ namespace OTSIncAReportApp
                             m_SImageWindow.Activate();
                             im_Control_DrawDistrbutionSortImage.ShowSourceName = "";
                             im_Control_DrawDistrbutionSortImage.GetDistrbutionSortimage_ByQuery(m_conditionChoose.m_CurrentConditions);
-                            im_Control_DrawDistrbutionSortImage.SetSelectParticle(SelectedParticles);
+                            im_Control_DrawDistrbutionSortImage.SetSelectParticle(GetSelectedParticles());
                         }
                     }
                     break;
@@ -773,6 +805,7 @@ namespace OTSIncAReportApp
                         {
                             //分布图
                             im_Control_DrawDistrbutionImageAndBSE.DeselectAllParticle();
+                            selectedParticles.Clear();
                         }
                     }
                     else
@@ -780,6 +813,7 @@ namespace OTSIncAReportApp
                         if (im_Control_DrawDistrbutionSortImage != null)
                         {
                             im_Control_DrawDistrbutionSortImage.DeselectAllParticle();
+                            selectedParticles.Clear();
                         }
                     }
                     break;

+ 2 - 2
OTSIncAReportApp/1-UI/frmSampleImage.cs

@@ -66,12 +66,12 @@ namespace OTSIncAReportApp
             if (m_ReportApp.im_Control_DrawDistrbutionImageAndBSE != null)
             {
                 //分布图显示选择颗粒
-                m_ReportApp.im_Control_DrawDistrbutionImageAndBSE.SetSelectParticle(m_ReportApp.SelectedParticles);
+                m_ReportApp.im_Control_DrawDistrbutionImageAndBSE.SetSelectParticle(m_ReportApp.GetSelectedParticles());
             }
             if (m_ReportApp.im_Control_DrawDistrbutionSortImage != null)
             {
                 //排序图显示选择颗粒
-                m_ReportApp.im_Control_DrawDistrbutionSortImage.SetSelectParticle(m_ReportApp.SelectedParticles);
+                m_ReportApp.im_Control_DrawDistrbutionSortImage.SetSelectParticle(m_ReportApp.GetSelectedParticles());
             }
 
         }

+ 4 - 2
OTSIncAReportApp/2-CommonFunction/CommonClass/DisplayField.cs

@@ -34,6 +34,7 @@ namespace OTSIncAReportGraph
         private bool m_IsSelect;
         private Color m_color;
         private GraphicsPath m_GPath;
+        private Bitmap m_originalImage;
 
         /// <summary>
         /// 构造函数
@@ -54,7 +55,7 @@ namespace OTSIncAReportGraph
             list_particle = fld.ParticleList;
 
             //然后将取出的数据,转换成Bitmap对象
-            Bitmap fieldbitmap = DrawFunction.ReadImageFile(fld.FieldImage);
+            m_originalImage = DrawFunction.ReadImageFile(fld.FieldImage);
 
             //再循环计算所有的Particle对象
             foreach (Particle particle in list_particle)
@@ -99,7 +100,7 @@ namespace OTSIncAReportGraph
                      
                         int lsjs_y = seg.Height;
                    
-                        ls_list_colors.Add(fieldbitmap.GetPixel(lsjs_x,
+                        ls_list_colors.Add(m_originalImage.GetPixel(lsjs_x,
                            lsjs_y));
                     }
                     //保存原BSE图中的颜色列表
@@ -231,6 +232,7 @@ namespace OTSIncAReportGraph
         public override bool IsSelect { get => m_IsSelect; set => m_IsSelect = value; }
         public override Color Color { get => m_color; set => m_color = value; }
         public override GraphicsPath GPath { get => m_GPath; set => m_GPath = value; }
+        public Bitmap OriginalImage { get => m_originalImage; set => m_originalImage = value; }
 
         public override void OnPaint(PaintEventArgs e)
         {

+ 16 - 3
OTSIncAReportApp/2-CommonFunction/CommonClass/DisplayParticle.cs

@@ -334,7 +334,7 @@ namespace OTSIncAReportGraph
         /// </summary>
         public PaintState GetPaintState()
         {
-            if (m_displayState == DisplayState.NODISPLAY)
+            if (GetDisplayState() == DisplayState.NODISPLAY)
             {
                 m_paintState = PaintState.NOPAINT;
             }
@@ -508,7 +508,20 @@ namespace OTSIncAReportGraph
 
         public bool IsDeleted { get => m_isDeleted; set => m_isDeleted = value; }
         public bool IsMouseOver { get => m_isMouseOver; set => m_isMouseOver = value; }
-        public DisplayState DisplayState { get => m_displayState; set => m_displayState = value; }
+
+        public DisplayState GetDisplayState()
+        {
+            if (m_isDeleted)
+            {
+                m_displayState = DisplayState.NODISPLAY;
+            }
+            return m_displayState;
+        }
+
+        public void SetDisplayState(DisplayState value)
+        {
+            m_displayState = value;
+        }
 
 
 
@@ -690,7 +703,7 @@ namespace OTSIncAReportGraph
         /// 根据该多边形所有包含的线长度,计算出,该多边形的面积大小
         /// </summary>
         /// <returns></returns>
-        public float GetSizeFormSegmentsAllWidth()
+        public float GetAreaFormSegments()
         {
             float f_size_sum = 0;