123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- 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<CutHole> 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();
- }
- }
- }
|