using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using MeasureData; namespace HOZProject { public partial class UControl_CutHole : UserControl { private string cutHoleName; public string CutHoleName { get => cutHoleName; set => cutHoleName = value; } private string cutHoleCode; public string CutHoleCode { get => cutHoleCode; set => cutHoleCode = value; } private int cutHoleState; public int CutHoleState { get => cutHoleState; set => cutHoleState = value; } private FormHOZMain formHOZMain; public FormHOZMain FormHOZMainObject { get => formHOZMain; set => formHOZMain = value; } public UControl_CutHole(FormHOZMain formHOZ) { InitializeComponent(); FormHOZMainObject = formHOZ; } private void UContrl_CutHole_Load(object sender, EventArgs e) { btnCutHole.Text = CutHoleName; } private void tsShowProcess_Click(object sender, EventArgs e) { ClearProcessControls(); //显示检测过程信息 UControl_Process uControl_Process = new UControl_Process(FormHOZMainObject); //UCTimeLine uControl_Process = new UCTimeLine(); FormHOZMainObject.plProcess.Width = uControl_Process.Width; FormHOZMainObject.plProcess.Height = uControl_Process.Height; if ((this.Location.Y + uControl_Process.Height) > FormHOZMainObject.Height) { uControl_Process.Location = new Point(this.Left, this.Bottom- this.Top); } else { uControl_Process.Location = new Point(this.Location.X, this.Location.Y); } uControl_Process.Dock = DockStyle.Fill; FormHOZMainObject.plProcess.Location = uControl_Process.Location; FormHOZMainObject.plProcess.Controls.Add(uControl_Process); FormHOZMainObject.plProcess.Visible = true; } private void tsShowParaInfo_Click(object sender, EventArgs e) { ClearProcessControls(); //显示切孔参数信息 UControl_ParaInfo uControl_ParaInfo = new UControl_ParaInfo(FormHOZMainObject); //UCTimeLine uControl_Process = new UCTimeLine(); FormHOZMainObject.plProcess.Width = uControl_ParaInfo.Width; FormHOZMainObject.plProcess.Height = uControl_ParaInfo.Height; //if ((this.Location.Y + uControl_ParaInfo.Height) > FormHOZMainObject.Height) //{ // uControl_ParaInfo.Location = new Point(this.Left, this.Bottom - this.Top); //} //else //{ // uControl_ParaInfo.Location = new Point(this.Location.X, this.Location.Y); //} List cutHoleList = FormHOZMainObject.m_MeasureFile.ListCutHole; foreach (CutHole cutHoleItem in cutHoleList) { if (cutHoleItem.HoleName == CutHoleName) { //设置当前样品的参数信息 uControl_ParaInfo.CutHoleName = cutHoleItem.HoleName; uControl_ParaInfo.Position = cutHoleItem.Position; uControl_ParaInfo.StartTime = cutHoleItem.START.ToString(); uControl_ParaInfo.EndTime = cutHoleItem.END.ToString(); uControl_ParaInfo.State = cutHoleItem.STATE.ToString(); uControl_ParaInfo.IsSwitch = cutHoleItem.SWITCH; break; } } uControl_ParaInfo.Dock = DockStyle.Fill; uControl_ParaInfo.ShowParaInfo(); FormHOZMainObject.plProcess.Location = uControl_ParaInfo.Location; FormHOZMainObject.plProcess.Controls.Add(uControl_ParaInfo); FormHOZMainObject.plProcess.Visible = true; } private void ClearProcessControls() { //清空处理层中的控件 FormHOZMainObject.plProcess.Controls.Clear(); } } }