Browse Source

修复deleteparticle的bug,添加快捷键

cxs 11 tháng trước cách đây
mục cha
commit
b61d24dd10

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

@@ -824,8 +824,7 @@ namespace OTSIncAReportGraph.Controls
                     var dp = item;
                     if (imageDisHelper.WhetherInRange(dp, e.Location))
                     {
-                        dp.IsSelect = !dp.IsSelect;
-                        //ifClickOnParticle = true;
+                        dp.IsSelect = true;
                         break;
                     }
                 }
@@ -2227,6 +2226,39 @@ namespace OTSIncAReportGraph.Controls
                 frmReportApp.selectedParticles.Clear();
                 return false;
             }
+            if (keyData == Keys.Delete)
+            {
+                DialogResult dr = MessageBox.Show("Remove all these particles permanently?", "Tips", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
+                if (dr == DialogResult.OK)
+                {
+                    bool deleteflag = true;
+                    foreach (var p in m_list_allDPart)
+                    {
+                        if (p.IsSelect)
+                        {
+                            if (!DeleteParticlesFromLibrary(p.objParticleData.ParticleId, p.objParticleData.FieldId))
+                            {
+                                deleteflag = false;
+                            }
+                            p.IsDeleted = true;
+                        }
+                    }
+                        if (deleteflag)
+                        {
+                            MessageBox.Show("Deleted successfully!");
+                        }
+                        else
+                        {
+                            MessageBox.Show("Deleted failed!");
+                        }
+
+                    Invalidate();
+                }
+                else
+                {
+
+                }
+            }
             return base.ProcessDialogKey(keyData);
         }
 
@@ -2630,5 +2662,7 @@ namespace OTSIncAReportGraph.Controls
             newPart.SetORIENTATION(p.objParticleData.ORIENTATION);
             return newPart;
         }
+
+
     }
 }

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

@@ -54,10 +54,6 @@
             this.方法一ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.方法二ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.aSTMToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
-            //this.国标图导出ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            //this.方法一ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            //this.方法二ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            //this.aSTMToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
             this.contextMenuStrip_Particle = new System.Windows.Forms.ContextMenuStrip(this.components);
             this.ToolStripMenuItem_movesempoint = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripMenuItem_DeleteParticles = new System.Windows.Forms.ToolStripMenuItem();
@@ -78,19 +74,19 @@
             this.toolStripMenuItem_backgroundcombinClass,
             this.国标图导出ToolStripMenuItem});
             this.CMenuStrip.Name = "contextMenuStrip1";
-            this.CMenuStrip.Size = new System.Drawing.Size(185, 158);
+            this.CMenuStrip.Size = new System.Drawing.Size(185, 136);
             // 
             // ToolStripMenuItem_ParticleSplicing
             // 
             this.ToolStripMenuItem_ParticleSplicing.Name = "ToolStripMenuItem_ParticleSplicing";
-            this.ToolStripMenuItem_ParticleSplicing.Size = new System.Drawing.Size(213, 24);
+            this.ToolStripMenuItem_ParticleSplicing.Size = new System.Drawing.Size(184, 22);
             this.ToolStripMenuItem_ParticleSplicing.Text = "导出颗粒拼接图";
             this.ToolStripMenuItem_ParticleSplicing.Click += new System.EventHandler(this.ToolStripMenuItem_ParticleSplicing_Click);
             // 
             // toolStripMenuItem_copyimage
             // 
             this.toolStripMenuItem_copyimage.Name = "toolStripMenuItem_copyimage";
-            this.toolStripMenuItem_copyimage.Size = new System.Drawing.Size(213, 24);
+            this.toolStripMenuItem_copyimage.Size = new System.Drawing.Size(184, 22);
             this.toolStripMenuItem_copyimage.Text = "导出渲染拼接图";
             this.toolStripMenuItem_copyimage.Click += new System.EventHandler(this.toolStripMenuItem_copyimage_Click);
             // 
@@ -102,7 +98,7 @@
             this.aSTMToolStripMenuItem,
             this.清除ToolStripMenuItem});
             this.显示国标信息ToolStripMenuItem.Name = "显示国标信息ToolStripMenuItem";
-            this.显示国标信息ToolStripMenuItem.Size = new System.Drawing.Size(213, 24);
+            this.显示国标信息ToolStripMenuItem.Size = new System.Drawing.Size(184, 22);
             this.显示国标信息ToolStripMenuItem.Text = "显示国标信息";
             // 
             // toolStripMenuItem2
@@ -112,13 +108,13 @@
             this.查询DS类颗粒ToolStripMenuItem,
             this.显示当前帧国标分类ToolStripMenuItem});
             this.toolStripMenuItem2.Name = "toolStripMenuItem2";
-            this.toolStripMenuItem2.Size = new System.Drawing.Size(137, 26);
+            this.toolStripMenuItem2.Size = new System.Drawing.Size(112, 22);
             this.toolStripMenuItem2.Text = "方法一";
             // 
             // toolStripMenuItem1
             // 
             this.toolStripMenuItem1.Name = "toolStripMenuItem1";
