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)); } } }