Browse Source

add missing files.

gsp 2 years ago
parent
commit
eef7427d12

+ 6 - 2
OTSIncAMeasureApp/1-OTSMeasure/CMeasureThreadWrapper.cs

@@ -100,11 +100,15 @@ namespace OTSMeasureApp
         /// <returns></returns>
         public bool BGWorkThreadIsRunning()
         {
-        
-            if (m_bgWorker.IsBusy)
+            if (m_measure.GetMsrThreadStatus().GetStatus() == OTS_MSR_THREAD_STATUS.INPROCESS)
             {
                 return true;
+
             }
+            //if (m_bgWorker.IsBusy)
+            //{
+            //    return true;
+            //}
             return false;
         }
         public bool BgWorkIsPaused()

+ 13 - 21
OTSIncAMeasureApp/3-OTSDisplaySourceGridData/OTSPropertyWindow.cs

@@ -86,7 +86,7 @@ namespace OTSMeasureApp
         {
             var PropertyMeasureThreadRunFlag = m_MeasureAppForm.m_MsrThreadWrapper.BGWorkThreadIsRunning();
             var measureTreadIsPaused= m_MeasureAppForm.m_MsrThreadWrapper.BgWorkIsPaused();
-
+          
             var m_SolutionWindows = m_MeasureAppForm.m_SolutionWindows;
             //设置样品属性参数成功
             OTSSamplePropertyInfo SMInfo = new OTSSamplePropertyInfo();
@@ -98,7 +98,7 @@ namespace OTSMeasureApp
                 {
                     goto HERE;
                 }
-               
+
             }
             string sWSampleName = m_DataMgr.GetWorkSampleName();
             if ("" == sWSampleName)
@@ -106,23 +106,9 @@ namespace OTSMeasureApp
                 return;
             }
 
-            //更新 MEASURE_PARAM_FILE_NAME FILE_LIST
-            if (OTS_SAMPLE_PROP_GRID_ITEMS.MEASURE_PARAM_FILE_NAME == SampleId)
-            {
-                if (!m_DataMgr.SetMeasrueParamFileName((int)ObjVal))
-                {
-                    //重新获取原来工作样品值重新设置
-                    if (!m_DataMgr.GetWorkSamplePerameter(m_DataMgr.GetWorkSample(), ref SMInfo))
-                    {
-                        return;
-                    }
-                    //Prop重新获显示工作样品的原来值
-                    DisplaySampleMeasureInfo(SMInfo);
-                    return;
-                }
-            }
+           
             //更新 STD_FILE_NAME FILE_LIST
