Browse Source

refactor the single field testing UI. add the zoom action of the BSE image. Do classification after single point xray collection.

gsp 10 tháng trước cách đây
mục cha
commit
92b2a1f610

+ 4 - 4
Bin/x64/Debug/Config/SysData/OTSProgMgrParam.pmf

@@ -1,15 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XMLData RunMode="ProfessionalMode" SysType="BatteryCleannessA">
-  <Member RegName="GenParam" DefaultArea="100" DefaultSampleName="Sample" DefaultShape="0" MeasParamFileFolderName=".\Config\ProData\" MeasSwitch="true" PartSTDLibFolderName=".\Config\SysData\" PropertyDisplayMode="0" StdLibFileName="NoSTDDB" SteelTechnology="0" UseSysSTD="true" />
+  <Member RegName="GenParam" DefaultArea="100" DefaultSampleName="Sample" DefaultShape="0" MeasParamFileFolderName=".\Config\ProData\" MeasSwitch="true" PartSTDLibFolderName=".\Config\SysData\" PropertyDisplayMode="0" StdLibFileName="Cleanness_N" SteelTechnology="0" UseSysSTD="true" />
   <Member RegName="ImageProcParam" AutoBGRemoveType="0:MIDDLE" BGRemoveType="1:MANUAL" OverlapParam="0" ParticleSelectionCondition="">
     <Member RegName="BGGray" end="255" start="80" />
-    <Member RegName="IncArea" end="100" start="3" />
-    <Member RegName="ParticleGray" end="90" start="50" />
+    <Member RegName="IncArea" end="100" start="2" />
+    <Member RegName="ParticleGray" end="255" start="0" />
   </Member>
   <Member RegName="ImageScanParam" ImageResolution="4:_1536_1024" SatrtImageMode="0:Spiral" ScanImageSpeed="0:low" StopMode="0:CoverMode" StopParamArea="10" StopParamFields="100" StopParamMeasTime="360" StopParamParticles="5000" />
   <Member RegName="StageData" ControlDelay="1000" MinMag="65" scanFieldSize="1270" xAxisDir="0:LEFT_TOWARD" yAxisDir="1:DOWN_TOWARD">
     <Member RegName="XAxis" end="55000" start="-55000" />
     <Member RegName="YAxis" end="55000" start="-55000" />
   </Member>
-  <Member RegName="XrayParam" AnalyExpCount="1000" IfAutoId="true" KnownElements="C,N,O,F,Na,Mg,Al,Si,P,S,Ca,Ti,V,Cr,Mn,Fe,Zr,Nb,Mo,La,Ce" MidAnalyAQTime="200" QuantifyMinSize="1" ScanMode="0:PointMode" SmallPartAQTime="200" UseFilter="false" UsingXray="true" XrayLimit="50" />
+  <Member RegName="XrayParam" AnalyExpCount="1000" IfAutoId="true" KnownElements="C,N,O,F,Na,Mg,Al,Si,P,S,Ca,Ti,V,Cr,Mn,Fe,Zr,Nb,Mo,La,Ce" MidAnalyAQTime="200" QuantifyMinSize="1" ScanMode="1:FeatureMode" SmallPartAQTime="200" UseFilter="false" UsingXray="true" XrayLimit="50" />
 </XMLData>

+ 1 - 1
Bin/x64/Debug/Resources/XMLData/AppResource_EN.xml

@@ -1139,7 +1139,7 @@ field of view(%)" />
 	  <Control name="ribbonButton1" text="Open" />
       <Control name="ribbonOrbRecentItem1" text="Special Gray Grain Recognition Settings " />	  
 	  <Control name="m_SamplespaceWindowName" text="SampleStage" />
-	  <Control name="m_MeasureStauWindowName" text="MeasurementState" />
+	  <Control name="m_MeasureStauWindowName" text="FieldImageTest" />
 	  <Control name="m_MeasureRetWindowName" text="MeasurementResult" />
 	  <Control name="m_NoWindowName" text="UnknownWorkingWindow" />
 	  <Control name="rbSTDEdit" text="Edit standard library" />

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

@@ -1053,7 +1053,7 @@
 	  <Control name="rbinterrupt" text="强制停止" />
 	
 	  <Control name="m_SamplespaceWindowName" text="样品台" />
-	  <Control name="m_MeasureStauWindowName" text="测量状态" />
+	  <Control name="m_MeasureStauWindowName" text="帧图测试" />
 	  <Control name="m_MeasureRetWindowName" text="测量结果" />
 	  <Control name="m_NoWindowName" text="未知工作窗口" />
 	  <Control name="rbSTDEdit" text="编辑标准库" />

+ 4 - 23
OTSIncAMeasureApp/0-OTSModel/OTSDataType/CHoleBSEImg.cs

