UControl_CutHole.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using MeasureData;
  11. namespace HOZProject
  12. {
  13. public partial class UControl_CutHole : UserControl
  14. {
  15. private string cutHoleName;
  16. public string CutHoleName { get => cutHoleName; set => cutHoleName = value; }
  17. private string cutHoleCode;
  18. public string CutHoleCode { get => cutHoleCode; set => cutHoleCode = value; }
  19. private int cutHoleState;
  20. public int CutHoleState { get => cutHoleState; set => cutHoleState = value; }
  21. private FormHOZMain formHOZMain;
  22. public FormHOZMain FormHOZMainObject { get => formHOZMain; set => formHOZMain = value; }
  23. public UControl_CutHole(FormHOZMain formHOZ)
  24. {
  25. InitializeComponent();
  26. FormHOZMainObject = formHOZ;
  27. }
  28. private void UContrl_CutHole_Load(object sender, EventArgs e)
  29. {
  30. btnCutHole.Text = CutHoleName;
  31. }
  32. private void tsShowProcess_Click(object sender, EventArgs e)
  33. {
  34. ClearProcessControls();
  35. //显示检测过程信息
  36. UControl_Process uControl_Process = new UControl_Process(FormHOZMainObject);
  37. //UCTimeLine uControl_Process = new UCTimeLine();
  38. FormHOZMainObject.plProcess.Width = uControl_Process.Width;
  39. FormHOZMainObject.plProcess.Height = uControl_Process.Height;
  40. if ((this.Location.Y + uControl_Process.Height) > FormHOZMainObject.Height)
  41. {
  42. uControl_Process.Location = new Point(this.Left, this.Bottom- this.Top);
  43. }
  44. else
  45. {
  46. uControl_Process.Location = new Point(this.Location.X, this.Location.Y);
  47. }
  48. uControl_Process.Dock = DockStyle.Fill;
  49. FormHOZMainObject.plProcess.Location = uControl_Process.Location;
  50. FormHOZMainObject.plProcess.Controls.Add(uControl_Process);
  51. FormHOZMainObject.plProcess.Visible = true;
  52. }
  53. private void tsShowParaInfo_Click(object sender, EventArgs e)
  54. {
  55. ClearProcessControls();
  56. //显示切孔参数信息
  57. UControl_ParaInfo uControl_ParaInfo = new UControl_ParaInfo(FormHOZMainObject);
  58. //UCTimeLine uControl_Process = new UCTimeLine();
  59. FormHOZMainObject.plProcess.Width = uControl_ParaInfo.Width;
  60. FormHOZMainObject.plProcess.Height = uControl_ParaInfo.Height;
  61. //if ((this.Location.Y + uControl_ParaInfo.Height) > FormHOZMainObject.Height)
  62. //{
  63. // uControl_ParaInfo.Location = new Point(this.Left, this.Bottom - this.Top);
  64. //}
  65. //else
  66. //{
  67. // uControl_ParaInfo.Location = new Point(this.Location.X, this.Location.Y);
  68. //}
  69. List<CutHole> cutHoleList = FormHOZMainObject.m_MeasureFile.ListCutHole;
  70. foreach (CutHole cutHoleItem in cutHoleList)
  71. {
  72. if (cutHoleItem.HoleName == CutHoleName)
  73. {
  74. //设置当前样品的参数信息
  75. uControl_ParaInfo.CutHoleName = cutHoleItem.HoleName;
  76. uControl_ParaInfo.Position = cutHoleItem.Position;
  77. uControl_ParaInfo.StartTime = cutHoleItem.START.ToString();
  78. uControl_ParaInfo.EndTime = cutHoleItem.END.ToString();
  79. uControl_ParaInfo.State = cutHoleItem.STATE.ToString();
  80. uControl_ParaInfo.IsSwitch = cutHoleItem.SWITCH;
  81. break;
  82. }
  83. }
  84. uControl_ParaInfo.Dock = DockStyle.Fill;
  85. uControl_ParaInfo.ShowParaInfo();
  86. FormHOZMainObject.plProcess.Location = uControl_ParaInfo.Location;
  87. FormHOZMainObject.plProcess.Controls.Add(uControl_ParaInfo);
  88. FormHOZMainObject.plProcess.Visible = true;
  89. }
  90. private void ClearProcessControls()
  91. {
  92. //清空处理层中的控件
  93. FormHOZMainObject.plProcess.Controls.Clear();
  94. }
  95. }
  96. }