浏览代码

1.框选内不应反选
2.分布图和信息列表选择颗粒同步显示
3.删除颗粒在分布图和信息列表选择颗粒同步
4.颗粒列表删除导入标准库选项
5.切换表和分布图同步更新窗体

cxs 1 年之前
父节点
当前提交
c5d8caa2c9

+ 0 - 53
OTSIncAReportApp/1-UI/Control_Graph/Controls/ClassDiagram1.cd

@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ClassDiagram MajorVersion="1" MinorVersion="1">
-  <Class Name="OTSIncAReportGraph.Controls.Control_DrawDistrbutionImageAndBSE">
-    <Position X="5" Y="0.75" Width="3.25" />
-    <TypeIdentifier>
-      <HashCode>hAaQzkG4PfyqAIDKxqKA2TIjPXgqkOYLIhOAcjACkIg=</HashCode>
-      <FileName>1-UI\Control_Graph\Controls\Control_DrawDistrbutionImageAndBSE.cs</FileName>
-    </TypeIdentifier>
-    <ShowAsAssociation>
-      <Field Name="imageDisHelper" />
-    </ShowAsAssociation>
-    <ShowAsCollectionAssociation>
-      <Field Name="m_CurGBFields" />
-      <Field Name="m_list_allDfield" />
-      <Field Name="m_list_allDPart" />
-    </ShowAsCollectionAssociation>
-  </Class>
-  <Class Name="OTSIncAReportGraph.OTSIncAReportGraphFuncation.OTSImageDisHelp" Collapsed="true">
-    <Position X="10.5" Y="0.75" Width="3.25" />
-    <NestedTypes>
-      <Enum Name="OTSIncAReportGraph.OTSIncAReportGraphFuncation.OTSImageDisHelp.OTS_X_AXIS_DIRECTION" Collapsed="true">
-        <TypeIdentifier>
-          <NewMemberFileName>1-UI\Control_Graph\OTSIncAReportGraphFuncation\OTSImageDisHelp.cs</NewMemberFileName>
-        </TypeIdentifier>
-      </Enum>
-      <Enum Name="OTSIncAReportGraph.OTSIncAReportGraphFuncation.OTSImageDisHelp.OTS_Y_AXIS_DIRECTION" Collapsed="true">
-        <TypeIdentifier>
-          <NewMemberFileName>1-UI\Control_Graph\OTSIncAReportGraphFuncation\OTSImageDisHelp.cs</NewMemberFileName>
-        </TypeIdentifier>
-      </Enum>
-    </NestedTypes>
-    <TypeIdentifier>
-      <HashCode>EAAIAMQAACAAAwbBAAgCSABQAggQAAAAIABIAAhCIAA=</HashCode>
-      <FileName>1-UI\Control_Graph\OTSIncAReportGraphFuncation\OTSImageDisHelp.cs</FileName>
-    </TypeIdentifier>
-  </Class>
-  <Class Name="OTSIncAReportGraph.DisplayField">
-    <Position X="0.75" Y="1.25" Width="2" />
-    <TypeIdentifier>
-      <HashCode>BACYBBAAAIACAIAgEAAAAAAMCAAkABwAAAQAAAoAIAA=</HashCode>
-      <FileName>2-CommonFunction\CommonClass\DisplayField.cs</FileName>
-    </TypeIdentifier>
-  </Class>
-  <Class Name="OTSIncAReportGraph.DisplayParticle">
-    <Position X="10.5" Y="1.5" Width="3.25" />
-    <TypeIdentifier>
-      <HashCode>gMCREZiACIZkAoCAEQAIICGfwUAAAJ8mAAYIiSgACBY=</HashCode>
-      <FileName>2-CommonFunction\CommonClass\DisplayParticle.cs</FileName>
-    </TypeIdentifier>
-    <Lollipop Position="0.2" />
-  </Class>
-  <Font Name="Microsoft YaHei UI" Size="9" />
-</ClassDiagram>

+ 38 - 23
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.cs

@@ -1054,20 +1054,20 @@ namespace OTSIncAReportGraph.Controls
                                 break;
 
                         }