@@ -7,9 +7,7 @@ namespace OTSDataType
 {
   public  class CHoleBSEImg : CBSEImgClr
     {
-        //hole name
-        //protected int m_nHoleID;
-        //image position
+
         protected System.Drawing.Point m_poiPosition = new System.Drawing.Point();
 
         public CHoleBSEImg()
@@ -42,10 +40,7 @@ namespace OTSDataType
 
         public bool Equals(CHoleBSEImg a_oSource)
         {
-            //if(m_nHoleID!= a_oSource.m_nHoleID)
-            //{
-            //    return false;
-            //}
+           
             if(m_poiPosition!= a_oSource.m_poiPosition)
             {
                 return false;
@@ -54,15 +49,7 @@ namespace OTSDataType
         }
 
 
-        // HoleID
-        //public int GetHoleID()
-        //{
-        //    return m_nHoleID;
-        //}
-        //public void SetHoleID(int a_nHoleID)
-        //{
-        //    m_nHoleID = a_nHoleID;
-        //}
+   
 
         // position
         public System.Drawing.Point GetPosition()
@@ -78,10 +65,7 @@ namespace OTSDataType
         // Initialization
         protected  void Init()
         {
-            // base class initialization
-            //base.Init();
-            // initialization
-            //m_nHoleID = 0;
+
             m_poiPosition = new System.Drawing.Point(0, 0);
         }
 
@@ -89,9 +73,6 @@ namespace OTSDataType
         protected void Duplicate(CHoleBSEImg a_oSource)
         {
 
-
-            // copy data over
-            //m_nHoleID = a_oSource.m_nHoleID;
             m_poiPosition = a_oSource.m_poiPosition;
         }
 

+ 2 - 2
OTSIncAMeasureApp/1-OTSMeasure/Measure/3-MeasureFlow/CSmplMeasure.cs

@@ -972,7 +972,7 @@ namespace OTSModelSharp
                 }
                 if (smallparts.Count > 0)
                 {
-                    Thread.Sleep(500);//add delay here,or else the eds system will halt.
+                    Thread.Sleep(1000);//add delay here,or else the eds system will halt.
                     nXRayAQTime = (uint)pXRayParam.GetSmallPartXrayTime();
 
                     log.Info("Begin to collect xraydata:" + smallparts.Count + "(" + nXRayAQTime.ToString() + ") on " + workmode.ToString());
@@ -996,7 +996,7 @@ namespace OTSModelSharp
                 }
                 if (smallparts.Count > 0)
                 {
-                    Thread.Sleep(500);
+                    Thread.Sleep(1000);
                     log.Info("Begin to collect xraydata:" + smallparts.Count + " on " + OTS_X_RAY_SCAN_MODE.PointMode.ToString());
                     nXRayAQTime = (uint)pXRayParam.GetSmallPartXrayTime();
                     m_EDSController.GetXRayByParts(smallparts, nXRayAQTime, true);

+ 20 - 66
OTSIncAMeasureApp/5-OTSMeasureStatuImageFun/OTSMeasureStatusWindow.Designer.cs

@@ -29,33 +29,26 @@
         private void InitializeComponent()
         {
             this.components = new System.ComponentModel.Container();
-            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea4 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
-            System.Windows.Forms.DataVisualization.Charting.Legend legend4 = new System.Windows.Forms.DataVisualization.Charting.Legend();
-            System.Windows.Forms.DataVisualization.Charting.Series series4 = new System.Windows.Forms.DataVisualization.Charting.Series();
-            System.Windows.Forms.DataVisualization.Charting.Title title4 = new System.Windows.Forms.DataVisualization.Charting.Title();
             this.picBox = new System.Windows.Forms.PictureBox();
             this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
             this.SampleParaLock = new System.Windows.Forms.ToolStripMenuItem();
             this.VisualAdjustingMenu = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
-            this.grayToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
             this.ChangeDiffImageShow = new System.Windows.Forms.ToolStripMenuItem();
             this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
-            this.AbandonGrayStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
             this.MenuItemLineScan = new System.Windows.Forms.ToolStripMenuItem();
+            this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
             this.PointScanElementMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.ExportScanInfoMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.myChart = new System.Windows.Forms.DataVisualization.Charting.Chart();
             this.panelXray = new System.Windows.Forms.Panel();
             this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
             this.timer1 = new System.Windows.Forms.Timer(this.components);
             this.pictureBox2 = new System.Windows.Forms.PictureBox();
             ((System.ComponentModel.ISupportInitialize)(this.picBox)).BeginInit();
             this.contextMenuStrip1.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.myChart)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
             this.SuspendLayout();
             // 
@@ -81,18 +74,17 @@
             this.SampleParaLock,
             this.VisualAdjustingMenu,
             this.toolStripMenuItem1,
-            this.grayToolStripMenuItem,
             this.toolStripSeparator1,
             this.ChangeDiffImageShow,
             this.ToolStripMenuItem,
             this.toolStripMenuItem2,
-            this.AbandonGrayStripMenuItem,
             this.toolStripSeparator2,
             this.MenuItemLineScan,
+            this.toolStripSeparator3,
             this.PointScanElementMenuItem,
             this.ExportScanInfoMenuItem});
             this.contextMenuStrip1.Name = "contextMenuStrip1";
-            this.contextMenuStrip1.Size = new System.Drawing.Size(243, 258);
+            this.contextMenuStrip1.Size = new System.Drawing.Size(243, 220);
             this.contextMenuStrip1.Opened += new System.EventHandler(this.contextMenuStrip1_Opened);
             // 
             // SampleParaLock
@@ -116,13 +108,6 @@
             this.toolStripMenuItem1.Text = "可视化设置特殊颗粒灰度范围";
             this.toolStripMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem1_Click);
             // 
-            // grayToolStripMenuItem
-            // 
-            this.grayToolStripMenuItem.Name = "grayToolStripMenuItem";
-            this.grayToolStripMenuItem.Size = new System.Drawing.Size(242, 22);
-            this.grayToolStripMenuItem.Text = "显示BSE灰度曲线图";
-            this.grayToolStripMenuItem.Click += new System.EventHandler(this.ShowGrayLevelImage_Click);
-            // 
             // toolStripSeparator1
             // 
             this.toolStripSeparator1.Name = "toolStripSeparator1";
@@ -149,13 +134,6 @@
             this.toolStripMenuItem2.Text = "BSE去背景彩色图";
             this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click);
             // 
-            // AbandonGrayStripMenuItem
-            // 
-            this.AbandonGrayStripMenuItem.Name = "AbandonGrayStripMenuItem";
-            this.AbandonGrayStripMenuItem.Size = new System.Drawing.Size(242, 22);
-            this.AbandonGrayStripMenuItem.Text = "显示BSE去背景灰度曲线图";
-            this.AbandonGrayStripMenuItem.Click += new System.EventHandler(this.ShowAbandonGrayLevelImage_Click);
-            // 
             // toolStripSeparator2
             // 
             this.toolStripSeparator2.Name = "toolStripSeparator2";
