소스 검색

fix the issue that excluding the small particle (dmin<2) when doing GB30834 classification.

gsp 1 년 전
부모
커밋
6485868f63

+ 2 - 1
OTSCPP/OTSRptCalculate/GBCal/CGBCalculate.cpp

@@ -1023,7 +1023,8 @@ namespace OTSGBCalculate
 		int nAfterCalNo = 0;
 		for (auto OTSField : myOTSFields)
 		{
-			for (auto part : OTSField->GetParticleList())
+			auto fldParts = OTSField->GetParticleList();
+			for (auto part : fldParts)
 			{
 				CPoint fieldPos = OTSField->GetPosition();
 			

+ 9 - 8
OTSCPP/OTSRptCalculate/GBCal/GBFieldData.cpp

@@ -285,7 +285,7 @@ namespace OTSGBCalculate
 			}
 			auto w = pParticle->GetDMin();
 		
-			if (w == 0 || w<2)
+			if (w == 0 )
 			{
 				continue;
 			}
@@ -535,7 +535,7 @@ namespace OTSGBCalculate
 			//check the denominator is zero or not
 			auto w = pParticle->GetDMin();
 
-			if (w == 0|| w<2)
+			if (w == 0)
 			{
 				continue;
 			}
@@ -708,7 +708,7 @@ namespace OTSGBCalculate
 			}
 			auto w = pParticle->GetDMin();
 
-			if (w == 0||w<2)
+			if (w == 0)
 			{
 				continue;
 			}
@@ -1126,11 +1126,12 @@ namespace OTSGBCalculate
 			break;
 		}
 
-		if (dWidth < dMin)
-		{
-			return GB_WIDTH_TYPE::INVALID;//СÓÚ2um²»¿¼ÂÇ
-		}
-		else if (dWidth >= dMin && dWidth <= dMax)
+		//if (dWidth < dMin)
+		//{
+		//	return GB_WIDTH_TYPE::INVALID;//СÓÚ2um²»¿¼ÂÇ
+		//}
+		/*else*/
+		if (dWidth >= 0 && dWidth <= dMax)
 		{
 			return GB_WIDTH_TYPE::THIN;
 		}

+ 1 - 2
OTSIncAMeasureApp/OTSIncAMeasureApp.csproj

@@ -220,8 +220,7 @@
     </Reference>
     <Reference Include="OINA.Extender, Version=6.1.0.0, Culture=neutral, PublicKeyToken=5efad68c95e0364e, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\OpenDll\OxfordApi61Dll\OINA.Extender.dll</HintPath>
-      <Private>False</Private>
+      <HintPath>E:\OTSSoftWare\OTS2_MiningDev\OpenDll\OxfordApi50Dll\OINA.Extender.dll</HintPath>
     </Reference>
     <Reference Include="OpenCvSharp">
       <HintPath>..\OpenDll\OpenCvSharp\OpenCvSharp.dll</HintPath>

+ 43 - 28
OxfordExtenderWrapper/Form1.Designer.cs

@@ -29,10 +29,10 @@
         private void InitializeComponent()
         {
             this.components = new System.ComponentModel.Container();
-            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.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
+            System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea3 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+            System.Windows.Forms.DataVisualization.Charting.Legend legend3 = new System.Windows.Forms.DataVisualization.Charting.Legend();
+            System.Windows.Forms.DataVisualization.Charting.Series series5 = new System.Windows.Forms.DataVisualization.Charting.Series();
+            System.Windows.Forms.DataVisualization.Charting.Series series6 = new System.Windows.Forms.DataVisualization.Charting.Series();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
             this.label1 = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
@@ -178,6 +178,7 @@
             this.显示ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.隐藏ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.退出ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.button17 = new System.Windows.Forms.Button();
             this.groupBox1.SuspendLayout();
             this.拍图.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pBImage)).BeginInit();
@@ -921,6 +922,7 @@
             // 
             // groupBox1
             // 
+            this.groupBox1.Controls.Add(this.button17);
             this.groupBox1.Controls.Add(this.button27);
             this.groupBox1.Controls.Add(this.button2);
             this.groupBox1.Controls.Add(this.button23);
@@ -1006,15 +1008,15 @@
             // 
             // button27
             // 
-            this.button27.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.button27.Location = new System.Drawing.Point(4, 114);
+            this.button27.Font = new System.Drawing.Font("Microsoft YaHei", 12F);
+            this.button27.Location = new System.Drawing.Point(4, 58);
             this.button27.Margin = new System.Windows.Forms.Padding(2);
             this.button27.Name = "button27";
-            this.button27.Size = new System.Drawing.Size(39, 143);
+            this.button27.Size = new System.Drawing.Size(39, 125);
             this.button27.TabIndex = 79;
             this.button27.Text = "连接能谱";
             this.button27.UseVisualStyleBackColor = true;
-            this.button27.Click += new System.EventHandler(this.button27_Click);
+            this.button27.Click += new System.EventHandler(this.btnConn_Click);
             // 
             // 拍图
             // 
@@ -1190,7 +1192,7 @@
             // 
             // button28
             // 
-            this.button28.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.button28.Font = new System.Drawing.Font("Microsoft YaHei", 12F);
             this.button28.ImeMode = System.Windows.Forms.ImeMode.NoControl;
             this.button28.Location = new System.Drawing.Point(501, 147);
             this.button28.Margin = new System.Windows.Forms.Padding(2);
@@ -1203,7 +1205,7 @@
             // 
             // btnTest
             // 
-            this.btnTest.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.btnTest.Font = new System.Drawing.Font("Microsoft YaHei", 12F);
             this.btnTest.Location = new System.Drawing.Point(499, 26);
             this.btnTest.Margin = new System.Windows.Forms.Padding(2);
             this.btnTest.Name = "btnTest";
@@ -1226,7 +1228,7 @@
             // 
             // button29
             // 
-            this.button29.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.button29.Font = new System.Drawing.Font("Microsoft YaHei", 12F);
             this.button29.ImeMode = System.Windows.Forms.ImeMode.NoControl;
             this.button29.Location = new System.Drawing.Point(501, 293);
             this.button29.Margin = new System.Windows.Forms.Padding(2);
@@ -1696,25 +1698,25 @@
             // 
             // chart1
             // 
-            chartArea1.Name = "ChartArea1";
-            this.chart1.ChartAreas.Add(chartArea1);
-            legend1.Alignment = System.Drawing.StringAlignment.Center;
-            legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
-            legend1.Name = "Legend1";
-            this.chart1.Legends.Add(legend1);
+            chartArea3.Name = "ChartArea1";
+            this.chart1.ChartAreas.Add(chartArea3);
+            legend3.Alignment = System.Drawing.StringAlignment.Center;
+            legend3.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
+            legend3.Name = "Legend1";
+            this.chart1.Legends.Add(legend3);
             this.chart1.Location = new System.Drawing.Point(554, 31);
             this.chart1.Margin = new System.Windows.Forms.Padding(2);
             this.chart1.Name = "chart1";
-            series1.ChartArea = "ChartArea1";
-            series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Spline;
-            series1.Legend = "Legend1";
-            series1.Name = "Series1";
-            series2.ChartArea = "ChartArea1";
-            series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Spline;
-            series2.Legend = "Legend1";
-            series2.Name = "Series2";
-            this.chart1.Series.Add(series1);
-            this.chart1.Series.Add(series2);
+            series5.ChartArea = "ChartArea1";
+            series5.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Spline;
+            series5.Legend = "Legend1";
+            series5.Name = "Series1";
+            series6.ChartArea = "ChartArea1";
+            series6.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Spline;
+            series6.Legend = "Legend1";
+            series6.Name = "Series2";
+            this.chart1.Series.Add(series5);
+            this.chart1.Series.Add(series6);
             this.chart1.Size = new System.Drawing.Size(593, 352);
             this.chart1.TabIndex = 3;
             this.chart1.Text = "chart1";
@@ -1779,6 +1781,18 @@
             this.退出ToolStripMenuItem.Text = "退出";
             this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click);
             // 
+            // button17
+            // 
+            this.button17.Font = new System.Drawing.Font("Microsoft YaHei", 12F);
+            this.button17.Location = new System.Drawing.Point(4, 225);
+            this.button17.Margin = new System.Windows.Forms.Padding(2);
+            this.button17.Name = "button17";
+            this.button17.Size = new System.Drawing.Size(39, 126);
+            this.button17.TabIndex = 79;
+            this.button17.Text = "释放控制权";
+            this.button17.UseVisualStyleBackColor = true;
+            this.button17.Click += new System.EventHandler(this.button27_Click);
+            // 
             // Form1
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -1786,7 +1800,7 @@
             this.AutoScroll = true;
             this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
             this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
-            this.ClientSize = new System.Drawing.Size(1186, 697);
+            this.ClientSize = new System.Drawing.Size(1187, 869);
             this.Controls.Add(this.拍图);
             this.Controls.Add(this.groupBox1);
             this.Controls.Add(this.groupBox2);
@@ -1955,6 +1969,7 @@
         private System.Windows.Forms.ToolStripMenuItem 显示ToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem 隐藏ToolStripMenuItem;
         private System.Windows.Forms.ToolStripMenuItem 退出ToolStripMenuItem;
+        private System.Windows.Forms.Button button17;
     }
 }
 

+ 21 - 5
OxfordExtenderWrapper/Form1.cs

@@ -613,15 +613,13 @@ namespace OxfordExtenderWrapper
         {
             try
             {
-                if (iExtender.ConnectToEDSHardware())
-                {
-                    MessageBox.Show("连接能谱成功");
-                }
+                iExtender.SetSemScanExternal(false);
+                
                 
             }
             catch (Exception x)
             {
-                MessageBox.Show("oxford 初始化失败" + x.Message);
+                MessageBox.Show("oxford 控制失败" + x.Message);
                 
             }
            
@@ -805,6 +803,24 @@ namespace OxfordExtenderWrapper
                 this.notifyIcon_wrapper.Visible = true;            //设置图标可见
             }
         }
+
+        private void btnConn_Click(object sender, EventArgs e)
+        {
+            try
+            {
+                if (iExtender.ConnectToEDSHardware())
+                {
+                    MessageBox.Show("连接成功" );
+                }
+
+
+            }
+            catch (Exception x)
+            {
+                MessageBox.Show("oxford 控制失败" + x.Message);
+
+            }
+        }
     }
 
 }

+ 6 - 0
OxfordExtenderWrapper/Form1.resx

@@ -123,6 +123,12 @@
   <metadata name="含量.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="元素.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="含量.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="notifyIcon_wrapper.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>17, 17</value>
   </metadata>