UserControl6.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. namespace IMCS.UControl
  11. {
  12. /// <summary>
  13. /// 智能生产保障系统
  14. /// </summary>
  15. public partial class UserControl6 : UserControl
  16. {
  17. public UserControl6()
  18. {
  19. InitializeComponent();
  20. this.Load += UserControl6_Load;
  21. }
  22. private void UserControl6_Load(object sender, EventArgs e)
  23. {
  24. for (int y = 1; y < 11; y++)
  25. {
  26. for (int x = 1; x < 31; x++)
  27. {
  28. // this.tableLayoutPanel1.GetControlFromPosition
  29. Label lb = this.tableLayoutPanel1.GetControlFromPosition(x, y) as Label;
  30. lb.Text = (y + (x - 1) * 10).ToString();
  31. lb.Tag = (y + (x - 1) * 10).ToString();
  32. lb.AutoSize = false;
  33. lb.Width = 69;
  34. lb.Height = 30;
  35. lb.BackColor = System.Drawing.Color.AliceBlue;
  36. lb.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
  37. }
  38. }
  39. int i = 0;
  40. for (int y = 5; y < 15; y++)
  41. {
  42. for (int x = 18; x < 21; x++)
  43. {
  44. i++;
  45. // this.tableLayoutPanel1.GetControlFromPosition
  46. Label lb = this.tableLayoutPanel1.GetControlFromPosition(y, x) as Label;
  47. lb.Text = i.ToString();
  48. lb.Tag = "xia" + (i).ToString();
  49. lb.AutoSize = false;
  50. lb.Width = 69;
  51. lb.Height = 30;
  52. lb.BackColor = System.Drawing.Color.AliceBlue;
  53. lb.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
  54. }
  55. }
  56. this.BackgroundImage = global::IMCS.Properties.Resources.backgroup1;
  57. this.BackgroundImageLayout = ImageLayout.Stretch;
  58. this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
  59. #region 私服舵机
  60. this.uctl_SiFu.deviceStateDefaultList.Device_ConnectionMes = true;
  61. this.uctl_SiFu.deviceStateDefaultList.Device_Name = "私服舵机";
  62. this.uctl_SiFu.deviceStateDefaultList.Device_OnLine = true;
  63. this.uctl_SiFu.deviceStateDefaultList.Device_Runing = DefaultList.EnumDeviceRunState.RunState_Run;
  64. #endregion
  65. #region AGV上下料站1
  66. this.uctl_AGV1.deviceStateDefaultList.Device_ConnectionMes = true;
  67. this.uctl_AGV1.deviceStateDefaultList.Device_Name = "AGV上下料站1";
  68. this.uctl_AGV1.deviceStateDefaultList.Device_OnLine = true;
  69. this.uctl_AGV1.deviceStateDefaultList.Device_Runing = DefaultList.EnumDeviceRunState.RunState_Run;
  70. #endregion
  71. #region AGV上下料站2
  72. this.uctl_AGV2.deviceStateDefaultList.Device_ConnectionMes = true;
  73. this.uctl_AGV2.deviceStateDefaultList.Device_Name = "AGV上下料站2";
  74. this.uctl_AGV2.deviceStateDefaultList.Device_OnLine = true;
  75. this.uctl_AGV2.deviceStateDefaultList.Device_Runing = DefaultList.EnumDeviceRunState.RunState_Run;
  76. #endregion
  77. #region 三坐标检测
  78. this.uctl_SanZuoBiao.deviceStateDefaultList.Device_ConnectionMes = true;
  79. this.uctl_SanZuoBiao.deviceStateDefaultList.Device_Name = "三坐标检测";
  80. this.uctl_SanZuoBiao.deviceStateDefaultList.Device_OnLine = true;
  81. this.uctl_SanZuoBiao.deviceStateDefaultList.Device_Runing = DefaultList.EnumDeviceRunState.RunState_Run;
  82. #endregion
  83. #region 激光打标机
  84. this.uctl_DaBiaoJI.deviceStateDefaultList.Device_ConnectionMes = true;
  85. this.uctl_DaBiaoJI.deviceStateDefaultList.Device_Name = "激光打标机";
  86. this.uctl_DaBiaoJI.deviceStateDefaultList.Device_OnLine = true;
  87. this.uctl_DaBiaoJI.deviceStateDefaultList.Device_Runing = DefaultList.EnumDeviceRunState.RunState_Run;
  88. #endregion
  89. #region 上下料站1
  90. this.uctl_ShangXiaZhan1.deviceStateDefaultList.Device_ConnectionMes = true;
  91. this.uctl_ShangXiaZhan1.deviceStateDefaultList.Device_Name = "上下料站1";
  92. this.uctl_ShangXiaZhan1.deviceStateDefaultList.Device_OnLine = true;
  93. this.uctl_ShangXiaZhan1.deviceStateDefaultList.Device_Runing = DefaultList.EnumDeviceRunState.RunState_Run;
  94. #endregion
  95. #region 上下料站2
  96. this.uctl_ShangXiaZhan2.deviceStateDefaultList.Device_ConnectionMes = true;
  97. this.uctl_ShangXiaZhan2.deviceStateDefaultList.Device_Name = "上下料站2";
  98. this.uctl_ShangXiaZhan2.deviceStateDefaultList.Device_OnLine = true;
  99. this.uctl_ShangXiaZhan2.deviceStateDefaultList.Device_Runing = DefaultList.EnumDeviceRunState.RunState_Run;
  100. #endregion
  101. #region 上下料站3
  102. this.uctl_ShangXiaZhan3.deviceStateDefaultList.Device_ConnectionMes = true;
  103. this.uctl_ShangXiaZhan3.deviceStateDefaultList.Device_Name = "上下料站3";
  104. this.uctl_ShangXiaZhan3.deviceStateDefaultList.Device_OnLine = true;
  105. this.uctl_ShangXiaZhan3.deviceStateDefaultList.Device_Runing = DefaultList.EnumDeviceRunState.RunState_Run;
  106. #endregion
  107. #region 上下料站4
  108. this.uctl_ShangXiaZhan4.deviceStateDefaultList.Device_ConnectionMes = true;
  109. this.uctl_ShangXiaZhan4.deviceStateDefaultList.Device_Name = "上下料站4";
  110. this.uctl_ShangXiaZhan4.deviceStateDefaultList.Device_OnLine = true;
  111. this.uctl_ShangXiaZhan4.deviceStateDefaultList.Device_Runing = DefaultList.EnumDeviceRunState.RunState_Run;
  112. #endregion
  113. #region 上下料站5
  114. this.uctl_ShangXiaZhan5.deviceStateDefaultList.Device_ConnectionMes = true;
  115. this.uctl_ShangXiaZhan5.deviceStateDefaultList.Device_Name = "上下料站5";
  116. this.uctl_ShangXiaZhan5.deviceStateDefaultList.Device_OnLine = true;
  117. this.uctl_ShangXiaZhan5.deviceStateDefaultList.Device_Runing = DefaultList.EnumDeviceRunState.RunState_Run;
  118. #endregion
  119. #region 上下料站6
  120. this.uctl_ShangXiaZhan6.deviceStateDefaultList.Device_ConnectionMes = true;
  121. this.uctl_ShangXiaZhan6.deviceStateDefaultList.Device_Name = "上下料站6";
  122. this.uctl_ShangXiaZhan6.deviceStateDefaultList.Device_OnLine = true;
  123. this.uctl_ShangXiaZhan6.deviceStateDefaultList.Device_Runing = DefaultList.EnumDeviceRunState.RunState_Run;
  124. #endregion
  125. }
  126. }
  127. }