Bladeren bron

add a new method to draw measure area:two point rectangle method.

GSP 2 dagen geleden
bovenliggende
commit
c34d1e3c3a

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

@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XMLData RunMode="ProfessionalMode" SysType="IncA">
   <Member RegName="BrightnessContrastRegulateParam" AutoRegulateType="EveryPeriod" BrightPhaseElement="Al" BrightPhaseValue="124" DarkPhaseElement="C" DarkPhaseValue="11" InitialBrightness="45.53382111" InitialContrast="60.21995716" mag="100" Period="5" StdMaterialOTSPos="41475,-4357" ToRun="false" />
-  <Member RegName="GenParam" DefaultArea="50" DefaultSampleName="Sample" DefaultShape="0" EngineType="0:InclustionEngine" MeasParamFileFolderName=".\Config\ProData\" MeasSwitch="true" PartSTDLibFolderName=".\Config\SysData\" PropertyDisplayMode="0" StdLibFileName="zz" SteelTechnology="0" />
+  <Member RegName="GenParam" DefaultArea="50" DefaultSampleName="Sample" DefaultShape="0" EngineType="0:InclustionEngine" MeasParamFileFolderName=".\Config\ProData\" MeasSwitch="true" PartSTDLibFolderName=".\Config\SysData\" PropertyDisplayMode="0" StdLibFileName="Cleanness_N" SteelTechnology="0" />
   <Member RegName="ImageProcParam" AutoBGRemoveType="0:MIDDLE" BGRemoveType="0:AUTO" MatrixStep="0" OverlapParam="0" ParticleSelectionCondition="">
-    <Member RegName="BGGray" end="110" start="0" />
-    <Member RegName="IncArea" end="200" start="1" />
+    <Member RegName="BGGray" end="77" start="0" />
+    <Member RegName="IncArea" end="1000" start="10" />
     <Member RegName="ParticleGray" end="255" start="0" />
   </Member>
   <Member RegName="ImageScanParam" ImageResolution="4:_1536_1024" SatrtImageMode="1:Snake" ScanImageSpeed="0:low" StopMode="0:CoverMode" StopParamArea="10" StopParamFields="2" StopParamMeasTime="360" StopParamParticles="5000" />

BIN
Bin/x64/Debug/Config/SysData/OTS_TC_Axia_per.db


+ 43 - 0
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/OTSSamplespaceWindow.cs

@@ -438,6 +438,49 @@ namespace OTSMeasureApp
 
 
 
