Browse Source

add missing files of the two rectangle point method.

GSP 1 week ago
parent
commit
17ccd7ff05

+ 263 - 0
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/frmInitializeTwoPointRectangle.Designer.cs

@@ -0,0 +1,263 @@
+namespace OTSMeasureApp._4_OTSSamplespaceGraphicsPanel
+{
+    partial class frmInitializeTwoPointRectangle
+    {
+        /// <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.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.btnwrite1 = new System.Windows.Forms.Button();
+            this.bn_FirstPoint = new System.Windows.Forms.Button();
+            this.label2 = new System.Windows.Forms.Label();
+            this.tB_LTPointX = new System.Windows.Forms.TextBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.tB_LTPointY = new System.Windows.Forms.TextBox();
+            this.groupBox2 = new System.Windows.Forms.GroupBox();
+            this.btnwrite2 = new System.Windows.Forms.Button();
+            this.tB_RBPointY = new System.Windows.Forms.TextBox();
+            this.label5 = new System.Windows.Forms.Label();
+            this.tB_RBPointX = new System.Windows.Forms.TextBox();
+            this.label4 = new System.Windows.Forms.Label();
+            this.bn_SecondPoint = new System.Windows.Forms.Button();
+            this.bn_Cancel = new System.Windows.Forms.Button();
+            this.bn_OK = new System.Windows.Forms.Button();
+            this.groupBox1.SuspendLayout();
+            this.groupBox2.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.Controls.Add(this.btnwrite1);
+            this.groupBox1.Controls.Add(this.bn_FirstPoint);
+            this.groupBox1.Controls.Add(this.label2);
+            this.groupBox1.Controls.Add(this.tB_LTPointX);
+            this.groupBox1.Controls.Add(this.label3);
+            this.groupBox1.Controls.Add(this.tB_LTPointY);
+            this.groupBox1.Location = new System.Drawing.Point(36, 49);
+            this.groupBox1.Margin = new System.Windows.Forms.Padding(2);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Padding = new System.Windows.Forms.Padding(2);
+            this.groupBox1.Size = new System.Drawing.Size(449, 71);
+            this.groupBox1.TabIndex = 20;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Text = "LeftTopPoint";
+            // 
+            // btnwrite1
+            // 
+            this.btnwrite1.Location = new System.Drawing.Point(365, 32);
+            this.btnwrite1.Name = "btnwrite1";
+            this.btnwrite1.Size = new System.Drawing.Size(65, 19);
+            this.btnwrite1.TabIndex = 7;
+            this.btnwrite1.Text = "Write";
+            this.btnwrite1.UseVisualStyleBackColor = true;
+            this.btnwrite1.Click += new System.EventHandler(this.button1_Click);
+            // 
+            // bn_FirstPoint
+            // 
+            this.bn_FirstPoint.Location = new System.Drawing.Point(281, 32);
+            this.bn_FirstPoint.Margin = new System.Windows.Forms.Padding(2);
+            this.bn_FirstPoint.Name = "bn_FirstPoint";
+            this.bn_FirstPoint.Size = new System.Drawing.Size(72, 20);
+            this.bn_FirstPoint.TabIndex = 6;
+            this.bn_FirstPoint.Text = "Obtain";
+            this.bn_FirstPoint.UseVisualStyleBackColor = true;
+            this.bn_FirstPoint.Click += new System.EventHandler(this.bn_FirstPoint_Click);
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(24, 32);
+            this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(17, 12);
+            this.label2.TabIndex = 2;
+            this.label2.Text = "X:";
+            // 
+            // tB_LTPointX
+            // 
+            this.tB_LTPointX.Location = new System.Drawing.Point(51, 30);
+            this.tB_LTPointX.Margin = new System.Windows.Forms.Padding(2);
+            this.tB_LTPointX.Name = "tB_LTPointX";
+            this.tB_LTPointX.Size = new System.Drawing.Size(76, 21);
+            this.tB_LTPointX.TabIndex = 3;
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(147, 32);
+            this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(17, 12);
+            this.label3.TabIndex = 4;
+            this.label3.Text = "Y:";
+            // 
+            // tB_LTPointY
+            // 
+            this.tB_LTPointY.Location = new System.Drawing.Point(174, 30);
+            this.tB_LTPointY.Margin = new System.Windows.Forms.Padding(2);
+            this.tB_LTPointY.Name = "tB_LTPointY";
+            this.tB_LTPointY.Size = new System.Drawing.Size(76, 21);
+            this.tB_LTPointY.TabIndex = 5;
+            // 
+            // groupBox2
+            // 
+            this.groupBox2.Controls.Add(this.btnwrite2);
+            this.groupBox2.Controls.Add(this.tB_RBPointY);
+            this.groupBox2.Controls.Add(this.label5);
+            this.groupBox2.Controls.Add(this.tB_RBPointX);
+            this.groupBox2.Controls.Add(this.label4);
+            this.groupBox2.Controls.Add(this.bn_SecondPoint);
+            this.groupBox2.Location = new System.Drawing.Point(36, 164);
+            this.groupBox2.Margin = new System.Windows.Forms.Padding(2);
+            this.groupBox2.Name = "groupBox2";
+            this.groupBox2.Padding = new System.Windows.Forms.Padding(2);
+            this.groupBox2.Size = new System.Drawing.Size(449, 76);
+            this.groupBox2.TabIndex = 21;
+            this.groupBox2.TabStop = false;
+            this.groupBox2.Text = "RightBottomPoint";
+            // 
+            // btnwrite2
+            // 
+            this.btnwrite2.Location = new System.Drawing.Point(362, 31);
+            this.btnwrite2.Name = "btnwrite2";
+            this.btnwrite2.Size = new System.Drawing.Size(67, 19);
+            this.btnwrite2.TabIndex = 13;
+            this.btnwrite2.Text = "Write";
+            this.btnwrite2.UseVisualStyleBackColor = true;
+            this.btnwrite2.Click += new System.EventHandler(this.button2_Click);
+            // 
+            // tB_RBPointY
+            // 
+            this.tB_RBPointY.Location = new System.Drawing.Point(174, 30);
+            this.tB_RBPointY.Margin = new System.Windows.Forms.Padding(2);
+            this.tB_RBPointY.Name = "tB_RBPointY";
+            this.tB_RBPointY.Size = new System.Drawing.Size(76, 21);
+            this.tB_RBPointY.TabIndex = 11;
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Location = new System.Drawing.Point(24, 34);
+            this.label5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(17, 12);
+            this.label5.TabIndex = 8;
+            this.label5.Text = "X:";
+            // 
+            // tB_RBPointX
+            // 
+            this.tB_RBPointX.Location = new System.Drawing.Point(51, 30);
+            this.tB_RBPointX.Margin = new System.Windows.Forms.Padding(2);
+            this.tB_RBPointX.Name = "tB_RBPointX";
+            this.tB_RBPointX.Size = new System.Drawing.Size(76, 21);
+            this.tB_RBPointX.TabIndex = 9;
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Location = new System.Drawing.Point(147, 34);
+            this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(17, 12);
+            this.label4.TabIndex = 10;
+            this.label4.Text = "Y:";
+            // 
+            // bn_SecondPoint
+            // 
+            this.bn_SecondPoint.Location = new System.Drawing.Point(281, 29);
+            this.bn_SecondPoint.Margin = new System.Windows.Forms.Padding(2);
+            this.bn_SecondPoint.Name = "bn_SecondPoint";
+            this.bn_SecondPoint.Size = new System.Drawing.Size(72, 20);
+            this.bn_SecondPoint.TabIndex = 12;
+            this.bn_SecondPoint.Text = "Obtain";
+            this.bn_SecondPoint.UseVisualStyleBackColor = true;
+            this.bn_SecondPoint.Click += new System.EventHandler(this.bn_SecondPoint_Click);
+            // 
+            // bn_Cancel
+            // 
+            this.bn_Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+            this.bn_Cancel.Location = new System.Drawing.Point(255, 281);
+            this.bn_Cancel.Margin = new System.Windows.Forms.Padding(2);
+            this.bn_Cancel.Name = "bn_Cancel";
+            this.bn_Cancel.Size = new System.Drawing.Size(68, 26);
+            this.bn_Cancel.TabIndex = 23;
+            this.bn_Cancel.Text = "Cancel";
+            this.bn_Cancel.UseVisualStyleBackColor = true;
+            this.bn_Cancel.Click += new System.EventHandler(this.bn_Cancel_Click);
+            // 
+            // bn_OK
+            // 
+            this.bn_OK.DialogResult = System.Windows.Forms.DialogResult.OK;
+            this.bn_OK.Location = new System.Drawing.Point(158, 281);
+            this.bn_OK.Margin = new System.Windows.Forms.Padding(2);
+            this.bn_OK.Name = "bn_OK";
+            this.bn_OK.Size = new System.Drawing.Size(73, 26);
+            this.bn_OK.TabIndex = 22;
+            this.bn_OK.Text = "OK";
+            this.bn_OK.UseVisualStyleBackColor = true;
+            this.bn_OK.Click += new System.EventHandler(this.bn_OK_Click);
+            // 
+            // frmInitializeTwoPointRectangle
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(500, 341);
+            this.Controls.Add(this.bn_Cancel);
+            this.Controls.Add(this.bn_OK);
+            this.Controls.Add(this.groupBox2);
+            this.Controls.Add(this.groupBox1);
+            this.Name = "frmInitializeTwoPointRectangle";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.Text = "TwoPointRectangle";
+            this.Load += new System.EventHandler(this.frmInitializeTwoPointRectangle_Load);
+            this.groupBox1.ResumeLayout(false);
+            this.groupBox1.PerformLayout();
+            this.groupBox2.ResumeLayout(false);
+            this.groupBox2.PerformLayout();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.GroupBox groupBox1;
+        private System.Windows.Forms.Button bn_FirstPoint;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.TextBox tB_LTPointX;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.TextBox tB_LTPointY;
+        private System.Windows.Forms.GroupBox groupBox2;
+        private System.Windows.Forms.TextBox tB_RBPointY;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.TextBox tB_RBPointX;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Button bn_SecondPoint;
+        private System.Windows.Forms.Button bn_Cancel;
+        private System.Windows.Forms.Button bn_OK;
+        private System.Windows.Forms.Button btnwrite1;
+        private System.Windows.Forms.Button btnwrite2;
+    }
+}