-                        
+
 
                         foreach (DisplayParticle dp in m_list_allDPart)
                         {
-                            if (dp.GetPaintState() != PaintState.NOPAINT )
+                            if (dp.GetPaintState() != PaintState.NOPAINT)
                             {
                                 PointF[] lspointf = ls_gpath.PathPoints;
-                               
-                                    if (true == imageDisHelper.WhetherInRange(m_SelectTool.Rect, lspointf,new Point((int)dp.GetShowRect().X,(int)dp.GetShowRect().Y)))
-                                    {
-                                    
-                                    dp.IsSelect =!dp.IsSelect ;// set the particle to the oposite selected state
-                                    }
-                              
+
+                                if (true == imageDisHelper.WhetherInRange(m_SelectTool.Rect, lspointf, new Point((int)dp.GetShowRect().X, (int)dp.GetShowRect().Y)))
+                                {
+                                    //dp.IsSelect = !dp.IsSelect;// set the particle to the oposite selected state
+                                    dp.IsSelect = true;//框选不应反选!
+                                }
+
                             }
                         }
                     }
@@ -1151,6 +1151,8 @@ namespace OTSIncAReportGraph.Controls
                     }
                    
                 }
+
+                SetParticlesSelected();
             }
 
 
@@ -1245,10 +1247,16 @@ namespace OTSIncAReportGraph.Controls
 
 
         private void ToolStripMenuItem_selected_Click(object sender, EventArgs e)
+        {
+            frmReportApp.selectedRegion = m_SelectTool.Rect;
+            SetParticlesSelected();
+        }
+
+        void SetParticlesSelected()
         {
             List<DisplayParticle> selectedParts = new List<DisplayParticle>();
             List<Particle> Particles = new List<Particle>();
-            foreach (var dp  in m_list_allDPart)
+            foreach (var dp in m_list_allDPart)
             {
                 if (dp.IsSelect)
                 {
@@ -1259,9 +1267,6 @@ namespace OTSIncAReportGraph.Controls
                     Particles.Add(particle);
                 }
             }
-
-            frmReportApp.selectedRegion = m_SelectTool.Rect; 
-           
             SendSelectParticleListToReportFrame(selectedParts);
         }
 
@@ -1400,16 +1405,11 @@ namespace OTSIncAReportGraph.Controls
         /// </summary>
         private void SendSelectParticleListToReportFrame(List<DisplayParticle> selectParts)
         {
-            //先获取分布图中,有哪些颗粒已经被选择上了
+            frmReportApp.selectedParticles.Clear();
             foreach (var p in selectParts)
             {
-                if (!frmReportApp.selectedParticles.ContainsKey(p.guid))
-                {
-                    frmReportApp.selectedParticles.Add(p.guid, p);
-                }
-            
+                frmReportApp.selectedParticles.Add(p.guid, p);
             }
-           
         }
 
         /// <summary>
@@ -1626,9 +1626,9 @@ namespace OTSIncAReportGraph.Controls
         /// </summary>
         public void FullGraphMatch()
         {
-  
-                //全图匹配,首先要判断出来是按宽度来计算缩放,还是按高度来计算缩放
-                double thiswidth = this.Width;
+
+            //全图匹配,首先要判断出来是按宽度来计算缩放,还是按高度来计算缩放
+            double thiswidth = this.Width;
             double thisheight = this.Height;
             double imagewidth = m_backRect.Width;
             double imageheight = m_backRect.Height;
@@ -1992,6 +1992,21 @@ namespace OTSIncAReportGraph.Controls
            
         }
 