+        }
+        public void DrawRectangleBytTwoPoint()
+        {
+            //手绘测量区域类型为圆形
+
+            frmInitializeTwoPointRectangle frmInput = new frmInitializeTwoPointRectangle();
+            if (frmInput.ShowDialog() == DialogResult.OK)
+            {
+                PointF lt =frmInput.LTPoint;
+                PointF rb= frmInput.RBPoint;  
+                var sam = GetWorkingVisualSample();
+             
+                PointF otslt=new PointF(), otsrb=new PointF();
+                m_visualStage.m_SEMStageData.ConvertSEMToOTSCoord(lt,ref otslt);
+                m_visualStage.m_SEMStageData.ConvertSEMToOTSCoord(rb, ref otsrb);
+
+                var visualRec=  m_visualStage.GetCtrlCoordRectF(otslt, otsrb);
+                Color MeasureColor = Color.Red;
+                CMeasureArea newGDI=new CMeasureArea(visualRec, ShapeType.RECTANGLE,"", sam.GetSampleName(), MeasureColor);
+
+
+                newGDI.SetZoomNumber(m_visualStage.GetZoomNum());
+                newGDI.SetDisplayRefPoint(m_visualStage.GetDisplayRefPoint());
+
+                newGDI.IsWorkSample = true;
+
+
+                sam.SetMeasureGDIObject(newGDI);
+
+
+                m_DrawPolygonFinishGDIObject = null;
+                m_DrawMeasureGDIObject = null;
+
+                var para = m_visualStage.GetSampleMeasurePara(sam.GetMeasureGDIObject());
+
+                SetWorkSampleMeasureArea(para);
+
+
+            }
+
+
+
+
         }
         public void SetWorkSampleMeasureArea(SampleMeasurePara SMeasurePara)
         {

+ 9 - 0
OTSIncAMeasureApp/OTSIncAMeasureApp.csproj

@@ -397,6 +397,12 @@
       <DependentUpon>MeasureStopMode.cs</DependentUpon>
     </Compile>
     <Compile Include="3-OTSDisplaySourceGridData\OTSSampleVisualPropertyInfo.cs" />
+    <Compile Include="4-OTSSamplespaceGraphicsPanel\frmInitializeTwoPointRectangle.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="4-OTSSamplespaceGraphicsPanel\frmInitializeTwoPointRectangle.Designer.cs">
+      <DependentUpon>frmInitializeTwoPointRectangle.cs</DependentUpon>
+    </Compile>
     <Compile Include="4-OTSSamplespaceGraphicsPanel\VisualGDIObjects\CMeasureArea.cs" />
     <Compile Include="4-OTSSamplespaceGraphicsPanel\VisualGDIObjects\CRingGDIObject.cs" />
     <Compile Include="4-OTSSamplespaceGraphicsPanel\VisualGDIObjects\CVisualFieldGDIObject.cs" />
@@ -669,6 +675,9 @@
     <EmbeddedResource Include="4-OTSSamplespaceGraphicsPanel\frmInitializeStartInput.resx">
       <DependentUpon>frmInitializeStartInput.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="4-OTSSamplespaceGraphicsPanel\frmInitializeTwoPointRectangle.resx">
+      <DependentUpon>frmInitializeTwoPointRectangle.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="4-OTSSamplespaceGraphicsPanel\RingGdiDataInput.resx">
       <DependentUpon>RingGdiDataInput.cs</DependentUpon>
     </EmbeddedResource>

+ 18 - 18
OTSIncAMeasureApp/OTSIncAMeasureAppForm.Designer.cs

@@ -73,7 +73,7 @@
             this.rbThreePoints = new System.Windows.Forms.RibbonButton();
             this.rbRingShape = new System.Windows.Forms.RibbonButton();
             this.ribRectangle = new System.Windows.Forms.RibbonButton();
-            this.ribbonButton4 = new System.Windows.Forms.RibbonButton();
+            this.ribbonButtonTwoPoint = new System.Windows.Forms.RibbonButton();
             this.ribPolygon = new System.Windows.Forms.RibbonButton();
             this.ribbonSeparator4 = new System.Windows.Forms.RibbonSeparator();
             this.ribonBtnShot = new System.Windows.Forms.RibbonButton();
@@ -534,7 +534,7 @@
             this.ribRectangle.AltKey = null;
             this.ribRectangle.DropDownArrowDirection = System.Windows.Forms.RibbonArrowDirection.Down;
             this.ribRectangle.DropDownArrowSize = new System.Drawing.Size(5, 3);
-            this.ribRectangle.DropDownItems.Add(this.ribbonButton4);
+            this.ribRectangle.DropDownItems.Add(this.ribbonButtonTwoPoint);
             this.ribRectangle.Image = global::OTSMeasureApp.Properties.Resources.矩形32;
             this.ribRectangle.SmallImage = ((System.Drawing.Image)(resources.GetObject("ribRectangle.SmallImage")));
             this.ribRectangle.Style = System.Windows.Forms.RibbonButtonStyle.SplitDropDown;
@@ -543,22 +543,22 @@
             this.ribRectangle.ToolTip = null;
             this.ribRectangle.ToolTipImage = null;
             this.ribRectangle.ToolTipTitle = null;
-           
             this.ribRectangle.Click += new System.EventHandler(this.ribRectangle_Click);
             // 
-            // ribbonButton4
-            // 
-            this.ribbonButton4.AltKey = null;
-            this.ribbonButton4.DropDownArrowDirection = System.Windows.Forms.RibbonArrowDirection.Left;
-            this.ribbonButton4.DropDownArrowSize = new System.Drawing.Size(5, 3);
-            this.ribbonButton4.Image = ((System.Drawing.Image)(resources.GetObject("ribbonButton4.Image")));
-            this.ribbonButton4.SmallImage = ((System.Drawing.Image)(resources.GetObject("ribbonButton4.SmallImage")));
-            this.ribbonButton4.Style = System.Windows.Forms.RibbonButtonStyle.Normal;
-            this.ribbonButton4.Tag = null;
-            this.ribbonButton4.Text = null;
-            this.ribbonButton4.ToolTip = null;
-            this.ribbonButton4.ToolTipImage = null;
-            this.ribbonButton4.ToolTipTitle = null;
+            // ribbonButtonTwoPoint
+            // 
+            this.ribbonButtonTwoPoint.AltKey = null;
+            this.ribbonButtonTwoPoint.DropDownArrowDirection = System.Windows.Forms.RibbonArrowDirection.Left;
+            this.ribbonButtonTwoPoint.DropDownArrowSize = new System.Drawing.Size(5, 3);
+            this.ribbonButtonTwoPoint.Image = ((System.Drawing.Image)(resources.GetObject("ribbonButtonTwoPoint.Image")));
+            this.ribbonButtonTwoPoint.SmallImage = ((System.Drawing.Image)(resources.GetObject("ribbonButtonTwoPoint.SmallImage")));
+            this.ribbonButtonTwoPoint.Style = System.Windows.Forms.RibbonButtonStyle.Normal;
+            this.ribbonButtonTwoPoint.Tag = null;
+            this.ribbonButtonTwoPoint.Text = "两点法";
+            this.ribbonButtonTwoPoint.ToolTip = null;
+            this.ribbonButtonTwoPoint.ToolTipImage = null;
+            this.ribbonButtonTwoPoint.ToolTipTitle = null;
+            this.ribbonButtonTwoPoint.Click += new System.EventHandler(this.ribbonButton4_Click);
             // 
             // ribPolygon
             // 
@@ -773,8 +773,8 @@
             this.rb_Reclassify.Image = global::OTSMeasureApp.Properties.Resources.Reset32;
             this.rb_Reclassify.SmallImage = ((System.Drawing.Image)(resources.GetObject("rb_Reclassify.SmallImage")));
             this.rb_Reclassify.Style = System.Windows.Forms.RibbonButtonStyle.Normal;
-            this.rb_Reclassify.Text = "重新分类";
             this.rb_Reclassify.Tag = "rb_reclassify";
+            this.rb_Reclassify.Text = "重新分类";
             this.rb_Reclassify.ToolTip = null;
             this.rb_Reclassify.ToolTipImage = null;
             this.rb_Reclassify.ToolTipTitle = null;
@@ -1113,7 +1113,7 @@
         public System.Windows.Forms.RibbonButton rbAutoBeamOff;
         public System.Windows.Forms.RibbonButton rbSysMgrApp;
         private System.Windows.Forms.RibbonButton rb_Reclassify;
-        private System.Windows.Forms.RibbonButton ribbonButton4;
+        private System.Windows.Forms.RibbonButton ribbonButtonTwoPoint;
         private System.Windows.Forms.RibbonSeparator ribbonSeparator3;
         private System.Windows.Forms.RibbonSeparator ribbonSeparator4;
         public System.Windows.Forms.RibbonButton ribonBtnShot;

+ 4 - 1
OTSIncAMeasureApp/OTSIncAMeasureAppForm.cs

@@ -1742,6 +1742,9 @@ namespace OTSMeasureApp
             m_SamplepaceWindow.DrawOnlyShotMeasure();
         }
 