@@ -169,6 +147,11 @@
             this.MenuItemLineScan.Text = "线扫描曲线";
             this.MenuItemLineScan.Click += new System.EventHandler(this.ShowLineScanChart_Click);
             // 
+            // toolStripSeparator3
+            // 
+            this.toolStripSeparator3.Name = "toolStripSeparator3";
+            this.toolStripSeparator3.Size = new System.Drawing.Size(239, 6);
+            // 
             // PointScanElementMenuItem
             // 
             this.PointScanElementMenuItem.Name = "PointScanElementMenuItem";
@@ -183,37 +166,6 @@
             this.ExportScanInfoMenuItem.Text = "输出X-Ray信息";
             this.ExportScanInfoMenuItem.Click += new System.EventHandler(this.ExportScanInfoMenuItem_Click);
             // 
-            // myChart
-            // 
-            chartArea4.AlignmentStyle = System.Windows.Forms.DataVisualization.Charting.AreaAlignmentStyles.None;
-            chartArea4.Area3DStyle.Enable3D = true;
-            chartArea4.Area3DStyle.Inclination = 5;
-            chartArea4.Area3DStyle.IsClustered = true;
-            chartArea4.Area3DStyle.IsRightAngleAxes = false;
-            chartArea4.Area3DStyle.Perspective = 5;
-            chartArea4.Area3DStyle.WallWidth = 10;
-            chartArea4.Name = "ChartArea1";
-            this.myChart.ChartAreas.Add(chartArea4);
-            this.myChart.Dock = System.Windows.Forms.DockStyle.Fill;
-            legend4.Name = "Legend1";
-            this.myChart.Legends.Add(legend4);
-            this.myChart.Location = new System.Drawing.Point(0, 0);
-            this.myChart.Margin = new System.Windows.Forms.Padding(2);
-            this.myChart.Name = "myChart";
-            series4.ChartArea = "ChartArea1";
-            series4.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
-            series4.Legend = "Legend1";
-            series4.Name = "Series1";
-            this.myChart.Series.Add(series4);
-            this.myChart.Size = new System.Drawing.Size(782, 469);
-            this.myChart.TabIndex = 5;
-            this.myChart.Text = "chart1";
-            this.myChart.TextAntiAliasingQuality = System.Windows.Forms.DataVisualization.Charting.TextAntiAliasingQuality.Normal;
-            title4.Name = "Title1";
-            title4.Text = "---";
-            this.myChart.Titles.Add(title4);
-            this.myChart.Visible = false;
-            // 
             // panelXray
             // 
             this.panelXray.Dock = System.Windows.Forms.DockStyle.Bottom;
@@ -242,10 +194,12 @@
             this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
             this.pictureBox2.TabIndex = 0;
             this.pictureBox2.TabStop = false;
-            //this.pictureBox2.Paint += new System.Windows.Forms.PaintEventHandler(this.pictureBox1_Paint);
-            //this.pictureBox2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseClick);
-            //this.pictureBox2.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseDown);
-            //this.pictureBox2.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseMove);
+            this.pictureBox2.Paint += new System.Windows.Forms.PaintEventHandler(this.pictureBox2_Paint);
+            this.pictureBox2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pictureBox2_MouseClick);
+            this.pictureBox2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseClick);
+            this.pictureBox2.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseDown);
+            this.pictureBox2.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseMove);
+
             // 
             // OTSMeasureStatusWindow
             // 
@@ -256,19 +210,19 @@
             this.CloseButton = false;
             this.CloseButtonVisible = false;
             this.Controls.Add(this.panelXray);
-            this.Controls.Add(this.pictureBox2);
             this.Controls.Add(this.picBox);
-            this.Controls.Add(this.myChart);
+            this.Controls.Add(this.pictureBox2);
             this.DockAreas = ((OTS.WinFormsUI.Docking.DockAreas)((OTS.WinFormsUI.Docking.DockAreas.DockTop | OTS.WinFormsUI.Docking.DockAreas.Document)));
             this.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Name = "OTSMeasureStatusWindow";
             this.Text = "OTSMeasureStatus";
             this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
+            this.Activated += new System.EventHandler(this.OTSMeasureStatusWindow_Activated);
             this.Load += new System.EventHandler(this.OTSMeasureStatusWindow_Load);
             this.MouseClick += new System.Windows.Forms.MouseEventHandler(this.OTSMeasureStatusWindow_MouseClick);
+           
             ((System.ComponentModel.ISupportInitialize)(this.picBox)).EndInit();
             this.contextMenuStrip1.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.myChart)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
             this.ResumeLayout(false);
 
@@ -278,14 +232,13 @@
         private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
         private System.Windows.Forms.ToolStripMenuItem SampleParaLock;
         private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
-        private System.Windows.Forms.ToolStripMenuItem grayToolStripMenuItem;
+       
         private System.Windows.Forms.ToolStripMenuItem MenuItemLineScan;
         private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
         private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
         public System.Windows.Forms.PictureBox picBox;
-        private System.Windows.Forms.ToolStripMenuItem AbandonGrayStripMenuItem;
+       
         private System.Windows.Forms.ToolStripMenuItem ChangeDiffImageShow;
-        private System.Windows.Forms.DataVisualization.Charting.Chart myChart;
         public System.Windows.Forms.Panel panelXray;
         private OTSIncAGraph.Controls.Control_XRayTable control_XRayTable1;
         private System.Windows.Forms.ToolStripMenuItem PointScanElementMenuItem;
@@ -296,5 +249,6 @@
         private System.ComponentModel.BackgroundWorker backgroundWorker1;
         private System.Windows.Forms.Timer timer1;
         public System.Windows.Forms.PictureBox pictureBox2;
+        private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
     }
 }

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 257 - 414
OTSIncAMeasureApp/5-OTSMeasureStatuImageFun/OTSMeasureStatusWindow.cs


+ 69 - 37
OTSIncAMeasureApp/5-OTSMeasureStatuImageFun/ToolWindow.Designer.cs