-            this.toolStripMenuItem1.Size = new System.Drawing.Size(227, 26);
+            this.toolStripMenuItem1.Size = new System.Drawing.Size(184, 22);
             this.toolStripMenuItem1.Tag = "All1";
             this.toolStripMenuItem1.Text = "显示所有国标帧";
             this.toolStripMenuItem1.Click += new System.EventHandler(this.显示国标信息ToolStripMenuItem_Click);
@@ -126,7 +122,7 @@
             // 查询DS类颗粒ToolStripMenuItem
             // 
             this.查询DS类颗粒ToolStripMenuItem.Name = "查询DS类颗粒ToolStripMenuItem";
-            this.查询DS类颗粒ToolStripMenuItem.Size = new System.Drawing.Size(227, 26);
+            this.查询DS类颗粒ToolStripMenuItem.Size = new System.Drawing.Size(184, 22);
             this.查询DS类颗粒ToolStripMenuItem.Tag = "DS1";
             this.查询DS类颗粒ToolStripMenuItem.Text = "查询DS类颗粒";
             this.查询DS类颗粒ToolStripMenuItem.Click += new System.EventHandler(this.显示国标信息ToolStripMenuItem_Click);
@@ -140,42 +136,42 @@
             this.dToolStripMenuItem,
             this.全部ToolStripMenuItem});
             this.显示当前帧国标分类ToolStripMenuItem.Name = "显示当前帧国标分类ToolStripMenuItem";
-            this.显示当前帧国标分类ToolStripMenuItem.Size = new System.Drawing.Size(227, 26);
+            this.显示当前帧国标分类ToolStripMenuItem.Size = new System.Drawing.Size(184, 22);
             this.显示当前帧国标分类ToolStripMenuItem.Text = "高亮当前帧国标分类";
             this.显示当前帧国标分类ToolStripMenuItem.Click += new System.EventHandler(this.显示当前帧国标分类ToolStripMenuItem_Click);
             // 
             // aToolStripMenuItem
             // 
             this.aToolStripMenuItem.Name = "aToolStripMenuItem";
-            this.aToolStripMenuItem.Size = new System.Drawing.Size(122, 26);
+            this.aToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
             this.aToolStripMenuItem.Text = "A";
             this.aToolStripMenuItem.Click += new System.EventHandler(this.aToolStripMenuItem_Click);
             // 
             // bToolStripMenuItem
             // 
             this.bToolStripMenuItem.Name = "bToolStripMenuItem";
-            this.bToolStripMenuItem.Size = new System.Drawing.Size(122, 26);
+            this.bToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
             this.bToolStripMenuItem.Text = "B";
             this.bToolStripMenuItem.Click += new System.EventHandler(this.bToolStripMenuItem_Click);
             // 
             // cToolStripMenuItem
             // 
             this.cToolStripMenuItem.Name = "cToolStripMenuItem";
-            this.cToolStripMenuItem.Size = new System.Drawing.Size(122, 26);
+            this.cToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
             this.cToolStripMenuItem.Text = "C";
             this.cToolStripMenuItem.Click += new System.EventHandler(this.cToolStripMenuItem_Click);
             // 
             // dToolStripMenuItem
             // 
             this.dToolStripMenuItem.Name = "dToolStripMenuItem";
-            this.dToolStripMenuItem.Size = new System.Drawing.Size(122, 26);
+            this.dToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
             this.dToolStripMenuItem.Text = "D";
             this.dToolStripMenuItem.Click += new System.EventHandler(this.dToolStripMenuItem_Click);
             // 
             // 全部ToolStripMenuItem
             // 
             this.全部ToolStripMenuItem.Name = "全部ToolStripMenuItem";
-            this.全部ToolStripMenuItem.Size = new System.Drawing.Size(122, 26);
+            this.全部ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
             this.全部ToolStripMenuItem.Text = "全部";
             this.全部ToolStripMenuItem.Click += new System.EventHandler(this.全部ToolStripMenuItem_Click);
             // 
@@ -185,13 +181,13 @@
             this.toolStripMenuItem4,
             this.toolStripMenuItem10});
             this.toolStripMenuItem3.Name = "toolStripMenuItem3";
-            this.toolStripMenuItem3.Size = new System.Drawing.Size(137, 26);
+            this.toolStripMenuItem3.Size = new System.Drawing.Size(112, 22);
             this.toolStripMenuItem3.Text = "方法二";
             // 
             // toolStripMenuItem4
             // 
             this.toolStripMenuItem4.Name = "toolStripMenuItem4";
-            this.toolStripMenuItem4.Size = new System.Drawing.Size(197, 26);
+            this.toolStripMenuItem4.Size = new System.Drawing.Size(160, 22);
             this.toolStripMenuItem4.Tag = "All2";
             this.toolStripMenuItem4.Text = "显示所有国标帧";
             this.toolStripMenuItem4.Click += new System.EventHandler(this.显示国标信息ToolStripMenuItem_Click);
