UControl_CutHole.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. namespace HOZProject
  11. {
  12. public partial class UControl_CutHole : UserControl
  13. {
  14. private string cutHoleName;
  15. public string CutHoleName { get => cutHoleName; set => cutHoleName = value; }
  16. private string cutHoleCode;
  17. public string CutHoleCode { get => cutHoleCode; set => cutHoleCode = value; }
  18. private int cutHoleState;
  19. public int CutHoleState { get => cutHoleState; set => cutHoleState = value; }
  20. private FormHOZMain formHOZMain;
  21. public FormHOZMain FormHOZMainObject { get => formHOZMain; set => formHOZMain = value; }
  22. public UControl_CutHole(FormHOZMain formHOZ)
  23. {
  24. InitializeComponent();
  25. FormHOZMainObject = formHOZ;
  26. }
  27. private void UContrl_CutHole_Load(object sender, EventArgs e)
  28. {
  29. btnCutHole.Text = CutHoleName;
  30. }
  31. private void tsShowProcess_Click(object sender, EventArgs e)
  32. {
  33. ClearProcessControls();
  34. //显示检测过程信息
  35. UControl_Process uControl_Process = new UControl_Process(FormHOZMainObject);
  36. //UCTimeLine uControl_Process = new UCTimeLine();
  37. FormHOZMainObject.plProcess.Width = uControl_Process.Width;
  38. FormHOZMainObject.plProcess.Height = uControl_Process.Height;
  39. if ((this.Location.Y + uControl_Process.Height) > FormHOZMainObject.Height)
  40. {
  41. uControl_Process.Location = new Point(this.Left, this.Bottom- this.Top);
  42. }
  43. else
  44. {
  45. uControl_Process.Location = new Point(this.Location.X, this.Location.Y);
  46. }
  47. uControl_Process.Dock = DockStyle.Fill;
  48. FormHOZMainObject.plProcess.Location = uControl_Process.Location;
  49. FormHOZMainObject.plProcess.Controls.Add(uControl_Process);
  50. FormHOZMainObject.plProcess.Visible = true;
  51. }
  52. private void tsShowParaInfo_Click(object sender, EventArgs e)
  53. {
  54. ClearProcessControls();
  55. //显示切孔参数信息
  56. UControl_ParaInfo uControl_ParaInfo = new UControl_ParaInfo(FormHOZMainObject);
  57. //UCTimeLine uControl_Process = new UCTimeLine();
  58. FormHOZMainObject.plProcess.Width = uControl_ParaInfo.Width;
  59. FormHOZMainObject.plProcess.Height = uControl_ParaInfo.Height;
  60. if ((this.Location.Y + uControl_ParaInfo.Height) > FormHOZMainObject.Height)
  61. {
  62. uControl_ParaInfo.Location = new Point(this.Left, this.Bottom - this.Top);
  63. }
  64. else
  65. {
  66. uControl_ParaInfo.Location = new Point(this.Location.X, this.Location.Y);
  67. }
  68. uControl_ParaInfo.Dock = DockStyle.Fill;
  69. FormHOZMainObject.plProcess.Location = uControl_ParaInfo.Location;
  70. FormHOZMainObject.plProcess.Controls.Add(uControl_ParaInfo);
  71. FormHOZMainObject.plProcess.Visible = true;
  72. }
  73. private void ClearProcessControls()
  74. {
  75. //清空处理层中的控件
  76. FormHOZMainObject.plProcess.Controls.Clear();
  77. }
  78. }
  79. }