@@ -28,6 +28,10 @@
         /// </summary>
         private void InitializeComponent()
         {
+            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+            System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
+            System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
+            System.Windows.Forms.DataVisualization.Charting.Title title1 = new System.Windows.Forms.DataVisualization.Charting.Title();
             this.tbGrayStart = new System.Windows.Forms.TrackBar();
             this.label1 = new System.Windows.Forms.Label();
             this.nuDownGrayStart = new System.Windows.Forms.NumericUpDown();
@@ -36,21 +40,23 @@
             this.btnYes = new System.Windows.Forms.Button();
             this.btnCancel = new System.Windows.Forms.Button();
             this.tbGrayEnd = new System.Windows.Forms.TrackBar();
-            this.txtGrayStart = new System.Windows.Forms.TextBox();
-            this.txtGrayEnd = new System.Windows.Forms.TextBox();
             this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.panel1 = new System.Windows.Forms.Panel();
+            this.myChart1 = new System.Windows.Forms.DataVisualization.Charting.Chart();
             this.pbBSEImage = new System.Windows.Forms.PictureBox();
             ((System.ComponentModel.ISupportInitialize)(this.tbGrayStart)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.nuDownGrayStart)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.nuDownGrayEnd)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.tbGrayEnd)).BeginInit();
             this.groupBox1.SuspendLayout();
+            this.panel1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.myChart1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pbBSEImage)).BeginInit();
             this.SuspendLayout();
             // 
             // tbGrayStart
             // 
-            this.tbGrayStart.Location = new System.Drawing.Point(263, 52);
+            this.tbGrayStart.Location = new System.Drawing.Point(808, 72);
             this.tbGrayStart.Maximum = 255;
             this.tbGrayStart.Name = "tbGrayStart";
             this.tbGrayStart.Size = new System.Drawing.Size(97, 45);
@@ -61,7 +67,7 @@
             // label1
             // 
             this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(11, 33);
+            this.label1.Location = new System.Drawing.Point(861, 17);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(77, 12);
             this.label1.TabIndex = 6;
@@ -69,7 +75,7 @@
             // 
             // nuDownGrayStart
             // 