-            else if (OTS_SAMPLE_PROP_GRID_ITEMS.STD_FILE_NAME == SampleId)
+             if (OTS_SAMPLE_PROP_GRID_ITEMS.STD_FILE_NAME == SampleId)
             {
                 if (m_DataMgr.SetSTDFileName((int)ObjVal))
                 {
@@ -267,10 +253,16 @@ namespace OTSMeasureApp
                     || OTS_SAMPLE_PROP_GRID_ITEMS.SCAN_MODE == SampleId
                     )
                 {
-                  
-                    var sam = m_MeasureAppForm.m_SamplepaceWindow.GetWorkingVisualSample();
 
-                    m_MeasureAppForm.m_SamplepaceWindow.PrepareMeasureField(sam);
+                    if (!measureTreadIsPaused && !PropertyMeasureThreadRunFlag)
+                    {
+
+                        var sam = m_MeasureAppForm.m_SamplepaceWindow.GetWorkingVisualSample();
+
+                        m_MeasureAppForm.m_SamplepaceWindow.PrepareMeasureField(sam);
+
+                    }
+                    
                }
            
 

+ 88 - 0
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/CRingGDIObject.cs

@@ -0,0 +1,88 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace OTSMeasureApp._4_OTSSamplespaceGraphicsPanel
+{
+    class CRingGDIObject: CRectangleGDIObject
+    {
+        private float ringWidth=10;//the distance between outline circle and inside circle.
+
+        public float GetRingWidth()
+        {
+            return ringWidth*m_zoomNum;
+        }
+
+        public void SetRingWidth(float value)
+        {
+            ringWidth = value;
+        }
+
+        public CRingGDIObject(RectangleF rect, CreateRectangleType cType,string holename,string name, Color selColor)
+        {
+
+            m_OrigineRegionF = rect;
+            SetInitRegionF(m_OrigineRegionF);
+            CreateType = cType;
+            sampleName = name;
+            nameOrHoleName = holename;
+            SelColor = selColor;
+            ID = System.Guid.NewGuid().ToString();
+          
+        }
+        public override void OnPaint(PaintEventArgs e)
+        {
+         
+            e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;  //图片柔顺模式选择
+            e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;//高质量
+            e.Graphics.CompositingQuality = CompositingQuality.HighQuality;//再加一点
+       
+            e.Graphics.DrawEllipse(Pens.Red, m_RegionF);
+            RectangleF insideRegine = new RectangleF();
+
+            insideRegine.X = m_RegionF.X + GetRingWidth();
+            insideRegine.Y = m_RegionF.Y + GetRingWidth();
+            insideRegine.Width = m_RegionF.Width - GetRingWidth() * 2;
+            insideRegine.Height = m_RegionF.Height - GetRingWidth() * 2;
+
+        
+            e.Graphics.DrawEllipse(Pens.Red, insideRegine);
+         
+
+        }
+  
+        private GraphicsPath GetInsideCirclePath()
+        {
+            RectangleF insideRegine = new RectangleF();
+            insideRegine.X = m_OrigineRegionF.X + ringWidth;
+            insideRegine.Y = m_OrigineRegionF.Y + ringWidth;
+            insideRegine.Width = m_OrigineRegionF.Width - ringWidth * 2;
+            insideRegine.Height = m_OrigineRegionF.Height - ringWidth * 2;
+            GraphicsPath GPath = new GraphicsPath();
+            GPath.AddEllipse(insideRegine);
+            return GPath;
+        }
+
+
+        override public bool ifRectangleIntersect(CRectangleGDIObject otherUnZoomgdi)
+        {
+            var path = GetInsideCirclePath();//the inside circle is the blank area that there's no field rect.
+            var vertexPoints = otherUnZoomgdi.GetVertexPoints();
+            foreach (var p in vertexPoints)
+            {
+                if (!path.IsVisible(p))
+                {
+                    return true;
+                }
+
+            }
+            return false;
+        }
+    }
+
+}

+ 1 - 6
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/OTSSamplespaceWindow.cs

@@ -1568,11 +1568,6 @@ namespace OTSMeasureApp
             {
                 return;
             }
-            var selWSampleMeasureStatus = m_MeasureAppForm.m_ProjParam.GetWorkSampleMeasureStatus();
-            if (selWSampleMeasureStatus)// have field be measured already.
-            {
-                return;
-            }
         
             if (m_IsDrawMeasure)
             {
@@ -1735,7 +1730,7 @@ namespace OTSMeasureApp
             if (Control.ModifierKeys == Keys.Control)//is dragging on the edge or on the vertex so we can alter the size of the item.
             {
 
-                var sam = GetWorkingVisualSample();
+                    var sam = GetWorkingVisualSample();
                     var curMeasureGdi = sam.GetMeasureGDIObject();
 
                       

+ 124 - 0
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/RingGdiDataInput.Designer.cs

@@ -0,0 +1,124 @@
+
+namespace OTSMeasureApp._4_OTSSamplespaceGraphicsPanel
+{
+    partial class RingGdiDataInput
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.label1 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.txtDiameter = new System.Windows.Forms.TextBox();
+            this.txtWidth = new System.Windows.Forms.TextBox();
+            this.button1 = new System.Windows.Forms.Button();
+            this.button2 = new System.Windows.Forms.Button();
+            this.SuspendLayout();
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(27, 33);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(149, 12);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "请输入环形外径(微米):";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(27, 78);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(149, 12);
+            this.label2.TabIndex = 0;
+            this.label2.Text = "请输入环形宽度(微米):";
+            // 
+            // txtDiameter
+            // 
+            this.txtDiameter.Location = new System.Drawing.Point(190, 24);
+            this.txtDiameter.Name = "txtDiameter";
+            this.txtDiameter.Size = new System.Drawing.Size(123, 21);
+            this.txtDiameter.TabIndex = 1;
+            this.txtDiameter.Text = "10000";
+            // 
+            // txtWidth
+            // 
+            this.txtWidth.Location = new System.Drawing.Point(190, 69);
+            this.txtWidth.Name = "txtWidth";
+            this.txtWidth.Size = new System.Drawing.Size(123, 21);
+            this.txtWidth.TabIndex = 1;
+            this.txtWidth.Text = "1000";
+            // 
+            // button1
+            // 
+            this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;
+            this.button1.Location = new System.Drawing.Point(68, 118);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(86, 29);
+            this.button1.TabIndex = 2;
+            this.button1.Text = "确定";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.button1_Click);
+            // 
+            // button2
+            // 
+            this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+            this.button2.Location = new System.Drawing.Point(190, 118);
+            this.button2.Name = "button2";
+            this.button2.Size = new System.Drawing.Size(86, 29);
+            this.button2.TabIndex = 2;
+            this.button2.Text = "取消";
+            this.button2.UseVisualStyleBackColor = true;
+            this.button2.Click += new System.EventHandler(this.button2_Click);
+            // 
+            // RingGdiDataInput
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(334, 172);
+            this.Controls.Add(this.button2);
+            this.Controls.Add(this.button1);
+            this.Controls.Add(this.txtWidth);
+            this.Controls.Add(this.txtDiameter);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.label1);
+            this.Name = "RingGdiDataInput";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+            this.Text = "RingGdiDataInput";
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.TextBox txtDiameter;
+        private System.Windows.Forms.TextBox txtWidth;
+        private System.Windows.Forms.Button button1;
+        private System.Windows.Forms.Button button2;
+    }
+}

+ 34 - 0
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/RingGdiDataInput.cs

@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace OTSMeasureApp._4_OTSSamplespaceGraphicsPanel
+{
+    public partial class RingGdiDataInput : Form
+    {
+        public float Diameter;
+        public float RingWidth;
+        public RingGdiDataInput()
+        {
+            InitializeComponent();
+        }
+
+        private void button1_Click(object sender, EventArgs e)
+        {
+            Diameter = Convert.ToSingle(txtDiameter.Text);
+            RingWidth = Convert.ToSingle(txtWidth.Text);
+            this.Close();
+        }
+
+        private void button2_Click(object sender, EventArgs e)
+        {
+            this.Close();
+        }
+    }
+}

+ 120 - 0
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/RingGdiDataInput.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 1 - 1
OTSIncAMeasureApp/OTSIncAMeasureAppForm.cs

@@ -883,7 +883,7 @@ namespace OTSMeasureApp
             {
                 return;
             }
-            if (!m_MsrThreadWrapper.BGWorkThreadIsRunning())
+            if (!m_MsrThreadWrapper.BGWorkThreadIsRunning() && !m_MsrThreadWrapper.BgWorkIsPaused())
             {
                
                 m_RunType = MSR_THREAD_RunSTATUS.RUNMEASURE;