+ 92 - 0
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/frmInitializeTwoPointRectangle.cs

@@ -0,0 +1,92 @@
+using OTSModelSharp.ServiceCenter;
+using System;
+using System.Collections;
+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 frmInitializeTwoPointRectangle : Form
+    {
+        ISemController cfun;
+        public PointF LTPoint;
+        public PointF RBPoint;
+        public bool IsOK = false;
+
+        OTSCommon.Language lan;
+        Hashtable table;
+        public frmInitializeTwoPointRectangle()
+        {
+            InitializeComponent();
+            lan = new OTSCommon.Language(this);
+            table = lan.GetNameTable(this.Name);
+        }
+
+        private void bn_FirstPoint_Click(object sender, EventArgs e)
+        {
+            double Px = 0;
+            double Py = 0;
+            double Pr = 0;
+            if (cfun.GetSemPositionXY(ref Px, ref Py, ref Pr))
+            {
+                tB_LTPointX.Text = Px.ToString();
+                tB_LTPointY.Text = Py.ToString();
+
+
+                LTPoint = new PointF((float)Px, (float)Py);
+            }
+        }
+
+        private void bn_SecondPoint_Click(object sender, EventArgs e)
+        {
+            double Px = 0;
+            double Py = 0;
+            double Pr = 0;
+
+            if (cfun.GetSemPositionXY(ref Px, ref Py, ref Pr))
+            {
+                tB_RBPointX.Text = Px.ToString();
+                tB_RBPointY.Text = Py.ToString();
+                RBPoint = new PointF((float)Px, (float)Py);
+            }
+        }
+
+        private void frmInitializeTwoPointRectangle_Load(object sender, EventArgs e)
+        {
+            if (cfun == null)
+            {
+                cfun = SemController.GetSEMController();
+            }
+        }
+
+        private void bn_OK_Click(object sender, EventArgs e)
+        {
+            IsOK = true;
+            this.Close();
+        }
+
+        private void bn_Cancel_Click(object sender, EventArgs e)
+        {
+            this.Close();
+        }
+
+        private void button1_Click(object sender, EventArgs e)
+        {
+            LTPoint = new PointF(Convert.ToSingle(tB_LTPointX.Text), Convert.ToSingle(tB_LTPointY.Text));
+          
+        }
+
+        private void button2_Click(object sender, EventArgs e)
+        {
+            RBPoint = new PointF(Convert.ToSingle(tB_RBPointX.Text), Convert.ToSingle(tB_RBPointY.Text));
+        }
+
+       
+    }
+}

+ 120 - 0
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/frmInitializeTwoPointRectangle.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>