-            this.nuDownGrayStart.Location = new System.Drawing.Point(110, 31);
+            this.nuDownGrayStart.Location = new System.Drawing.Point(821, 45);
             this.nuDownGrayStart.Maximum = new decimal(new int[] {
             255,
             0,
@@ -82,7 +88,7 @@
             // 
             // nuDownGrayEnd
             // 
-            this.nuDownGrayEnd.Location = new System.Drawing.Point(193, 31);
+            this.nuDownGrayEnd.Location = new System.Drawing.Point(921, 45);
             this.nuDownGrayEnd.Maximum = new decimal(new int[] {
             255,
             0,
@@ -96,7 +102,7 @@
             // label2
             // 
             this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(180, 35);
+            this.label2.Location = new System.Drawing.Point(904, 47);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(11, 12);
             this.label2.TabIndex = 9;
@@ -105,9 +111,9 @@
             // btnYes
             // 
             this.btnYes.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnYes.Location = new System.Drawing.Point(846, 16);
+            this.btnYes.Location = new System.Drawing.Point(821, 111);
             this.btnYes.Name = "btnYes";
-            this.btnYes.Size = new System.Drawing.Size(75, 51);
+            this.btnYes.Size = new System.Drawing.Size(75, 30);
             this.btnYes.TabIndex = 10;
             this.btnYes.Text = "确认";
             this.btnYes.UseVisualStyleBackColor = true;
@@ -116,9 +122,9 @@
             // btnCancel
             // 
             this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnCancel.Location = new System.Drawing.Point(927, 16);
+            this.btnCancel.Location = new System.Drawing.Point(921, 111);
             this.btnCancel.Name = "btnCancel";
-            this.btnCancel.Size = new System.Drawing.Size(75, 51);
+            this.btnCancel.Size = new System.Drawing.Size(75, 30);
             this.btnCancel.TabIndex = 10;
             this.btnCancel.Text = "取消";
             this.btnCancel.UseVisualStyleBackColor = true;
@@ -126,7 +132,7 @@
             // 
             // tbGrayEnd
             // 
-            this.tbGrayEnd.Location = new System.Drawing.Point(355, 52);
+            this.tbGrayEnd.Location = new System.Drawing.Point(911, 72);
             this.tbGrayEnd.Maximum = 255;
             this.tbGrayEnd.Name = "tbGrayEnd";
             this.tbGrayEnd.Size = new System.Drawing.Size(97, 45);
@@ -134,27 +140,9 @@
             this.tbGrayEnd.TickStyle = System.Windows.Forms.TickStyle.None;
             this.tbGrayEnd.Scroll += new System.EventHandler(this.tbGrayEnd_Scroll);
             // 
-            // txtGrayStart
-            // 
-            this.txtGrayStart.Location = new System.Drawing.Point(272, 31);
-            this.txtGrayStart.Name = "txtGrayStart";
-            this.txtGrayStart.ReadOnly = true;
-            this.txtGrayStart.Size = new System.Drawing.Size(80, 21);
-            this.txtGrayStart.TabIndex = 12;
-            // 
-            // txtGrayEnd
-            // 
-            this.txtGrayEnd.Location = new System.Drawing.Point(364, 31);
-            this.txtGrayEnd.Name = "txtGrayEnd";
-            this.txtGrayEnd.ReadOnly = true;
-            this.txtGrayEnd.Size = new System.Drawing.Size(80, 21);
-            this.txtGrayEnd.TabIndex = 13;
-            // 
             // groupBox1
             // 
-            this.groupBox1.Controls.Add(this.txtGrayEnd);
-            this.groupBox1.Controls.Add(this.txtGrayStart);
-            this.groupBox1.Controls.Add(this.tbGrayEnd);
+            this.groupBox1.Controls.Add(this.panel1);
             this.groupBox1.Controls.Add(this.btnCancel);
             this.groupBox1.Controls.Add(this.btnYes);
             this.groupBox1.Controls.Add(this.label2);
@@ -162,20 +150,62 @@
             this.groupBox1.Controls.Add(this.nuDownGrayStart);
             this.groupBox1.Controls.Add(this.label1);
             this.groupBox1.Controls.Add(this.tbGrayStart);
+            this.groupBox1.Controls.Add(this.tbGrayEnd);
             this.groupBox1.Dock = System.Windows.Forms.DockStyle.Bottom;
-            this.groupBox1.Location = new System.Drawing.Point(0, 624);
+            this.groupBox1.Location = new System.Drawing.Point(0, 535);
             this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Size = new System.Drawing.Size(1008, 73);
+            this.groupBox1.Size = new System.Drawing.Size(1008, 162);
             this.groupBox1.TabIndex = 5;
             this.groupBox1.TabStop = false;
             this.groupBox1.Text = "设置参数";
             // 
+            // panel1
+            // 
+            this.panel1.Controls.Add(this.myChart1);
+            this.panel1.Location = new System.Drawing.Point(6, 20);
+            this.panel1.Name = "panel1";
+            this.panel1.Size = new System.Drawing.Size(796, 130);
+            this.panel1.TabIndex = 14;
+            // 
+            // myChart1
+            // 
+            chartArea1.AlignmentStyle = System.Windows.Forms.DataVisualization.Charting.AreaAlignmentStyles.None;
+            chartArea1.Area3DStyle.Inclination = 0;
+            chartArea1.Area3DStyle.IsClustered = true;
+            chartArea1.Area3DStyle.IsRightAngleAxes = false;
+            chartArea1.Area3DStyle.LightStyle = System.Windows.Forms.DataVisualization.Charting.LightStyle.Realistic;
+            chartArea1.Area3DStyle.Perspective = 5;
+            chartArea1.Area3DStyle.Rotation = 0;
+            chartArea1.Area3DStyle.WallWidth = 10;
+            chartArea1.Name = "ChartArea1";
+            this.myChart1.ChartAreas.Add(chartArea1);
+            this.myChart1.Cursor = System.Windows.Forms.Cursors.Arrow;
+            this.myChart1.Dock = System.Windows.Forms.DockStyle.Fill;
+            legend1.Name = "Legend1";
+            this.myChart1.Legends.Add(legend1);
+            this.myChart1.Location = new System.Drawing.Point(0, 0);
+            this.myChart1.Margin = new System.Windows.Forms.Padding(2);
+            this.myChart1.Name = "myChart1";
+            this.myChart1.Palette = System.Windows.Forms.DataVisualization.Charting.ChartColorPalette.EarthTones;
+            series1.ChartArea = "ChartArea1";
+            series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Area;
+            series1.Legend = "Legend1";
+            series1.Name = "Series1";
+            this.myChart1.Series.Add(series1);
+            this.myChart1.Size = new System.Drawing.Size(796, 130);
+            this.myChart1.TabIndex = 7;
+            this.myChart1.Text = "chart1";
+            this.myChart1.TextAntiAliasingQuality = System.Windows.Forms.DataVisualization.Charting.TextAntiAliasingQuality.Normal;
+            title1.Name = "Title1";
+            title1.Text = "---";
+            this.myChart1.Titles.Add(title1);
+            // 
             // pbBSEImage
             // 
             this.pbBSEImage.Dock = System.Windows.Forms.DockStyle.Fill;
             this.pbBSEImage.Location = new System.Drawing.Point(0, 0);
             this.pbBSEImage.Name = "pbBSEImage";
-            this.pbBSEImage.Size = new System.Drawing.Size(1008, 624);
+            this.pbBSEImage.Size = new System.Drawing.Size(1008, 535);
             this.pbBSEImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
             this.pbBSEImage.TabIndex = 6;
             this.pbBSEImage.TabStop = false;
@@ -187,7 +217,7 @@
             this.ClientSize = new System.Drawing.Size(1008, 697);
             this.Controls.Add(this.pbBSEImage);
             this.Controls.Add(this.groupBox1);
-            this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Name = "ToolWindow";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "设置BSE图背景灰度范围";
@@ -198,6 +228,8 @@
             ((System.ComponentModel.ISupportInitialize)(this.tbGrayEnd)).EndInit();
             this.groupBox1.ResumeLayout(false);
             this.groupBox1.PerformLayout();
+            this.panel1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.myChart1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pbBSEImage)).EndInit();
             this.ResumeLayout(false);
 
@@ -212,9 +244,9 @@
         private System.Windows.Forms.Button btnYes;
         private System.Windows.Forms.Button btnCancel;
         private System.Windows.Forms.TrackBar tbGrayEnd;
-        private System.Windows.Forms.TextBox txtGrayStart;
-        private System.Windows.Forms.TextBox txtGrayEnd;
         private System.Windows.Forms.GroupBox groupBox1;
         private System.Windows.Forms.PictureBox pbBSEImage;
+        private System.Windows.Forms.Panel panel1;
+        private System.Windows.Forms.DataVisualization.Charting.Chart myChart1;
     }
 }

+ 62 - 50
OTSIncAMeasureApp/5-OTSMeasureStatuImageFun/ToolWindow.cs

@@ -39,11 +39,13 @@ namespace OTSMeasureApp
         /// </summary>
         public Bitmap BseImg { get => bseImg; set => bseImg = value; }
 
+        //private byte[] originalBseData;
+
         private byte[] bBseData;
         /// <summary>
         /// 获取当前的BSE原图数据
         /// </summary>
-        public byte[] BBseData { get => bBseData; set => bBseData = value; }
+        public byte[] OriginalBseData { get => bBseData; set => bBseData = value; }
 
         //去背景灰度最小值
         private int bseGrayMinValue=-1;