+        public void DeletesParticlesSynchronously(List<Particle> list_Part)
+        {
+            foreach (var p in m_list_allDPart)
+            {
+                foreach (var p_Selected in list_Part)
+                {
+                    if (p.ParticleId == p_Selected.ParticleId && p.FieldId == p_Selected.FieldId)
+                    {
+                        p.IsDeleted = true;
+                        break;
+                    }
+                }
+            }
+            Invalidate();
+        }
 
         private bool DeleteParticlesFromLibrary(int in_clr_tagid, int in_clr_fieldid)
         {

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

@@ -72,6 +72,7 @@
             this.ToolStripMenuItem_selected.Name = "ToolStripMenuItem_selected";
             this.ToolStripMenuItem_selected.Size = new System.Drawing.Size(210, 22);
             this.ToolStripMenuItem_selected.Text = "选择颗粒";
+            this.ToolStripMenuItem_selected.Visible = false;
             this.ToolStripMenuItem_selected.Click += new System.EventHandler(this.ToolStripMenuItem_selected_Click);
             // 
             // ToolStripMenuItem_movesempoint

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

@@ -72,7 +72,6 @@
             this.testToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.EXCELToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.ToolStripMenuItemDelete_Particle = new System.Windows.Forms.ToolStripMenuItem();
-            this.ImportSTDDb = new System.Windows.Forms.ToolStripMenuItem();
             this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
             this.dgV_ParticlesDevidePage = new System.Windows.Forms.DataGridView();
             this.panel2.SuspendLayout();
@@ -415,8 +414,7 @@
             this.ToolStripMenuItem_exportimagefile,
             this.testToolStripMenuItem,
             this.EXCELToolStripMenuItem,
-            this.ToolStripMenuItemDelete_Particle,
-            this.ImportSTDDb});
+            this.ToolStripMenuItemDelete_Particle});
             this.contextMenuStrip1.Name = "contextMenuStrip1";
             this.contextMenuStrip1.Size = new System.Drawing.Size(211, 230);
             // 
@@ -489,14 +487,6 @@
             this.ToolStripMenuItemDelete_Particle.Text = "删除颗粒";
             this.ToolStripMenuItemDelete_Particle.Click += new System.EventHandler(this.ToolStripMenuItem_Delete_Particle_Click);
             // 
-            // ImportSTDDb
-            // 
-            this.ImportSTDDb.Name = "ImportSTDDb";
-            this.ImportSTDDb.Size = new System.Drawing.Size(210, 22);
-            this.ImportSTDDb.Text = "导入标准库";
-            this.ImportSTDDb.Visible = false;
-            this.ImportSTDDb.Click += new System.EventHandler(this.ImportSTDDb_Click);
-            // 
             // tableLayoutPanel1
             // 
             this.tableLayoutPanel1.ColumnCount = 1;
@@ -593,7 +583,6 @@
         private System.Windows.Forms.ToolStripMenuItem EXCELToolStripMenuItem;
         private System.Windows.Forms.DataGridView dgV_ParticlesDevidePage;
         private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItemDelete_Particle;
-        private System.Windows.Forms.ToolStripMenuItem ImportSTDDb;
         private System.Windows.Forms.TextBox tB_FieldId;
         private System.Windows.Forms.Label label7;
         private System.Windows.Forms.TextBox tB_ParticleId;

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

@@ -346,7 +346,7 @@ namespace OTSIncAReportGrids
                     {
                         RemoveMergeParticles(ref particlesAll, mergeParticles);
                     }
-                }
+                }                                              
                 if (sel == (int)SelItem.otherParticles)
                 {
                     particlesAll = Particledata.GetInfoForPartucleDevidePage_otherParticle(condition);
@@ -2128,13 +2128,10 @@ namespace OTSIncAReportGrids
             string path = result.FilePath;
             ParticleData fielddata = new ParticleData(result.FilePath);
             List<Particle> particles = fielddata.GetParticleAllList();
-
-
-
             DialogResult dr = MessageBox.Show("Remove all these particles permanently?", "Tips", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
             if (dr == DialogResult.OK)
             {
-
+                List<Particle> list_Part = new List<Particle>();
                 for (int ii = 0; ii < dgV_ParticlesDevidePage.SelectedRows.Count; ii++)
                 {
                     //从事先加载的Bitmap对象的Tag中取出List<string>
@@ -2151,13 +2148,12 @@ namespace OTSIncAReportGrids
                             {
                                 if (DeleteParticlesFromLibrary(item.ParticleId, item.FieldId))
                                 {
-
-
                                     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);
+                                            list_Part.Add(item);
                                         }
                                     }
                                 }
@@ -2168,7 +2164,6 @@ namespace OTSIncAReportGrids
                                 break;
                             }
                         }
-
                     }
                 }
                 RecordCount = recordCount - dgV_ParticlesDevidePage.SelectedRows.Count;
@@ -2185,6 +2180,7 @@ namespace OTSIncAReportGrids
                 {
                     dgV_ParticlesDevidePage.Rows[j].Cells[0].Value = (pageSize * (PageIndex - 1) + j + 1).ToString();
                 }