@@ -199,7 +195,7 @@
             // toolStripMenuItem10
             // 
             this.toolStripMenuItem10.Name = "toolStripMenuItem10";
-            this.toolStripMenuItem10.Size = new System.Drawing.Size(197, 26);
+            this.toolStripMenuItem10.Size = new System.Drawing.Size(160, 22);
             this.toolStripMenuItem10.Tag = "DS2";
             this.toolStripMenuItem10.Text = "查询DS类颗粒";
             this.toolStripMenuItem10.Click += new System.EventHandler(this.显示国标信息ToolStripMenuItem_Click);
@@ -209,14 +205,14 @@
             this.aSTMToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.显示所有帧ToolStripMenuItem});
             this.aSTMToolStripMenuItem.Name = "aSTMToolStripMenuItem";
-            this.aSTMToolStripMenuItem.Size = new System.Drawing.Size(137, 26);
+            this.aSTMToolStripMenuItem.Size = new System.Drawing.Size(112, 22);
             this.aSTMToolStripMenuItem.Tag = "";
             this.aSTMToolStripMenuItem.Text = "ASTM";
             // 
             // 显示所有帧ToolStripMenuItem
             // 
             this.显示所有帧ToolStripMenuItem.Name = "显示所有帧ToolStripMenuItem";
-            this.显示所有帧ToolStripMenuItem.Size = new System.Drawing.Size(167, 26);
+            this.显示所有帧ToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
             this.显示所有帧ToolStripMenuItem.Tag = "ASTMAll";
             this.显示所有帧ToolStripMenuItem.Text = "显示所有帧";
             this.显示所有帧ToolStripMenuItem.Click += new System.EventHandler(this.显示国标信息ToolStripMenuItem_Click);
@@ -224,7 +220,7 @@
             // 清除ToolStripMenuItem
             // 
             this.清除ToolStripMenuItem.Name = "清除ToolStripMenuItem";
-            this.清除ToolStripMenuItem.Size = new System.Drawing.Size(137, 26);
+            this.清除ToolStripMenuItem.Size = new System.Drawing.Size(112, 22);
             this.清除ToolStripMenuItem.Text = "清除";
             this.清除ToolStripMenuItem.Click += new System.EventHandler(this.清除ToolStripMenuItem_Click);
             // 
@@ -284,33 +280,33 @@
             this.toolStripMenuItem_Segmentation,
             this.查找相似颗粒ToolStripMenuItem});
             this.contextMenuStrip_Particle.Name = "contextMenuStrip1";
-            this.contextMenuStrip_Particle.Size = new System.Drawing.Size(246, 128);
+            this.contextMenuStrip_Particle.Size = new System.Drawing.Size(211, 92);
             // 
             // ToolStripMenuItem_movesempoint
             // 
             this.ToolStripMenuItem_movesempoint.Name = "ToolStripMenuItem_movesempoint";
-            this.ToolStripMenuItem_movesempoint.Size = new System.Drawing.Size(245, 24);
+            this.ToolStripMenuItem_movesempoint.Size = new System.Drawing.Size(210, 22);
             this.ToolStripMenuItem_movesempoint.Text = "移动SEM至颗粒所在位置";
             this.ToolStripMenuItem_movesempoint.Click += new System.EventHandler(this.ToolStripMenuItem_movesempoint_Click);
             // 
             // toolStripMenuItem_DeleteParticles
             // 
             this.toolStripMenuItem_DeleteParticles.Name = "toolStripMenuItem_DeleteParticles";
-            this.toolStripMenuItem_DeleteParticles.Size = new System.Drawing.Size(245, 24);
+            this.toolStripMenuItem_DeleteParticles.Size = new System.Drawing.Size(210, 22);
             this.toolStripMenuItem_DeleteParticles.Text = "Delete particles";
             this.toolStripMenuItem_DeleteParticles.Click += new System.EventHandler(this.ToolStripMenuItemDelete_Particle_Click);
             // 
             // toolStripMenuItem_Segmentation
             // 
             this.toolStripMenuItem_Segmentation.Name = "toolStripMenuItem_Segmentation";
-            this.toolStripMenuItem_Segmentation.Size = new System.Drawing.Size(245, 24);
+            this.toolStripMenuItem_Segmentation.Size = new System.Drawing.Size(210, 22);
             this.toolStripMenuItem_Segmentation.Text = "分割颗粒";
             this.toolStripMenuItem_Segmentation.Click += new System.EventHandler(this.toolStripMenuItem_Segmentation_Click);
             // 
             // 查找相似颗粒ToolStripMenuItem
             // 
             this.查找相似颗粒ToolStripMenuItem.Name = "查找相似颗粒ToolStripMenuItem";
-            this.查找相似颗粒ToolStripMenuItem.Size = new System.Drawing.Size(245, 24);
+            this.查找相似颗粒ToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
             this.查找相似颗粒ToolStripMenuItem.Text = "查找相似颗粒";
             this.查找相似颗粒ToolStripMenuItem.Click += new System.EventHandler(this.查找相似颗粒ToolStripMenuItem_Click);
             //