@@ -57,6 +59,7 @@ namespace OTSMeasureApp
         /// 去背景灰度最大值
         /// </summary>
         public int BseGrayMaxValue { get => bseGrayMaxValue; set => bseGrayMaxValue = value; }
+       
 
         private void ToolWindow_Load(object sender, EventArgs e)
         {
@@ -68,15 +71,13 @@ namespace OTSMeasureApp
             {
                 nuDownGrayStart.Value = BseGrayMinValue;
                 tbGrayStart.Value = BseGrayMinValue;
-                txtGrayStart.Text = BseGrayMinValue.ToString();
             }
             if (BseGrayMaxValue >-1)
             {
                 nuDownGrayEnd.Value = BseGrayMaxValue;
                 tbGrayEnd.Value = BseGrayMaxValue;
-                txtGrayEnd.Text = BseGrayMaxValue.ToString();
             }
-        
+            ShowGrayLevelImage();
         }
         #region BSE图去背景
         /// <summary>
@@ -170,8 +171,7 @@ namespace OTSMeasureApp
             {
                 nuDownGrayEnd.Value = nuDownGrayStart.Value;
             }
-            txtGrayStart.Text = nuDownGrayStart.Value.ToString();
-            txtGrayEnd.Text = nuDownGrayEnd.Value.ToString();
+
             tbGrayStart.Value = (int)nuDownGrayStart.Value;
             tbGrayEnd.Value = (int)nuDownGrayEnd.Value;
         }
@@ -183,7 +183,6 @@ namespace OTSMeasureApp
             if (grayStart <= grayEnd)
             {
                 Bitmap reBseImg = RemoveBseGray(BseImg, grayStart, grayEnd);
-                //Bitmap reBseImg = ShowRemoveBGImage(BBseData, grayStart, grayEnd);
                 if (reBseImg != null)
                 {
                     ShowBSEImage(reBseImg);
@@ -195,8 +194,7 @@ namespace OTSMeasureApp
                 tbGrayEnd.Value = tbGrayStart.Value;
             }
 
-            txtGrayStart.Text = tbGrayStart.Value.ToString();
-            txtGrayEnd.Text = tbGrayEnd.Value.ToString();
+
             nuDownGrayStart.Value = (int)tbGrayStart.Value;
             nuDownGrayEnd.Value = (int)tbGrayEnd.Value;
         }
@@ -207,8 +205,7 @@ namespace OTSMeasureApp
             int grayEnd = (int)tbGrayEnd.Value;
             if (grayStart <= grayEnd)
             {
-                txtGrayStart.Text = grayStart.ToString();
-                txtGrayEnd.Text = grayEnd.ToString();
+        
                 Bitmap reBseImg = RemoveBseGray(BseImg, grayStart, grayEnd);
             
                 if (reBseImg != null)
@@ -219,7 +216,7 @@ namespace OTSMeasureApp
             else
             {
                 tbGrayEnd.Value = tbGrayStart.Value;
-                txtGrayEnd.Text = grayStart.ToString();
+               
             }
             nuDownGrayStart.Value = tbGrayStart.Value;
             nuDownGrayEnd.Value = tbGrayEnd.Value;
@@ -227,8 +224,8 @@ namespace OTSMeasureApp
 
         private void btnYes_Click(object sender, EventArgs e)
         {
-            BseGrayMinValue = Convert.ToInt32(txtGrayStart.Text);
-            BseGrayMaxValue = Convert.ToInt32(txtGrayEnd.Text);
+            bseGrayMinValue = (int)nuDownGrayStart.Value;
+            bseGrayMaxValue = (int)nuDownGrayEnd.Value;
             this.DialogResult = DialogResult.Yes;
         }
 
@@ -238,42 +235,57 @@ namespace OTSMeasureApp
         }
 
         #region BSE图去背景
-        //protected Bitmap ShowRemoveBGImage(byte[] bBseData,int grayStart,int grayEnd)
-        //{
-        //    try
-        //    {
-        //        int m_iWidth = 0;
-        //        int m_iHeight = 0;
-        //        //获取电镜中图像大小
-        //        string str = m_MeasureAppForm.m_ProjParam.GetBSEImageResolution();
-        //        string[] sArray = str.Split('X');
-        //        if (sArray[0] != "" && sArray[1] != "")
-        //        {
-        //            m_iWidth = Convert.ToInt32(sArray[0]);
-        //            m_iHeight = Convert.ToInt32(sArray[1]);
-        //        }
-        //        //去背景图
-        //        byte[] cBseData = null;
-        //        //获取图像数据
-        //        var imageHandle = new CImageHandler();
-                
-        //        bool bfResult = imageHandle.GetBSEImage(bBseData, m_iHeight, m_iWidth, grayStart, grayEnd, ref cBseData);
-        //        if (bfResult)
-        //        {
-        //            Bitmap reImg= CImageHandler.ToGrayBitmap(cBseData, m_iWidth, m_iHeight);
-        //            return reImg;
-        //        }
-        //        else
-        //        {
-        //            return null;
-        //        }
-        //    }
-        //    catch (Exception ex)
-        //    {
-        //       log.Error("(ShowRemoveBGImage_Click):" + ex.ToString());
-        //    }
-        //    return null;
-        //}
+       
         #endregion