+                m_ReportApp.im_Control_DrawDistrbutionImageAndBSE.DeletesParticlesSynchronously(list_Part);
             }
         }
 
@@ -2492,16 +2488,15 @@ namespace OTSIncAReportGrids
                         DataGridViewRow dgvr = SelectRows[0];
                         Bitmap ls_bp = (Bitmap)dgvr.Cells[2].Value;
                         List<string> list_str = (List<string>)ls_bp.Tag;
-                        contextMenuStrip1.Items[10].Visible = true;
                     }
                     else
                     {
-                        contextMenuStrip1.Items[10].Visible = false;
+                        //contextMenuStrip1.Items[10].Visible = false;
                     }
                 }
                 else
                 {
-                    contextMenuStrip1.Items[10].Visible = false;
+                    //contextMenuStrip1.Items[10].Visible = false;
                 }
             }
         }

+ 9 - 9
OTSIncAReportApp/1-UI/OTSDisplaySourceGridData/frmReportConditionChoose.cs

@@ -669,21 +669,21 @@ namespace OTSIncAReportApp
                             m_ReportApp.m_TablesWindow.Activate();
                             break;
                         case CALCULATE_TABLE_TYPE.PARTICALE_GENE_INFO:
-                            if (m_ReportApp.im_ParticlesGridDevidePage != null && m_ReportApp.im_ParticlesGridDevidePage.FileName == m_fileName)
-                            {
-                                m_ReportApp.m_TablesWindow.Controls.Clear();
-                                m_ReportApp.m_TablesWindow.Controls.Add(m_ReportApp.im_ParticlesGridDevidePage);
-                                m_ReportApp.m_TablesWindow.Activate();
-                            }
-                            else
-                            {
+                            //if (m_ReportApp.im_ParticlesGridDevidePage != null && m_ReportApp.im_ParticlesGridDevidePage.FileName == m_fileName)
+                            //{
+                            //    m_ReportApp.m_TablesWindow.Controls.Clear();
+                            //    m_ReportApp.m_TablesWindow.Controls.Add(m_ReportApp.im_ParticlesGridDevidePage);
+                            //    m_ReportApp.m_TablesWindow.Activate();
+                            //}
+                            //else
+                            //{
                                 m_ReportApp.m_TablesWindow.Controls.Clear();
                                 m_ReportApp.im_ParticlesGridDevidePage = new OTSIncAReportGrids.ParticlesGridDevidePage(m_ReportApp);
                                 m_ReportApp.im_ParticlesGridDevidePage.FileName = m_fileName;
                                 m_ReportApp.im_ParticlesGridDevidePage.Dock = DockStyle.Fill;
                                 m_ReportApp.m_TablesWindow.Controls.Add(m_ReportApp.im_ParticlesGridDevidePage);
                                 m_ReportApp.m_TablesWindow.Activate();
-                            }
+                            //}
                             break;
                         case CALCULATE_TABLE_TYPE.PARTICALE_COMP:
                             m_ReportApp.m_TablesWindow.Controls.Clear();

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

@@ -176,7 +176,10 @@ namespace OTSIncAReportApp
             List<Particle> parts = new List<Particle>();
             foreach (var p in selectedParticles.Values)
             {
-                parts.Add(p.objParticleData);
+                if (!p.IsDeleted)
+                {
+                    parts.Add(p.objParticleData);
+                }
             }
             return parts;
         }

+ 3 - 3
OTSIncAReportApp/1-UI/frmTables.cs

@@ -43,11 +43,11 @@ namespace OTSIncAReportApp
             //根据标签索引 显示默认的数据图表
             if (m_ReportApp.m_TablesWindow.Controls != null)
             {
-                if (m_ReportApp.m_TablesWindow.Controls.Count == 0)
-                {
+                //if (m_ReportApp.m_TablesWindow.Controls.Count == 0)
+                //{
                     m_ReportApp.m_conditionChoose.tabIndex = DisplayPicutureType.AnalyzeDataTable;
                     m_ReportApp.m_conditionChoose.ShowsTheDefaultPic();
-                }
+                //}
             }
 
             m_ReportApp.m_RstWindow.SelectWorkSampleNode();