UControl_ParaInfo.cs 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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_ParaInfo : UserControl
  14. {
  15. /// <summary>
  16. /// 开始时间
  17. /// </summary>
  18. private string startTime;
  19. /// <summary>
  20. /// 结束时间
  21. /// </summary>
  22. private string endTime;
  23. /// <summary>
  24. /// 状态
  25. /// </summary>
  26. private string state;
  27. /// <summary>
  28. /// 位置
  29. /// </summary>
  30. private SemPosition position;
  31. private bool isSwitch;
  32. private string cutHoleName;
  33. private FormHOZMain formHOZMain;
  34. public FormHOZMain FormHOZMainObject { get => formHOZMain; set => formHOZMain = value; }
  35. public string StartTime { get => startTime; set => startTime = value; }
  36. public string EndTime { get => endTime; set => endTime = value; }
  37. public string State { get => state; set => state = value; }
  38. public SemPosition Position { get => position; set => position = value; }
  39. public string CutHoleName { get => cutHoleName; set => cutHoleName = value; }
  40. public bool IsSwitch { get => isSwitch; set => isSwitch = value; }
  41. public UControl_ParaInfo(FormHOZMain formHOZ)
  42. {
  43. InitializeComponent();
  44. FormHOZMainObject = formHOZ;
  45. }
  46. private void btnClose_Click(object sender, EventArgs e)
  47. {
  48. foreach (Control item in FormHOZMainObject.plFill.Controls)
  49. {
  50. if (item is Panel)
  51. {
  52. foreach (Control itemControl in item.Controls)
  53. {
  54. if (itemControl.Name == this.Name)
  55. {
  56. item.Controls.Remove(this);
  57. this.Dispose();
  58. item.Visible = false;
  59. break;
  60. }
  61. }
  62. }
  63. }
  64. }
  65. /// <summary>
  66. /// 显示切孔参数信息
  67. /// </summary>
  68. public void ShowParaInfo()
  69. {
  70. int multiple = 1000;
  71. //设置Position参数
  72. lblX.Text = (Position.X * multiple).ToString("f3");
  73. lblY.Text = (Position.Y * multiple).ToString("f3");
  74. lblZ.Text = (Position.Z * multiple).ToString("f3");
  75. lblR.Text = Position.R.ToString();
  76. lblT.Text = Position.T.ToString();
  77. lblM.Text = Position.M.ToString();
  78. lblShowStartTime.Text = StartTime;
  79. lblShowEndTime.Text = EndTime;
  80. lblShowState.Text = State;
  81. lblCutHoleName.Text = CutHoleName;
  82. CkIsSwitch.Checked = IsSwitch;
  83. }
  84. }
  85. }