Przeglądaj źródła

分布图 分割 contextMenuStrip

cxs 1 rok temu
rodzic
commit
d3f581cc6d

+ 11 - 45
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.cs

@@ -49,11 +49,8 @@ namespace OTSIncAReportGraph.Controls
     }
     public enum RightButtonMenu
     { 
-       MoveSEMToParticle=0,
-       CopyImage=1,
-       OriginalSplicing= 2,
-       DeleteParticle=4,       
-	   ParticleSegmentation=5
+       CopyImage=0,
+       OriginalSplicing= 1
     }
     /// <summary>
     /// 选择导出的图片是原图还是颗粒渲染后的图片
@@ -1162,26 +1159,20 @@ namespace OTSIncAReportGraph.Controls
                        
                         CMenuStrip.Items[(int)RightButtonMenu.CopyImage].Visible = false;
                         CMenuStrip.Items[(int)RightButtonMenu.OriginalSplicing].Visible = false;
-                        CMenuStrip.Items[(int)RightButtonMenu.DeleteParticle].Visible = true;
-                  
-
-                        CMenuStrip.Items[(int)RightButtonMenu.MoveSEMToParticle].Visible = true;
-                        CMenuStrip.Items[(int)RightButtonMenu.MoveSEMToParticle].Tag = item;
+                        contextMenuStrip_Particle.Visible = true;
+                        contextMenuStrip_Particle.Show(this, e.Location);
+                        ToolStripMenuItem_movesempoint.Tag = item;
 
                         DisplayParticle dp = (DisplayParticle)item;
-                     
-                        CMenuStrip.Items[(int)RightButtonMenu.ParticleSegmentation].Visible = true;
                         m_ParticleSegmentation.ParticleData = dp.objParticleData;
                     }
                 }
                 if (ifClickOnParticle == false)
                 {
-                    CMenuStrip.Items[(int)RightButtonMenu.DeleteParticle].Visible = false;
+                    contextMenuStrip_Particle.Visible = false;
                 
                     CMenuStrip.Items[(int)RightButtonMenu.CopyImage].Visible = true;
                     CMenuStrip.Items[(int)RightButtonMenu.OriginalSplicing].Visible = true;
-                    CMenuStrip.Items[(int)RightButtonMenu.MoveSEMToParticle].Visible = false;
-                    CMenuStrip.Items[(int)RightButtonMenu.ParticleSegmentation].Visible = false;
                 }
                 var m_RptConfigFile = RptConfigFile.GetRptConfig();         //报表程序的配置文件
                 if (m_RptConfigFile.Systype == OTS_SysType_ID.CleannessA)
@@ -1404,29 +1395,6 @@ namespace OTSIncAReportGraph.Controls
             }
         }
 
-
-        private void ToolStripMenuItem_delete_Click(object sender, EventArgs e)
-        {
-            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);
-           
-        }
-
         //复制图像
         private void toolStripMenuItem_copyimage_Click(object sender, EventArgs e)
         {
@@ -2056,13 +2024,6 @@ namespace OTSIncAReportGraph.Controls
             return x;
         }
 
-    
-
-        private void 分割颗粒ToolStripMenuItem_Click(object sender, EventArgs e)
-        {
-            Particle_Segmentation();
-        }
-
         private void ImportSTDDb_Click(object sender, EventArgs e)
         {
             //Dictionary<string, object> sampleMembers = ((Dictionary<string, object>)((Dictionary<string, object>)resultFile.ResultInfo["Sample"])["Members"]);
@@ -2299,5 +2260,10 @@ namespace OTSIncAReportGraph.Controls
             }
             return base.ProcessDialogKey(keyData);
         }
+
+        private void toolStripMenuItem_Segmentation_Click(object sender, EventArgs e)
+        {
+            Particle_Segmentation();
+        }
     }
 }

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

@@ -30,13 +30,9 @@
         {
             this.components = new System.ComponentModel.Container();
             this.CMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
-            this.ToolStripMenuItem_movesempoint = new System.Windows.Forms.ToolStripMenuItem();
             this.ToolStripMenuItem_ParticleSplicing = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripMenuItem_copyimage = new System.Windows.Forms.ToolStripMenuItem();
             this.ExportoriginalspliceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.ToolStripMenuItemDelete_Particle = new System.Windows.Forms.ToolStripMenuItem();
-            this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.ImportSTDDb = new System.Windows.Forms.ToolStripMenuItem();
             this.显示国标信息ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
@@ -47,74 +43,46 @@
             this.aSTMToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.显示所有帧ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.清除ToolStripMenuItem = 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();
+            this.toolStripMenuItem_Segmentation = new System.Windows.Forms.ToolStripMenuItem();
             this.CMenuStrip.SuspendLayout();
+            this.contextMenuStrip_Particle.SuspendLayout();
             this.SuspendLayout();
             // 
             // CMenuStrip
             // 
             this.CMenuStrip.ImageScalingSize = new System.Drawing.Size(24, 24);
             this.CMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.ToolStripMenuItem_movesempoint,
             this.ToolStripMenuItem_ParticleSplicing,
             this.toolStripMenuItem_copyimage,
             this.ExportoriginalspliceToolStripMenuItem,
-            this.ToolStripMenuItemDelete_Particle,
-            this.ToolStripMenuItem,
-            this.ImportSTDDb,
             this.显示国标信息ToolStripMenuItem});
             this.CMenuStrip.Name = "contextMenuStrip1";
-            this.CMenuStrip.Size = new System.Drawing.Size(211, 202);
-            // 
-            // ToolStripMenuItem_movesempoint
-            // 
-            this.ToolStripMenuItem_movesempoint.Name = "ToolStripMenuItem_movesempoint";
-            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);
+            this.CMenuStrip.Size = new System.Drawing.Size(185, 114);
             // 
             // ToolStripMenuItem_ParticleSplicing
             // 
             this.ToolStripMenuItem_ParticleSplicing.Name = "ToolStripMenuItem_ParticleSplicing";
-            this.ToolStripMenuItem_ParticleSplicing.Size = new System.Drawing.Size(210, 22);
+            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(210, 22);
+            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);
             // 
             // ExportoriginalspliceToolStripMenuItem
             // 
             this.ExportoriginalspliceToolStripMenuItem.Name = "ExportoriginalspliceToolStripMenuItem";
-            this.ExportoriginalspliceToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
+            this.ExportoriginalspliceToolStripMenuItem.Size = new System.Drawing.Size(184, 22);
             this.ExportoriginalspliceToolStripMenuItem.Text = "导出原图拼接分类图";
             this.ExportoriginalspliceToolStripMenuItem.Click += new System.EventHandler(this.ExportoriginalspliceToolStripMenuItem_Click);
             // 
-            // ToolStripMenuItemDelete_Particle
-            // 
-            this.ToolStripMenuItemDelete_Particle.Name = "ToolStripMenuItemDelete_Particle";
-            this.ToolStripMenuItemDelete_Particle.Size = new System.Drawing.Size(210, 22);
-            this.ToolStripMenuItemDelete_Particle.Text = "Delete particles";
-            this.ToolStripMenuItemDelete_Particle.Click += new System.EventHandler(this.ToolStripMenuItemDelete_Particle_Click);
-            // 
-            // ToolStripMenuItem
-            // 
-            this.ToolStripMenuItem.Name = "ToolStripMenuItem";
-            this.ToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
-            this.ToolStripMenuItem.Text = "分割颗粒";
-            this.ToolStripMenuItem.Click += new System.EventHandler(this.分割颗粒ToolStripMenuItem_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);
-            // 
             // 显示国标信息ToolStripMenuItem
             // 
             this.显示国标信息ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -123,7 +91,7 @@
             this.aSTMToolStripMenuItem,
             this.清除ToolStripMenuItem});
             this.显示国标信息ToolStripMenuItem.Name = "显示国标信息ToolStripMenuItem";
-            this.显示国标信息ToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
+            this.显示国标信息ToolStripMenuItem.Size = new System.Drawing.Size(184, 22);
             this.显示国标信息ToolStripMenuItem.Text = "显示国标信息";
             // 
             // toolStripMenuItem2
@@ -132,7 +100,7 @@
             this.toolStripMenuItem1,
             this.查询DS类颗粒ToolStripMenuItem});
             this.toolStripMenuItem2.Name = "toolStripMenuItem2";
-            this.toolStripMenuItem2.Size = new System.Drawing.Size(112, 22);
+            this.toolStripMenuItem2.Size = new System.Drawing.Size(180, 22);
             this.toolStripMenuItem2.Text = "方法一";
             // 
             // toolStripMenuItem1
@@ -157,7 +125,7 @@
             this.toolStripMenuItem4,
             this.toolStripMenuItem10});
             this.toolStripMenuItem3.Name = "toolStripMenuItem3";
-            this.toolStripMenuItem3.Size = new System.Drawing.Size(112, 22);
+            this.toolStripMenuItem3.Size = new System.Drawing.Size(180, 22);
             this.toolStripMenuItem3.Text = "方法二";
             // 
             // toolStripMenuItem4
@@ -181,7 +149,7 @@
             this.aSTMToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.显示所有帧ToolStripMenuItem});
             this.aSTMToolStripMenuItem.Name = "aSTMToolStripMenuItem";
-            this.aSTMToolStripMenuItem.Size = new System.Drawing.Size(112, 22);
+            this.aSTMToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
             this.aSTMToolStripMenuItem.Tag = "";
             this.aSTMToolStripMenuItem.Text = "ASTM";
             // 
@@ -196,10 +164,41 @@
             // 清除ToolStripMenuItem
             // 
             this.清除ToolStripMenuItem.Name = "清除ToolStripMenuItem";
-            this.清除ToolStripMenuItem.Size = new System.Drawing.Size(112, 22);
+            this.清除ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
             this.清除ToolStripMenuItem.Text = "清除";
             this.清除ToolStripMenuItem.Click += new System.EventHandler(this.清除ToolStripMenuItem_Click);
             // 
+            // contextMenuStrip_Particle
+            // 
+            this.contextMenuStrip_Particle.ImageScalingSize = new System.Drawing.Size(24, 24);
+            this.contextMenuStrip_Particle.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.ToolStripMenuItem_movesempoint,
+            this.toolStripMenuItem_DeleteParticles,
+            this.toolStripMenuItem_Segmentation});
+            this.contextMenuStrip_Particle.Name = "contextMenuStrip1";
+            this.contextMenuStrip_Particle.Size = new System.Drawing.Size(211, 70);
+            // 
+            // ToolStripMenuItem_movesempoint
+            // 
+            this.ToolStripMenuItem_movesempoint.Name = "ToolStripMenuItem_movesempoint";
+            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(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(210, 22);
+            this.toolStripMenuItem_Segmentation.Text = "分割颗粒";
+            this.toolStripMenuItem_Segmentation.Click += new System.EventHandler(this.toolStripMenuItem_Segmentation_Click);
+            // 
             // Control_DrawDistrbutionImageAndBSE
             // 
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -208,6 +207,7 @@
             this.Size = new System.Drawing.Size(1204, 781);
             this.Load += new System.EventHandler(this.Control_DrawDistrbutionImageAndBSE_Load);
             this.CMenuStrip.ResumeLayout(false);
+            this.contextMenuStrip_Particle.ResumeLayout(false);
             this.ResumeLayout(false);
 
         }
@@ -215,13 +215,9 @@
         #endregion
 
         private Control_XRayTable control_XRayTable1;
-        private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem_movesempoint;
         private Control_Ruler control_Ruler1;
         private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem_copyimage;
         private System.Windows.Forms.ToolStripMenuItem ExportoriginalspliceToolStripMenuItem;
-        private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItemDelete_Particle;
-        private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
-        private System.Windows.Forms.ToolStripMenuItem ImportSTDDb;
         private System.Windows.Forms.ToolStripMenuItem 显示国标信息ToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
         private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
@@ -233,6 +229,10 @@
         private System.Windows.Forms.ToolStripMenuItem aSTMToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem 显示所有帧ToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem_ParticleSplicing;
-        public System.Windows.Forms.ContextMenuStrip CMenuStrip;
+        public System.Windows.Forms.ContextMenuStrip contextMenuStrip_Particle;
+        private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem_movesempoint;
+        private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem_DeleteParticles;
+        private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem_Segmentation;
+        protected System.Windows.Forms.ContextMenuStrip CMenuStrip;
     }
 }

+ 3 - 0
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.resx

@@ -120,4 +120,7 @@
   <metadata name="CMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>16, 16</value>
   </metadata>
+  <metadata name="contextMenuStrip_Particle.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>181, 16</value>
+  </metadata>
 </root>