+        protected void ShowGrayLevelImage()
+        {
+
+         var   dGrayLevelData = new double[(int)GrayLevel.Max];
+            dGrayLevelData = GetGaryData(OriginalBseData, dGrayLevelData);
+
+            int[] XData = new int[(int)GrayLevel.Max];
+            for (int i = 0; i < (int)GrayLevel.Max; i++)
+            {
+                XData[i] = i + 1;
+            }
+            int[] YData = new int[dGrayLevelData.Length];
+            for (int i = 0; i < dGrayLevelData.Length; i++)
+            {
+                YData[i] = (int)dGrayLevelData[i];
+            }
+            DisChartData(XData, YData);
+
+
+
+        }
+        public double[] GetGaryData(byte[] Imagedata, double[] GrayLevelData)
+        {
+
+            //获得下标每一点的灰度值,并在数组里加一
+            for (int i = 0; i < Imagedata.Length; i++)
+            {
+                byte graylevel = Imagedata[i];
+                if (graylevel > 0 && graylevel < 255)
+                {
+                    GrayLevelData[graylevel] += 1;
+                }
+            }
+            return GrayLevelData;
+
+        }
+        public void DisChartData(int[] XData, int[] YData)
+        {
+
+            //添加数据
+            myChart1.Series[0].Points.DataBindXY(XData, YData);
+            myChart1.Series[0].Label = "";
+            myChart1.Series[0].LegendText = "";
+
+            myChart1.Series[0].Name = "Graph";
+
+            myChart1.Series[0].IsVisibleInLegend = false;
+            myChart1.Titles[0].Text = "GrayCurve";
+           
+        }
     }
 }

+ 8 - 2
OTSIncAMeasureApp/OTSIncAMeasureAppForm.cs

