UControl_CutHole.cs 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. FormHOZMainObject.plProcess.Width = uControl_ParaInfo.Width;
  59. FormHOZMainObject.plProcess.Height = uControl_ParaInfo.Height;
  60. List<CutHole> cutHoleList = FormHOZMainObject.m_MeasureFile.ListCutHole;
  61. foreach (CutHole cutHoleItem in cutHoleList)
  62. {
  63. if (cutHoleItem.HoleName == CutHoleName)
  64. {
  65. //设置当前样品的参数信息
  66. uControl_ParaInfo.CutHoleName = cutHoleItem.HoleName;
  67. uControl_ParaInfo.Position = cutHoleItem.Position;
  68. uControl_ParaInfo.StartTime = cutHoleItem.START.ToString();
  69. uControl_ParaInfo.EndTime = cutHoleItem.END.ToString();
  70. uControl_ParaInfo.State = cutHoleItem.STATE.ToString();
  71. uControl_ParaInfo.IsSwitch = cutHoleItem.SWITCH;
  72. break;
  73. }
  74. }
  75. uControl_ParaInfo.Dock = DockStyle.Fill;
  76. //uControl_ParaInfo.ShowParaInfo();
  77. FormHOZMainObject.plProcess.Location = uControl_ParaInfo.Location;
  78. FormHOZMainObject.plProcess.Controls.Add(uControl_ParaInfo);
  79. FormHOZMainObject.plProcess.Visible = true;
  80. }
  81. private void ClearProcessControls()
  82. {
  83. //清空处理层中的控件
  84. FormHOZMainObject.plProcess.Controls.Clear();
  85. }
  86. }
  87. }