-        
+        private void ribbonButton4_Click(object sender, EventArgs e)
+        {
+            m_SamplepaceWindow.DrawRectangleBytTwoPoint();
+        }
     }
 }

+ 11 - 12
OTSIncAMeasureApp/OTSIncAMeasureAppForm.resx

@@ -196,18 +196,16 @@
         vAAADrwBlbxySQAAABNJREFUOE9jGAWjYBSMAjBgYAAABBAAAadEfGMAAAAASUVORK5CYII=
 </value>
   </data>
-  <data name="ribbonButton4.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="ribbonButtonTwoPoint.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
-        iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
-        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAaSURBVFhH7cEBAQAAAIIg/69uSEAAAADAuRoQIAABnXhJ
-        QwAAAABJRU5ErkJggg==
+        iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
+        wQAADsEBuJFr7QAAABpJREFUWEftwQEBAAAAgiD/r25IQAAAAMC5GhAgAAGdeElDAAAAAElFTkSuQmCC
 </value>
   </data>
-  <data name="ribbonButton4.SmallImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="ribbonButtonTwoPoint.SmallImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
-        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
-        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAATSURBVDhPYxgFo2AUjAIwYGAAAAQQAAGnRHxjAAAAAElF
-        TkSuQmCC
+        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
+        wQAADsEBuJFr7QAAABNJREFUOE9jGAWjYBSMAjBgYAAABBAAAadEfGMAAAAASUVORK5CYII=
 </value>
   </data>
   <data name="ribRectangle.SmallImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
@@ -225,13 +223,14 @@
   <data name="ribonBtnShot.SmallImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
-        wgAADsIBFShKgAAAABNJREFUOE9jGAWjYBSMAjBgYAAABBAAAadEfGMAAAAASUVORK5CYII=
+        wAAADsABataJCQAAABNJREFUOE9jGAWjYBSMAjBgYAAABBAAAadEfGMAAAAASUVORK5CYII=
 </value>
   </data>
-  <data name="ribbonButton2.SmallImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="rb_Reclassify.SmallImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
-        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
-        vgAADr4B6kKxwAAAABNJREFUOE9jGAWjYBSMAjBgYAAABBAAAadEfGMAAAAASUVORK5CYII=
+        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAATSURBVDhPYxgFo2AUjAIwYGAAAAQQAAGnRHxjAAAAAElF
+        TkSuQmCC
 </value>
   </data>
   <data name="ribbonButton5.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">