@@ -171,7 +171,6 @@ namespace OTSMeasureApp
             try
             {
 
-               
                 ArrangWorkspaceWindow();
 
                 log = NLog.LogManager.GetCurrentClassLogger();
@@ -183,6 +182,9 @@ namespace OTSMeasureApp
                   
                     if (m_ProjParam.InitResultData())
                     {
+
+                   
+
                         m_RibbonFun.SetAllRibbonButnStatus(true);
                
                         m_SamplepaceWindow.InitStageDisplay(m_ProjRstData.GetStage(),m_ProjRstData.GetSEMStageData());
@@ -215,6 +217,10 @@ namespace OTSMeasureApp
                     log.Error("(OTSIncAMeasureAppForm.OTSIncAMeasureAppForm_Load)  (LoadParamFile() && LoadStageParamFile()) failed");
                 }
 
+             
+
+
+
                 if (!m_MsrThreadWrapper.ConnectSEM())
                 {
                     MessageBox.Show("Connect SEM failed!Please goto the SysMgrApp.exe to setup the proper parameter or check other parameter of the EDS software");
@@ -262,7 +268,7 @@ namespace OTSMeasureApp
            m_SolutionWindows.Show(dockPanel, DockState.DockLeft);
             //Show 测量过程中Log显示窗口
            
-            //m_OTSMeasureOutputNlog.Show();
+           
             m_OTSMeasureOutputNlog.Show(dockPanel, DockState.DockRight);
 
            dockPanel.DockRightPortion = 365;

+ 18 - 27
OTSIncAMeasureApp/ServiceCenter/CImageHandler.cs

@@ -107,17 +107,15 @@ namespace OTSModelSharp.ServiceCenter
 
         //获取测量的BSE图
      
-        public bool GetBSEImage(COTSImageProcParam ImgProcPrm, double pixelSize, byte[] BSEImage, int iWidth, int iHeight, ref byte[] BSEImageNoBG)
+        public bool GetBSEImage(COTSField tempFld, COTSImageProcParam ImgProcPrm, double pixelSize, int iWidth, int iHeight, ref byte[] BSEImageNoBG)
         {
             Rectangle rect = new Rectangle();
             rect.Height = iHeight;
             rect.Width = iWidth;
-            CBSEImgClr pBSEImageIn = new CBSEImgClr(rect);
+           
             CBSEImgClr pBSEImageOut = new CBSEImgClr(rect);
             
            
-         
-            pBSEImageIn.SetImageData(BSEImage,iWidth, iHeight );
        
             if (null == ImgProcPrm)
             {
@@ -125,7 +123,7 @@ namespace OTSModelSharp.ServiceCenter
             }
 
 
-            RemoveBackGround(pBSEImageIn, ImgProcPrm, pixelSize ,ref pBSEImageOut);
+            RemoveBackGround(tempFld, ImgProcPrm, pixelSize ,ref pBSEImageOut);
 
 
             BSEImageNoBG = pBSEImageOut.GetImageDataPtr();
@@ -192,38 +190,31 @@ namespace OTSModelSharp.ServiceCenter
 
             return true;
         }
-        public bool GetColoredImage(COTSImageProcParam ImgProcPrm, double pixelSize, byte[] BSEImage, int iWidth, int iHeight, ref CBSEImgClr a_pImgOut, ref Bitmap BSEImageNoBG)
+        public bool GetColoredImage(COTSField tempFld, COTSImageProcParam ImgProcPrm, double pixelSize,  int iWidth, int iHeight, ref CBSEImgClr a_pImgOut, ref Bitmap BSEImageNoBG)
         {
-            Rectangle rect = new Rectangle();
-            rect.Height = iHeight;
-            rect.Width = iWidth;
-            CBSEImgClr pBSEImageIn = new CBSEImgClr(rect);
-
-
-
-
-            pBSEImageIn.SetImageData(BSEImage, iWidth, iHeight);
+         
 
             if (null == ImgProcPrm)
             {
                 return false;
             }
 
-            RemoveBGAndGetColoredParts(pBSEImageIn, ImgProcPrm, pixelSize, ref a_pImgOut, ref BSEImageNoBG);//RemoveBGAndGetColoredParts
+            RemoveBGAndGetColoredParts(tempFld, ImgProcPrm, pixelSize, ref a_pImgOut, ref BSEImageNoBG);//RemoveBGAndGetColoredParts
 
 
             return true;
         }
         // remove background
-        private void RemoveBackGround(CBSEImgClr a_pImgIn, COTSImageProcParam a_pImgProcessParam, double a_pixelSize, ref CBSEImgClr a_pImgOut)
+        private void RemoveBackGround(COTSField tempFld,  COTSImageProcParam a_pImgProcessParam, double a_pixelSize, ref CBSEImgClr a_pImgOut)
         {
        
 
             List<COTSParticleClr> parts = new List<COTSParticleClr>();
             List<COTSParticleClr> specialGreyparts = new List<COTSParticleClr>();
             var ecdrange = a_pImgProcessParam.GetIncAreaRange();
-            var tempFld = new COTSField(new PointF(0,0),a_pixelSize);
-            tempFld.SetBSEImage(a_pImgIn);
+            var originalBse = tempFld.GetBSEImage();
+            //var tempFld = new COTSField(new PointF(0,0),a_pixelSize);
+            //tempFld.SetBSEImage(a_pImgIn);
             if (!RemoveBGAndGetParts(tempFld, a_pImgProcessParam, ref parts))
             {
                 return;
@@ -235,7 +226,7 @@ namespace OTSModelSharp.ServiceCenter
             {
                 var param = a_pImgProcessParam.GetSpecialGreyRangeParam();
                 var ranges = param.GetSpecialGreyRanges();
-              
+               
                 
                 foreach (var r in ranges)
                 {
@@ -247,7 +238,7 @@ namespace OTSModelSharp.ServiceCenter
                     r2.SetStart(r.diameterRange.GetStart());
                     r2.SetEnd(r.diameterRange.GetEnd());
 
-                    GetParticlesBySpecialGray(a_pImgIn, r1, r2, a_pixelSize, ref specialGreyparts);
+                    GetParticlesBySpecialGray(originalBse, r1, r2, a_pixelSize, ref specialGreyparts);
                 }
               
             }
@@ -268,7 +259,7 @@ namespace OTSModelSharp.ServiceCenter
                     {
                         for (int i = s.GetStart(); i < s.GetStart() + s.GetLength(); i++)
                         {
-                            var bseValue = a_pImgIn.GetBSEValue(i, s.GetHeight());
+                            var bseValue = originalBse.GetBSEValue(i, s.GetHeight());
                             a_pImgOut.SetBSEValue(i, s.GetHeight(), bseValue);
                         }
                     }
@@ -286,7 +277,7 @@ namespace OTSModelSharp.ServiceCenter
                    
                     for (int i = s.GetStart(); i < s.GetStart() + s.GetLength(); i++)
                     {
-                        var bseValue = a_pImgIn.GetBSEValue(i, s.GetHeight());
+                        var bseValue = originalBse.GetBSEValue(i, s.GetHeight());
                         a_pImgOut.SetBSEValue(i, s.GetHeight(), bseValue);
                     }
                 }
@@ -298,15 +289,14 @@ namespace OTSModelSharp.ServiceCenter
           
             return;
         }
-        private void RemoveBGAndGetColoredParts(CBSEImgClr a_pImgIn, COTSImageProcParam a_pImgProcessParam, double a_pixelSize, ref CBSEImgClr a_pImgOut, ref Bitmap a_pBmpOut)
+        private void RemoveBGAndGetColoredParts(COTSField tempFld, COTSImageProcParam a_pImgProcessParam, double a_pixelSize, ref CBSEImgClr a_pImgOut, ref Bitmap a_pBmpOut)
         {
 
 
             List<COTSParticleClr> parts = new List<COTSParticleClr>();
             List<COTSParticleClr> specialGreyparts = new List<COTSParticleClr>();
             var ecdrange = a_pImgProcessParam.GetIncAreaRange();
-            var tempFld = new COTSField(new PointF(0,0),a_pixelSize);
-            tempFld.SetBSEImage(a_pImgIn);
+          
             if (!RemoveBGAndGetParts(tempFld, a_pImgProcessParam,  ref parts))
             {
                 return;
@@ -330,7 +320,7 @@ namespace OTSModelSharp.ServiceCenter
                     r2.SetStart(r.diameterRange.GetStart());
                     r2.SetEnd(r.diameterRange.GetEnd());
 
-                    GetParticlesBySpecialGray(a_pImgIn, r1, r2, a_pixelSize, ref specialGreyparts);
+                    GetParticlesBySpecialGray(tempFld.GetBSEImage(), r1, r2, a_pixelSize, ref specialGreyparts);
                 }
 
             }
@@ -345,6 +335,7 @@ namespace OTSModelSharp.ServiceCenter
                
             }
             Random c = new Random();
+            var a_pImgIn = tempFld.GetBSEImage();
             if (specialGreyparts.Count > 0)
             {
                 foreach (var p in specialGreyparts)

+ 45 - 1
OTSIncAMeasureApp/ServiceCenter/CPP(Bruker)API/EDSController.cs

@@ -363,7 +363,51 @@ namespace OTSModelSharp.ServiceCenter
 
         public bool GetXRayByExpandFeatures(List<COTSParticleClr> a_listParticles, double a_nXRayAQTime, bool a_bElementInfo)
         {
-            throw new NotImplementedException();
+            bool result = false;
+
+            if (!eds.IsConnected())
+            {
+                return false;
+            }
+
+            if (keyElenamelist.Count > 0)
+            {
+
+                List<CElementChemistryClr> elementChemistryClrs = new List<CElementChemistryClr>();
+                for (int j = 0; j < keyElenamelist.Count; j++)
+                {
+                    CElementChemistryClr chemistryClr = new CElementChemistryClr();
+                    chemistryClr.SetName(keyElenamelist[j]);
+                    elementChemistryClrs.Add(chemistryClr);
+                }
+                for (int i = 0; i < a_listParticles.Count; i++)
+                {
+
+                    a_listParticles[i].GetXray().SetElementQuantifyData(elementChemistryClrs);
+                }
+
+            }
+
+
+            COTSParticleClr[] parts = a_listParticles.ToArray();
+
+            if (delayQuant)
+            {
+                a_bElementInfo = false;
+            }
+            result = eds.GetXRayByFeatures((uint)a_nXRayAQTime, parts, a_bElementInfo);
+
+
+            if (result == true)
+            {
+                foreach (var p in a_listParticles)
+                {
+                    ProcessXrayInfo(p);
+                }
+
+
+            }
+            return result;
         }
     }
 }

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác